Class Canvas
A drawing canvas.
Inherited Members
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class Canvas : UObject
Properties
| Improve this Doc View SourcebCenterX
Declaration
public bool bCenterX { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
bCenterY
Declaration
public bool bCenterY { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
bNoSmooth
Declaration
public bool bNoSmooth { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ClipX
Origin for drawing in Y.
Declaration
public float ClipX { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ClipY
Bottom right clipping region.
Declaration
public float ClipY { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ColorModulate
Internal.
Declaration
public Plane ColorModulate { get; set; }
Property Value
Type | Description |
---|---|
Plane |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static Canvas DefaultObject { get; }
Property Value
Type | Description |
---|---|
Canvas |
DefaultTexture
Default Texture
Declaration
public Texture2D DefaultTexture { get; set; }
Property Value
Type | Description |
---|---|
Texture2D |
DrawColor
Bottom right clipping region.
Declaration
public Color DrawColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
GradientTexture0
Default texture to use
Declaration
public Texture2D GradientTexture0 { get; set; }
Property Value
Type | Description |
---|---|
Texture2D |
OrgX
Modifiable properties.
Declaration
public float OrgX { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
OrgY
Origin for drawing in X.
Declaration
public float OrgY { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ReporterGraph
Helper class to render 2d graphs on canvas
Declaration
public ReporterGraph ReporterGraph { get; set; }
Property Value
Type | Description |
---|---|
ReporterGraph |
SizeX
Don't bilinear filter.
Declaration
public int SizeX { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SizeY
Zero-based actual dimensions X.
Declaration
public int SizeY { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceK2_Deproject(Vector2D)
Performs a deprojection of a screen space coordinate using the projection matrix set up for the Canvas.
Declaration
public (Vector, Vector) K2_Deproject(Vector2D ScreenPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector2D | ScreenPosition |
Returns
Type | Description |
---|---|
System.ValueTuple<Vector, Vector> |
Remarks
@param ScreenPosition Screen space position to deproject to the World. @param WorldOrigin Vector which is the world position of the screen space position. @param WorldDirection Vector which can be used in a trace to determine what is "behind" the screen space position. Useful for object picking.
K2_DrawBorder(Texture, Texture, Texture, Texture, Texture, Texture, Vector2D, Vector2D, Vector2D, Vector2D, LinearColor, Vector2D, Vector2D, Single, Vector2D, Vector2D)
Declaration
public void K2_DrawBorder(Texture BorderTexture, Texture BackgroundTexture, Texture LeftBorderTexture, Texture RightBorderTexture, Texture TopBorderTexture, Texture BottomBorderTexture, Vector2D ScreenPosition, Vector2D ScreenSize, Vector2D CoordinatePosition, Vector2D CoordinateSize, LinearColor RenderColor, Vector2D BorderScale, Vector2D BackgroundScale, float Rotation, Vector2D PivotPoint, Vector2D CornerSize)
Parameters
Type | Name | Description |
---|---|---|
Texture | BorderTexture | |
Texture | BackgroundTexture | |
Texture | LeftBorderTexture | |
Texture | RightBorderTexture | |
Texture | TopBorderTexture | |
Texture | BottomBorderTexture | |
Vector2D | ScreenPosition | |
Vector2D | ScreenSize | |
Vector2D | CoordinatePosition | |
Vector2D | CoordinateSize | |
LinearColor | RenderColor | |
Vector2D | BorderScale | |
Vector2D | BackgroundScale | |
System.Single | Rotation | |
Vector2D | PivotPoint | |
Vector2D | CornerSize |
K2_DrawBox(Vector2D, Vector2D, Single, LinearColor)
Draws an unfilled box on the Canvas.
Declaration
public void K2_DrawBox(Vector2D ScreenPosition, Vector2D ScreenSize, float Thickness, LinearColor RenderColor)
Parameters
Type | Name | Description |
---|---|---|
Vector2D | ScreenPosition | |
Vector2D | ScreenSize | |
System.Single | Thickness | |
LinearColor | RenderColor |
Remarks
@param ScreenPosition Screen space position to render the text. @param ScreenSize Screen space size to render the texture. @param Thickness How many pixels thick the box lines should be.
K2_DrawLine(Vector2D, Vector2D, Single, LinearColor)
Draws a line on the Canvas.
Declaration
public void K2_DrawLine(Vector2D ScreenPositionA, Vector2D ScreenPositionB, float Thickness, LinearColor RenderColor)
Parameters
Type | Name | Description |
---|---|---|
Vector2D | ScreenPositionA | |
Vector2D | ScreenPositionB | |
System.Single | Thickness | |
LinearColor | RenderColor |
Remarks
@param ScreenPositionA Starting position of the line in screen space. @param ScreenPositionB Ending position of the line in screen space. @param Thickness How many pixels thick this line should be. @param RenderColor Color to render the line.
K2_DrawMaterial(MaterialInterface, Vector2D, Vector2D, Vector2D, Vector2D, Single, Vector2D)
Draws a material on the Canvas.
Declaration
public void K2_DrawMaterial(MaterialInterface RenderMaterial, Vector2D ScreenPosition, Vector2D ScreenSize, Vector2D CoordinatePosition, Vector2D CoordinateSize, float Rotation, Vector2D PivotPoint)
Parameters
Type | Name | Description |
---|---|---|
MaterialInterface | RenderMaterial | |
Vector2D | ScreenPosition | |
Vector2D | ScreenSize | |
Vector2D | CoordinatePosition | |
Vector2D | CoordinateSize | |
System.Single | Rotation | |
Vector2D | PivotPoint |
Remarks
@param RenderMaterial Material to use when rendering. Remember that only the emissive channel is able to be rendered as no lighting is performed when rendering to the Canvas. @param ScreenPosition Screen space position to render the texture. @param ScreenSize Screen space size to render the texture. @param CoordinatePosition Normalized UV starting coordinate to use when rendering the texture. @param CoordinateSize Normalized UV size coordinate to use when rendering the texture. @param Rotation Rotation, in degrees, to render the texture. @param PivotPoint Normalized pivot point to use when rotating the texture.
K2_DrawMaterialTriangle(MaterialInterface, Byte)
Draws a set of triangles on the Canvas.
Declaration
public void K2_DrawMaterialTriangle(MaterialInterface RenderMaterial, byte Triangles)
Parameters
Type | Name | Description |
---|---|---|
MaterialInterface | RenderMaterial | |
System.Byte | Triangles |
Remarks
@param RenderMaterial Material to use when rendering. Remember that only the emissive channel is able to be rendered as no lighting is performed when rendering to the Canvas. @param Triangles Triangles to render.
K2_DrawPolygon(Texture, Vector2D, Vector2D, Int32, LinearColor)
Draws a polygon on the Canvas.
Declaration
public void K2_DrawPolygon(Texture RenderTexture, Vector2D ScreenPosition, Vector2D Radius, int NumberOfSides, LinearColor RenderColor)
Parameters
Type | Name | Description |
---|---|---|
Texture | RenderTexture | |
Vector2D | ScreenPosition | |
Vector2D | Radius | |
System.Int32 | NumberOfSides | |
LinearColor | RenderColor |
Remarks
@param RenderTexture Texture to use when rendering the triangles. If no texture is set, then the default white texture is used. @param ScreenPosition Screen space position to render the text. @param Radius How large in pixels this polygon should be. @param NumberOfSides How many sides this polygon should have. This should be above or equal to three. @param RenderColor Color to tint the polygon.
K2_DrawText(Font, String, Vector2D, Vector2D, LinearColor, Single, LinearColor, Vector2D, Boolean, Boolean, Boolean, LinearColor)
Draws text on the Canvas.
Declaration
public void K2_DrawText(Font RenderFont, string RenderText, Vector2D ScreenPosition, Vector2D Scale, LinearColor RenderColor, float Kerning, LinearColor ShadowColor, Vector2D ShadowOffset, bool bCentreX, bool bCentreY, bool bOutlined, LinearColor OutlineColor)
Parameters
Type | Name | Description |
---|---|---|
Font | RenderFont | |
System.String | RenderText | |
Vector2D | ScreenPosition | |
Vector2D | Scale | |
LinearColor | RenderColor | |
System.Single | Kerning | |
LinearColor | ShadowColor | |
Vector2D | ShadowOffset | |
System.Boolean | bCentreX | |
System.Boolean | bCentreY | |
System.Boolean | bOutlined | |
LinearColor | OutlineColor |
Remarks
@param RenderFont Font to use when rendering the text. If this is null, then a default engine font is used. @param RenderText Text to render on the Canvas. @param ScreenPosition Screen space position to render the text. @param RenderColor Color to render the text. @param Kerning Horizontal spacing adjustment to modify the spacing between each letter. @param ShadowColor Color to render the shadow of the text. @param ShadowOffset Pixel offset relative to the screen space position to render the shadow of the text. @param bCentreX If true, then interpret the screen space position X coordinate as the center of the rendered text. @param bCentreY If true, then interpret the screen space position Y coordinate as the center of the rendered text. @param bOutlined If true, then the text should be rendered with an outline. @param OutlineColor Color to render the outline for the text.
K2_DrawTexture(Texture, Vector2D, Vector2D, Vector2D, Vector2D, LinearColor, Byte, Single, Vector2D)
Draws a texture on the Canvas.
Declaration
public void K2_DrawTexture(Texture RenderTexture, Vector2D ScreenPosition, Vector2D ScreenSize, Vector2D CoordinatePosition, Vector2D CoordinateSize, LinearColor RenderColor, byte BlendMode, float Rotation, Vector2D PivotPoint)
Parameters
Type | Name | Description |
---|---|---|
Texture | RenderTexture | |
Vector2D | ScreenPosition | |
Vector2D | ScreenSize | |
Vector2D | CoordinatePosition | |
Vector2D | CoordinateSize | |
LinearColor | RenderColor | |
System.Byte | BlendMode | |
System.Single | Rotation | |
Vector2D | PivotPoint |
Remarks
@param RenderTexture Texture to use when rendering. If no texture is set then this will use the default white texture. @param ScreenPosition Screen space position to render the texture. @param ScreenSize Screen space size to render the texture. @param CoordinatePosition Normalized UV starting coordinate to use when rendering the texture. @param CoordinateSize Normalized UV size coordinate to use when rendering the texture. @param RenderColor Color to use when rendering the texture. @param BlendMode Blending mode to use when rendering the texture. @param Rotation Rotation, in degrees, to render the texture. @param PivotPoint Normalized pivot point to use when rotating the texture.
K2_DrawTriangle(Texture, Byte)
Draws a set of triangles on the Canvas.
Declaration
public void K2_DrawTriangle(Texture RenderTexture, byte Triangles)
Parameters
Type | Name | Description |
---|---|---|
Texture | RenderTexture | |
System.Byte | Triangles |
Remarks
@param RenderTexture Texture to use when rendering the triangles. If no texture is set, then the default white texture is used. @param Triangles Triangles to render.
K2_Project(Vector)
Performs a projection of a world space coordinates using the projection matrix set up for the Canvas.
Declaration
public Vector K2_Project(Vector WorldLocation)
Parameters
Type | Name | Description |
---|---|---|
Vector | WorldLocation |
Returns
Type | Description |
---|---|
Vector |
Remarks
@param WorldLocation World space location to project onto the Canvas rendering plane. @return Returns a vector where X, Y defines a screen space position representing the world space location.
K2_StrLen(Font, String)
Returns the wrapped text size in screen space coordinates.
Declaration
public Vector2D K2_StrLen(Font RenderFont, string RenderText)
Parameters
Type | Name | Description |
---|---|---|
Font | RenderFont | |
System.String | RenderText |
Returns
Type | Description |
---|---|
Vector2D |
Remarks
@param RenderFont Font to use when determining the size of the text. If this is null, then a default engine font is used. @param RenderText Text to determine the size of. @return Returns the screen space size of the text.
K2_TextSize(Font, String, Vector2D)
Returns the clipped text size in screen space coordinates.
Declaration
public Vector2D K2_TextSize(Font RenderFont, string RenderText, Vector2D Scale)
Parameters
Type | Name | Description |
---|---|---|
Font | RenderFont | |
System.String | RenderText | |
Vector2D | Scale |
Returns
Type | Description |
---|---|
Vector2D |
Remarks
@param RenderFont Font to use when determining the size of the text. If this is null, then a default engine font is used. @param RenderText Text to determine the size of. @param Scale Scale of the font to use when determining the size of the text. @return Returns the screen space size of the text.
New(UObject, Name)
Spawn an object of this class
Declaration
public static Canvas New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
Canvas |
Operators
| Improve this Doc View SourceImplicit(IntPtr to Canvas)
Convert from IntPtr to UObject
Declaration
public static implicit operator Canvas(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
Canvas |