Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel
Difference between revisions of "UE2:Canvas (UT2004)"
(Auto-generated page) |
(added variable descriptions) |
||
Line 3: | Line 3: | ||
| parent1 = Object | | parent1 = Object | ||
}} | }} | ||
− | {{ | + | {{expand}} |
− | + | 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 {{tl|PostRender|Hud}}() or {{tl|Process_PostRender|InteractionMaster}}, 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 {{cl|HudBase}} class splits up the main rendering into several stages with fixed render styles. | |
− | + | ||
− | + | ||
==Properties== | ==Properties== | ||
Line 15: | Line 12: | ||
'''Type:''' [[bool]] | '''Type:''' [[bool]] | ||
− | Whether to center the text. | + | Whether to center the text drawn with {{tl|DrawText}}(). |
====bForceAlpha==== | ====bForceAlpha==== | ||
'''Type:''' [[bool]] | '''Type:''' [[bool]] | ||
− | Force all drawing to | + | Force all text and texture drawing to use {{tl|ForcedAlpha}} as draw color alpha value. |
====bNoSmooth==== | ====bNoSmooth==== | ||
'''Type:''' [[bool]] | '''Type:''' [[bool]] | ||
− | + | ''(not used)'' | |
====bRenderLevel==== | ====bRenderLevel==== | ||
'''Type:''' [[bool]] | '''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 {{cl|Interaction}}s and {{cl|GUIComponent}}s. 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 | '''Default value:''' True | ||
Line 37: | Line 34: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Width of clipping region. | |
====ClipY==== | ====ClipY==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Height of clipping region. | |
====ColorModulate==== | ====ColorModulate==== | ||
'''Type:''' {{tl|Plane|Object|structs}} | '''Type:''' {{tl|Plane|Object|structs}} | ||
− | + | {{tl|DrawColor}} is multiplied by this before drawing textures, text or screen actors. | |
'''Default value:''' | '''Default value:''' | ||
Line 70: | Line 67: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Current X position for drawing. | |
====CurY==== | ====CurY==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | Current position for drawing. | + | Current Y position for drawing. |
====CurYL==== | ====CurYL==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | Largest | + | Largest width of recently drawn text, unless {{tl|DrawText}}() is called with the CR parameter being ''True''. |
====DrawColor==== | ====DrawColor==== | ||
Line 108: | Line 105: | ||
'''Type:''' {{cl|Font}} | '''Type:''' {{cl|Font}} | ||
− | Font for | + | Font for text drawing. |
'''Default value:''' DefaultFont | '''Default value:''' DefaultFont | ||
Line 115: | Line 112: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Width scale for text drawing. Note that scaling isn't exact, so you should determine text size with {{tl|StrLen}}() or {{tl|TextSize}}() after setting scale if you need precise values. | |
'''Default value:''' 1.0 | '''Default value:''' 1.0 | ||
Line 122: | Line 119: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Height scale for text drawing. Note that scaling isn't exact, so you should determine text size with {{tl|StrLen}}() or {{tl|TextSize}}() after setting scale if you need precise values. | |
'''Default value:''' 1.0 | '''Default value:''' 1.0 | ||
Line 129: | Line 126: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Forced alpha value if {{tl|bForceAlpha}} is set. This replaces the value of <code>DrawColor.A * ColorModulate.W</code> for texture and text drawing. | |
====MedFont==== | ====MedFont==== | ||
'''Type:''' {{cl|Font}} | '''Type:''' {{cl|Font}} | ||
− | + | A default medium-sized font. | |
====MedFontName==== | ====MedFontName==== | ||
Line 141: | Line 138: | ||
'''[[Variables#Modifiers|Modifiers]]:''' localized | '''[[Variables#Modifiers|Modifiers]]:''' localized | ||
− | + | Name of a default medium-sized font. | |
'''Default value:''' "UT2003Fonts.FontMono800x600" | '''Default value:''' "UT2003Fonts.FontMono800x600" | ||
Line 148: | Line 145: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Left start of the clipping region and origin for drawing. | |
====OrgY==== | ====OrgY==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Top start of the clipping region and origin for drawing. | |
====pCanvasUtil==== | ====pCanvasUtil==== | ||
Line 160: | Line 157: | ||
'''[[Variables#Modifiers|Modifiers]]:''' const | '''[[Variables#Modifiers|Modifiers]]:''' const | ||
− | + | ''(internal stuff, disregard)'' | |
'''Default value:''' 0 | '''Default value:''' 0 | ||
Line 169: | Line 166: | ||
'''[[Variables#Modifiers|Modifiers]]:''' const | '''[[Variables#Modifiers|Modifiers]]:''' const | ||
− | + | Width of the entire drawing area. | |
====SizeY==== | ====SizeY==== | ||
Line 176: | Line 173: | ||
'''[[Variables#Modifiers|Modifiers]]:''' const | '''[[Variables#Modifiers|Modifiers]]:''' const | ||
− | + | Height of the entire drawing area. | |
====SmallFont==== | ====SmallFont==== | ||
'''Type:''' {{cl|Font}} | '''Type:''' {{cl|Font}} | ||
− | + | A default small font. | |
====SmallFontName==== | ====SmallFontName==== | ||
Line 188: | Line 185: | ||
'''[[Variables#Modifiers|Modifiers]]:''' localized | '''[[Variables#Modifiers|Modifiers]]:''' localized | ||
− | + | Name of a default small font. | |
'''Default value:''' "UT2003Fonts.FontMono" | '''Default value:''' "UT2003Fonts.FontMono" | ||
Line 195: | Line 192: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Additional horizontal spacing after text characters and drawn textures. | |
====SpaceY==== | ====SpaceY==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | Additional vertical spacing below text lines. | |
====Style==== | ====Style==== | ||
'''Type:''' [[byte]] | '''Type:''' [[byte]] | ||
− | Drawing style | + | Drawing style for text and {{cl|Texture}}s. ''0'' means don't draw. Note that other styles do not affect drawing non-{{cl|Texture}} materials. You will have to use a {{cl|FinalBlend}} in those cases. The values correspond to the {{tl|ERenderStyle|Actor|enums}} enum constants. |
− | '''Default value:''' 1 | + | '''Default value:''' 1 ''(STY_Normal)'' |
====TinyFont==== | ====TinyFont==== | ||
'''Type:''' {{cl|Font}} | '''Type:''' {{cl|Font}} | ||
− | + | A default tiny font. | |
====TinyFontName==== | ====TinyFontName==== | ||
Line 219: | Line 216: | ||
'''[[Variables#Modifiers|Modifiers]]:''' localized | '''[[Variables#Modifiers|Modifiers]]:''' localized | ||
− | + | Name of a default tiny font. | |
'''Default value:''' "UT2003Fonts.FontMono" | '''Default value:''' "UT2003Fonts.FontMono" | ||
Line 228: | Line 225: | ||
'''[[Variables#Modifiers|Modifiers]]:''' const | '''[[Variables#Modifiers|Modifiers]]:''' const | ||
− | Viewport that owns the canvas. | + | Viewport ({{cl|Player}}) that owns the canvas. You can access the local {{cl|PlayerController}} via <code>Viewport.Actor</code>. |
====Z==== | ====Z==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
− | + | ''(not used)'' | |
'''Default value:''' 1.0 | '''Default value:''' 1.0 |
Latest revision as of 12:48, 20 March 2011
Object >> Canvas |
Contents
- 1 Properties
- 1.1 bCenter
- 1.2 bForceAlpha
- 1.3 bNoSmooth
- 1.4 bRenderLevel
- 1.5 ClipX
- 1.6 ClipY
- 1.7 ColorModulate
- 1.8 CurX
- 1.9 CurY
- 1.10 CurYL
- 1.11 DrawColor
- 1.12 Font
- 1.13 FontScaleX
- 1.14 FontScaleY
- 1.15 ForcedAlpha
- 1.16 MedFont
- 1.17 MedFontName
- 1.18 OrgX
- 1.19 OrgY
- 1.20 pCanvasUtil
- 1.21 SizeX
- 1.22 SizeY
- 1.23 SmallFont
- 1.24 SmallFontName
- 1.25 SpaceX
- 1.26 SpaceY
- 1.27 Style
- 1.28 TinyFont
- 1.29 TinyFontName
- 1.30 Viewport
- 1.31 Z
- 2 Functions
- 2.1 Static native functions
- 2.2 Other static functions
- 2.3 Native functions
- 2.3.1 Clear
- 2.3.2 DrawActor
- 2.3.3 DrawActorClipped
- 2.3.4 DrawPortal
- 2.3.5 DrawScreenActor
- 2.3.6 DrawText
- 2.3.7 DrawTextClipped
- 2.3.8 DrawTextJustified
- 2.3.9 DrawTile
- 2.3.10 DrawTileClipped
- 2.3.11 DrawTileJustified
- 2.3.12 DrawTilePartialStretched
- 2.3.13 DrawTileScaled
- 2.3.14 DrawTileStretched
- 2.3.15 GetCameraLocation
- 2.3.16 SetScreenLight
- 2.3.17 SetScreenProjector
- 2.3.18 StrLen
- 2.3.19 TextSize
- 2.3.20 WorldToScreen
- 2.3.21 WrapStringToArray
- 2.4 Events
- 2.5 Other instance functions
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[edit]
bCenter[edit]
Type: bool
Whether to center the text drawn with DrawText().
bForceAlpha[edit]
Type: bool
Force all text and texture drawing to use ForcedAlpha as draw color alpha value.
bNoSmooth[edit]
Type: bool
(not used)
bRenderLevel[edit]
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[edit]
Type: float
Width of clipping region.
ClipY[edit]
Type: float
Height of clipping region.
ColorModulate[edit]
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[edit]
Type: float
Current X position for drawing.
CurY[edit]
Type: float
Current Y position for drawing.
CurYL[edit]
Type: float
Largest width of recently drawn text, unless DrawText() is called with the CR parameter being True.
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 text drawing.
Default value: DefaultFont
FontScaleX[edit]
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[edit]
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[edit]
Type: float
Forced alpha value if bForceAlpha is set. This replaces the value of DrawColor.A * ColorModulate.W
for texture and text drawing.
MedFont[edit]
Type: Font
A default medium-sized font.
MedFontName[edit]
Type: string
Modifiers: localized
Name of a default medium-sized font.
Default value: "UT2003Fonts.FontMono800x600"
OrgX[edit]
Type: float
Left start of the clipping region and origin for drawing.
OrgY[edit]
Type: float
Top start of the clipping region and origin for drawing.
pCanvasUtil[edit]
Type: pointer
Modifiers: const
(internal stuff, disregard)
Default value: 0
SizeX[edit]
Type: int
Modifiers: const
Width of the entire drawing area.
SizeY[edit]
Type: int
Modifiers: const
Height of the entire drawing area.
SmallFont[edit]
Type: Font
A default small font.
SmallFontName[edit]
Type: string
Modifiers: localized
Name of a default small font.
Default value: "UT2003Fonts.FontMono"
SpaceX[edit]
Type: float
Additional horizontal spacing after text characters and drawn textures.
SpaceY[edit]
Type: float
Additional vertical spacing below text lines.
Style[edit]
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[edit]
Type: Font
A default tiny font.
TinyFontName[edit]
Type: string
Modifiers: localized
Name of a default tiny font.
Default value: "UT2003Fonts.FontMono"
Viewport[edit]
Type: Viewport
Modifiers: const
Viewport (Player) that owns the canvas. You can access the local PlayerController via Viewport.Actor
.
Z[edit]
Type: float
(not used)
Default value: 1.0