UE2:Canvas (UT2004)
Object >> Canvas |
- Package:
- Engine
- This class in other games:
Please help improve this article or section by expanding it. |
This class represents the drawing canvas on the screen after the world has been rendered. You cannot create objects of this class. Instead, certain engine events, such as Hud.PostRender() or InteractionMaster.Process_PostRender, pass a Canvas object as a parameter that is passed on to any other drawing functions called from those events.
If you have the choice and it doesn't make your code much more complex, try grouping draw calls with the same material and render style. Switching between different materials or styles can cost some performance, which is why the HudBase class splits up the main rendering into several stages with fixed render styles.
Properties
bCenter
Type: bool
Whether to center the text drawn with DrawText().
bForceAlpha
Type: bool
Force all text and texture drawing to use ForcedAlpha as draw color alpha value.
bNoSmooth
Type: bool
(not used)
bRenderLevel
Type: bool
Whether to render the world. This property is reset every tick. The last chance to turn off level rendering is during the various PreRender() calls of Interactions and GUIComponents. Usually you don't have any reason to turn of world rendering, unless you are going to cover the entire screen and don't want to waste performance rendering something that wouldn't be seen anyway.
Default value: True
ClipX
Type: float
Width of clipping region.
ClipY
Type: float
Height of clipping region.
ColorModulate
Type: Object.Plane
DrawColor is multiplied by this before drawing textures, text or screen actors.
Default value:
Member | Value |
---|---|
W | 1.0 |
X | 1.0 |
Y | 1.0 |
Z | 1.0 |
CurX
Type: float
Current X position for drawing.
CurY
Type: float
Current Y position for drawing.
CurYL
Type: float
Largest width of recently drawn text, unless DrawText() is called with the CR parameter being True.
DrawColor
Type: Object.Color
Color for drawing.
Default value:
Member | Value |
---|---|
A | 255 |
B | 127 |
G | 127 |
R | 127 |
Font
Type: Font
Font for text drawing.
Default value: DefaultFont
FontScaleX
Type: float
Width scale for text drawing. Note that scaling isn't exact, so you should determine text size with StrLen() or TextSize() after setting scale if you need precise values.
Default value: 1.0
FontScaleY
Type: float
Height scale for text drawing. Note that scaling isn't exact, so you should determine text size with StrLen() or TextSize() after setting scale if you need precise values.
Default value: 1.0
ForcedAlpha
Type: float
Forced alpha value if bForceAlpha is set. This replaces the value of DrawColor.A * ColorModulate.W
for texture and text drawing.
MedFont
Type: Font
A default medium-sized font.
MedFontName
Type: string
Modifiers: localized
Name of a default medium-sized font.
Default value: "UT2003Fonts.FontMono800x600"
OrgX
Type: float
Left start of the clipping region and origin for drawing.
OrgY
Type: float
Top start of the clipping region and origin for drawing.
pCanvasUtil
Type: pointer
Modifiers: const
(internal stuff, disregard)
Default value: 0
SizeX
Type: int
Modifiers: const
Width of the entire drawing area.
SizeY
Type: int
Modifiers: const
Height of the entire drawing area.
SmallFont
Type: Font
A default small font.
SmallFontName
Type: string
Modifiers: localized
Name of a default small font.
Default value: "UT2003Fonts.FontMono"
SpaceX
Type: float
Additional horizontal spacing after text characters and drawn textures.
SpaceY
Type: float
Additional vertical spacing below text lines.
Style
Type: byte
Drawing style for text and Textures. 0 means don't draw. Note that other styles do not affect drawing non-Texture materials. You will have to use a FinalBlend in those cases. The values correspond to the Actor.ERenderStyle enum constants.
Default value: 1 (STY_Normal)
TinyFont
Type: Font
A default tiny font.
TinyFontName
Type: string
Modifiers: localized
Name of a default tiny font.
Default value: "UT2003Fonts.FontMono"
Viewport
Type: Viewport
Modifiers: const
Viewport (Player) that owns the canvas. You can access the local PlayerController via Viewport.Actor
.
Z
Type: float
(not used)
Default value: 1.0
Functions
Static native functions
WrapText
Other static functions
MakeColor
Native functions
Clear
DrawActor
DrawActorClipped
DrawPortal
DrawScreenActor
DrawText
DrawTextClipped
DrawTextJustified
DrawTile
DrawTileClipped
DrawTileJustified
DrawTilePartialStretched
DrawTileScaled
DrawTileStretched
GetCameraLocation
SetScreenLight
SetScreenProjector
StrLen
TextSize
WorldToScreen
WrapStringToArray
Events
Reset
Other instance functions
DrawBox
DrawBracket
DrawHorizontal
DrawIcon
DrawLine
DrawPattern
DrawRect
DrawScreenText
DrawVertical
SetClip
SetDrawColor
SetOrigin
SetPos