Hey,
I’ve played around a little bit with the HUDs and canvas using power of 2 textures (32x32 blue color).
Is it possible to draw a full custom image, which has a size of 300x15 ?
Hey,
I’ve played around a little bit with the HUDs and canvas using power of 2 textures (32x32 blue color).
Is it possible to draw a full custom image, which has a size of 300x15 ?
#Hud.h
You have complete control over size, uv mapping and everything right here:
/**
* Draws a textured quad on the HUD.
* @param Texture Texture to draw.
* @param ScreenX Screen-space X coordinate of upper left corner of the quad.
* @param ScreenY Screen-space Y coordinate of upper left corner of the quad.
* @param ScreenW Screen-space width of the quad (in pixels).
* @param ScreenH Screen-space height of the quad (in pixels).
* @param TextureU Texture-space U coordinate of upper left corner of the quad
* @param TextureV Texture-space V coordinate of upper left corner of the quad.
* @param TextureUWidth Texture-space width of the quad (in normalized UV distance).
* @param TextureVHeight Texture-space height of the quad (in normalized UV distance).
* @param TintColor Vertex color for the quad.
* @param BlendMode Controls how to blend this quad with the scene. Translucent by default.
* @param Scale Amount to scale the entire texture (horizontally and vertically)
* @param bScalePosition Whether the "Scale" parameter should also scale the position of this draw call.
* @param Rotation Amount to rotate this quad
* @param RotPivot Location (as proportion of quad, 0-1) to rotate about
*/
UFUNCTION(BlueprintCallable, Category=HUD, meta=(Scale = "1", bScalePosition = "false", AdvancedDisplay = "9"))
void DrawTexture(UTexture* Texture, float ScreenX, float ScreenY, float ScreenW, float ScreenH, float TextureU, float TextureV, float TextureUWidth, float TextureVHeight, FLinearColor TintColor=FLinearColor::White, EBlendMode BlendMode=BLEND_Translucent, float Scale=1.f, bool bScalePosition=false, float Rotation=0.f, FVector2D RotPivot=FVector2D::ZeroVector);
/**
* Draws a textured quad on the HUD. Assumes 1:1 texel density.
* @param Texture Texture to draw.
* @param ScreenX Screen-space X coordinate of upper left corner of the quad.
* @param ScreenY Screen-space Y coordinate of upper left corner of the quad.
* @param Scale Scale multiplier to control size of the text.
* @param bScalePosition Whether the "Scale" parameter should also scale the position of this draw call.
*/
UFUNCTION(BlueprintCallable, Category=HUD, meta=(Scale = "1", bScalePosition = "false"))
void DrawTextureSimple(UTexture* Texture, float ScreenX, float ScreenY, float Scale=1.f, bool bScalePosition=false);
/**
* Draws a material-textured quad on the HUD.
* @param Material Material to use
* @param ScreenX Screen-space X coordinate of upper left corner of the quad.
* @param ScreenY Screen-space Y coordinate of upper left corner of the quad.
* @param ScreenW Screen-space width of the quad (in pixels).
* @param ScreenH Screen-space height of the quad (in pixels).
* @param MaterialU Texture-space U coordinate of upper left corner of the quad
* @param MaterialV Texture-space V coordinate of upper left corner of the quad.
* @param MaterialUWidth Texture-space width of the quad (in normalized UV distance).
* @param MaterialVHeight Texture-space height of the quad (in normalized UV distance).
* @param Scale Amount to scale the entire texture (horizontally and vertically)
* @param bScalePosition Whether the "Scale" parameter should also scale the position of this draw call.
* @param Rotation Amount to rotate this quad
* @param RotPivot Location (as proportion of quad, 0-1) to rotate about
*/
UFUNCTION(BlueprintCallable, Category=HUD, meta=(Scale = "1", bScalePosition = "false", AdvancedDisplay = "9"))
void DrawMaterial(UMaterialInterface* Material, float ScreenX, float ScreenY, float ScreenW, float ScreenH, float MaterialU, float MaterialV, float MaterialUWidth, float MaterialVHeight, float Scale=1.f, bool bScalePosition=false, float Rotation=0.f, FVector2D RotPivot=FVector2D::ZeroVector);
/**
* Draws a material-textured quad on the HUD. Assumes UVs such that the entire material is shown.
* @param Material Material to use
* @param ScreenX Screen-space X coordinate of upper left corner of the quad.
* @param ScreenY Screen-space Y coordinate of upper left corner of the quad.
* @param ScreenW Screen-space width of the quad (in pixels).
* @param ScreenH Screen-space height of the quad (in pixels).
* @param Scale Amount to scale the entire texture (horizontally and vertically)
* @param bScalePosition Whether the "Scale" parameter should also scale the position of this draw call.
*/
UFUNCTION(BlueprintCallable, Category=HUD, meta=(Scale = "1", bScalePosition = "false"))
void DrawMaterialSimple(UMaterialInterface* Material, float ScreenX, float ScreenY, float ScreenW, float ScreenH, float Scale=1.f, bool bScalePosition=false);