The Canvas is a wrapper for methods for drawing text, Textures and meshes on the local player's screen. Canvas objects are passed to various events and functions in the various classes, e.g. HUD, Weapon, GUI classes and Interactions.

Spacing for after executing one of the Draw* methods, i.e. this contains the screen size of the last drawn element.

byte Style

The values of this variable correspond to the ERenderStyle enum of the Actor class.

color DrawColor

Color to use for drawing. White (R=255,G=255,B=255) means draw everything in its default colors. If any color component is lower than 255 the specific color component of the Material or Font will be drawn darker. Alpha values specify the opacity of the drawn Material or Font. (A=255 means completely opaque) Also see color blending.

Draws the whole texture once with the specified scaling. Unlike most other draw functions, this one doesn't work with all Material classes. Only materials subclassed from Texture can be used, i.e. you can't use it to draw modifiers (shaders, etc.) or ScriptedTextures.

Takes Text and splits it based on how it would fit in the limitation of dx. Also will make a split when it encounters the characters contained in EOL. You can then use the strings of OutArray to make wrapped text by iterating through the array and placing each line of text one step lower than the last. dx would work best as an equation like Canvas.SizeX * 0.2 (20% of the Canvas width).

It doesn't work when using OpenGL. (Note: The ClearZ argument does nothing, you have to manually clear the Z-buffer or you get strange results. Call the Clear function below with ClearZ true before DrawPortal)

kiff: no longer supported in UT3

vector WorldToScreen( vector WorldLoc )

Converts the given absolute world coordinates to canvas coordinates. The returned vector's X and Y components contain the coordinates. What is the Z component? a dot product of an angle maybe? – Wormbo

Missilemaster: If WorldLoc is behind you, X and Y are the same as when it's ahead of you, but Z changes from being < 1 to being > 1. So, you'll probably want to put "if( Z < 1.0 )" in front of any drawing functions with this or whatever you draw will also appear when WorldLoc is behind you. ( Worked for me, at least. )

Sonic: Also when Z == 1.0 the teambeacon above players heads dissapears but doing if(Z == 1.0) wont work you will need to do if(float(string(Z)) == 1) so that it limits Z to 2 decimal places, i noticed without the float > string > float conversion it doesnt want to work.

TurkeyFromHell: Dude idk when you stuck those in here, but i am eternally grateful you did.. because i can't really do a google search through all my class sources for "native render" and find the DrawActor function now can I? :D <3 Maybe I'll finally be able to draw stuff through walls -.-... we'll see :P

OlympusMons: Added the native functions, Im not sure if they are ut2k4 only or not so someone might want to check that. I hope Im doing good here, not sure if this is where these native functions should be going or not, the formatting might need to be changed also. Help please :P