Mostly Harmless

UE3:Canvas (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 09:41, 19 May 2010 by CodeMonkey (Talk | contribs) (Page needs expanding.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UDK Object >> Canvas
Package: 
Engine
This class in other games:
RTNP, U1, UT, U2XMP, UE2Runtime, U2, UT2003, UT2004, UT3

Canvas: A drawing canvas.

Properties[edit]

bCenter[edit]

Type: bool

Whether to center the text.

bNoSmooth[edit]

Type: bool

Don't bilinear filter.

Canvas[edit]

Type: pointer{FCanvas}

Modifiers: native, const


ClipX[edit]

Type: float


ClipY[edit]

Type: float

Bottom right clipping region.

ColorModulate[edit]

Type: Object.Plane


Default value:

Member Value
W 1.0
X 1.0
Y 1.0
Z 1.0

CurX[edit]

Type: float


CurY[edit]

Type: float

Current position for drawing.

CurYL[edit]

Type: float

Largest Y size since DrawText.

DefaultTexture[edit]

Type: Texture2D


Default value: Texture2D'EngineResources.WhiteSquareTexture'

DrawColor[edit]

Type: Object.Color

Color for drawing.

Default value:

Member Value
A 255
B 127
G 127
R 127

Font[edit]

Type: Font

Font for DrawText.

Default value: Font'EngineFonts.SmallFont'

OrgX[edit]

Type: float


OrgY[edit]

Type: float

Origin for drawing.

SceneView[edit]

Type: pointer{FSceneView}

Modifiers: native, const


SizeX[edit]

Type: int

Modifiers: const


SizeY[edit]

Type: int

Modifiers: const


Structs[edit]

CanvasIcon[edit]

Modifiers: native

Holds texture information with UV coordinates as well.

Texture Texture 
Source texture
float
UV coords
float
UV coords
float UL 
UV coords
float VL 
UV coords

DepthFieldGlowInfo[edit]

Modifiers: native

info for glow when using depth field rendering

bool bEnableGlow 
whether to turn on the outline glow (depth field fonts only)
Object.LinearColor GlowColor 
base color to use for the glow
Object.Vector2D GlowOuterRadius 
if bEnableGlow, outline glow outer radius (0 to 1, 0.5 is edge of character silhouette)

glow influence will be 0 at GlowOuterRadius.X and 1 at GlowOuterRadius.Y

Object.Vector2D GlowInnerRadius 
if bEnableGlow, outline glow inner radius (0 to 1, 0.5 is edge of character silhouette)

glow influence will be 1 at GlowInnerRadius.X and 0 at GlowInnerRadius.Y

FontRenderInfo[edit]

Modifiers: native

information used in font rendering

bool bClipText 
whether to clip text
bool bEnableShadow 
whether to turn on shadowing
DepthFieldGlowInfo GlowInfo 
depth field glow parameters (only usable if font was imported with a depth field)

Functions[edit]

Static functions[edit]

CreateFontRenderInfo[edit]

static final function FontRenderInfo CreateFontRenderInfo (optional bool bClipText, optional bool bEnableShadow, optional Object.LinearColor GlowColor, optional Object.Vector2D GlowOuterRadius, optional Object.Vector2D GlowInnerRadius)

constructor for FontRenderInfo

Native functions[edit]

DeProject[edit]

native noexport final function DeProject (Object.Vector2D ScreenPos, out Object.Vector WorldOrigin, out Object.Vector WorldDirection)

transforms 2D screen coordinates into a 3D world-space origin and direction

Parameters:

  • ScreenPos - screen coordinates in pixels
  • WorldOrigin - out) - world-space origin vector
  • WorldDirection - out) - world-space direction vector

Draw2DLine[edit]

native noexport final function Draw2DLine (float X1, float Y1, float X2, float Y2, Object.Color LineColor)


DrawColorizedTile[edit]

native noexport final function DrawColorizedTile (Texture Tex, float XL, float YL, float U, float V, float UL, float VL, Object.LinearColor LColor)


DrawMaterialTile[edit]

native noexport final function DrawMaterialTile (MaterialInterface Mat, float XL, float YL, optional float U, optional float V, optional float UL, optional float VL)

Draws the emissive channel of a material to an axis-aligned quad at CurX,CurY.

Parameters:

  • Mat - The material which contains the emissive expression to render.
  • XL - The width of the quad in pixels.
  • YL - The height of the quad in pixels.
  • U - The U coordinate of the quad's upper left corner, in normalized coordinates.
  • V - The V coordinate of the quad's upper left corner, in normalized coordinates.
  • UL - The range of U coordinates which is mapped to the quad.
  • VL - The range of V coordinates which is mapped to the quad.

DrawMaterialTileClipped[edit]

native noexport final function DrawMaterialTileClipped (MaterialInterface Mat, float XL, float YL, optional float U, optional float V, optional float UL, optional float VL)


DrawRotatedMaterialTile[edit]

native final function DrawRotatedMaterialTile (MaterialInterface Mat, Object.Rotator Rotation, float XL, float YL, optional float U, optional float V, optional float UL, optional float VL, optional float AnchorX, optional float AnchorY)


DrawRotatedTile[edit]

native final function DrawRotatedTile (Texture Tex, Object.Rotator Rotation, float XL, float YL, float U, float V, float UL, float VL, optional float AnchorX, optional float AnchorY)


DrawText[edit]

native noexport final function DrawText (coerce string Text, optional bool CR, optional float XScale, optional float YScale, optional const out FontRenderInfo RenderInfo)


DrawTextureDoubleLine[edit]

native final function DrawTextureDoubleLine (Object.Vector StartPoint, Object.Vector EndPoint, float Perc, float Spacing, float Width, Object.Color LineColor, Object.Color AltLineColor, Texture Tex, float U, float V, float UL, float VL)


DrawTextureLine[edit]

native final function DrawTextureLine (Object.Vector StartPoint, Object.Vector EndPoint, float Perc, float Width, Object.Color LineColor, Texture LineTexture, float U, float V, float UL, float VL)


DrawTile[edit]

native noexport final function DrawTile (Texture Tex, float XL, float YL, float U, float V, float UL, float VL)


DrawTileClipped[edit]

native(468) noexport final function DrawTileClipped (Texture Tex, float XL, float YL, float U, float V, float UL, float VL)


DrawTileStretched[edit]

native noexport final function DrawTileStretched (Texture Tex, float XL, float YL, float U, float V, float UL, float VL, Object.LinearColor LColor, optional bool bStretchHorizontally, optional bool bStretchVertically, optional float ScalingFactor)


PopTransform[edit]

native noexport final function PopTransform ()

Pops the topmost matrix from the canvas transform stack.

Project[edit]

native noexport final function Object.Vector Project (Object.Vector location)

Convert a 3D vector to a 2D screen coords.

PushTranslationMatrix[edit]

native noexport final function PushTranslationMatrix (Object.Vector TranslationVector)

Pushes a translation matrix onto the canvas.

Parameters:

  • TranslationVector - Translation vector to use to create the translation matrix.

SetDrawColor[edit]

native final function SetDrawColor (byte R, byte G, byte B, optional byte A)


SetPos[edit]

native final function SetPos (float PosX, float PosY)


StrLen[edit]

native noexport final function StrLen (coerce string String, out float XL, out float YL)


TextSize[edit]

native noexport final function TextSize (coerce string String, out float XL, out float YL)


Events[edit]

Reset[edit]

event Reset (optional bool bKeepOrigin)


Other instance functions[edit]

DrawBox[edit]

final simulated function DrawBox (float width, float height)


DrawDebugGraph[edit]

function DrawDebugGraph (coerce string Title, float ValueX, float ValueY, float UL_X, float UL_Y, float W, float H, Object.Vector2D RangeX, Object.Vector2D RangeY)

Draws a graph comparing 2 variables. Useful for visual debugging and tweaking.

Parameters:

  • Title - Label to draw on the graph, or "" for none
  • ValueX - X-axis value of the point to plot
  • ValueY - Y-axis value of the point to plot
  • UL_X - X screen coord of the upper-left corner of the graph
  • UL_Y - Y screen coord of the upper-left corner of the graph
  • W - Width of the graph, in pixels
  • H - Height of the graph, in pixels
  • RangeX - Range of values expressed by the X axis of the graph
  • RangeY - Range of values expressed by the Y axis of the graph

DrawIcon[edit]

final function DrawIcon (CanvasIcon Icon, float X, float Y, optional float Scale)

Draw a CanvasIcon at the desired canvas position.

DrawIconSection[edit]

final function DrawIconSection (CanvasIcon Icon, float X, float Y, float UStartPct, float VStartPct, float UEndPct, float VEndPct, optional float Scale)

Draw a subsection of a CanvasIcon at the desired canvas position.

DrawRect[edit]

final function DrawRect (float RectX, float RectY, optional Texture Tex)


DrawTextCentered[edit]

final function DrawTextCentered (coerce string Text, optional bool CR, optional float XScale, optional float YScale, optional const FontRenderInfo RenderInfo)


DrawTextRA[edit]

final function DrawTextRA (coerce string Text, optional bool CR)

Draws text right aligned from the current position.

DrawTexture[edit]

final function DrawTexture (Texture Tex, float Scale)


MakeIcon[edit]

final function CanvasIcon MakeIcon (Texture Texture, optional float U, optional float V, optional float UL, optional float VL)

Fake CanvasIcon constructor.

SetClip[edit]

final function SetClip (float X, float Y)


SetOrigin[edit]

final function SetOrigin (float X, float Y)