Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 |
//============================================================================= // Canvas: A drawing canvas. // This is a built-in Unreal class and it shouldn't be modified. // // Notes. // To determine size of a drawable object, set Style to STY_None, // remember CurX, draw the thing, then inspect CurX and CurYL. //============================================================================= class Canvas extends Object native noexport; // Objects. #exec Font Import File=Textures\SmallFont.bmp Name=SmallFont #exec Font Import File=Textures\MedFont.pcx Name=MedFont #exec Font Import File=Textures\LargeFont.pcx Name=LargeFont #exec Font Import File=Textures\BigFont.pcx Name=BigFont // Modifiable properties. var font Font; // Font for DrawText. var float SpaceX, SpaceY; // Spacing for after Draw*. var float OrgX, OrgY; // Origin for drawing. var float ClipX, ClipY; // Bottom right clipping region. var float CurX, CurY; // Current position for drawing. var float Z; // Z location. 1=no screenflash, 2=yes screenflash. var byte Style; // Drawing style STY_None means don't draw. var float CurYL; // Largest Y size since DrawText. var color DrawColor; // Color for drawing. var bool bCenter; // Whether to center the text. var bool bNoSmooth; // Don't bilinear filter. var const bool bUseOffset,bUseFlatZ; // Used by 3D tile offset. var const int SizeX, SizeY; // Zero-based actual dimensions. // Stock fonts. var font SmallFont; // Small system font. var font MedFont; // Medium system font. var font BigFont; // Big system font. var font LargeFont; // Large system font. // Internal. var const viewport Viewport; // Viewport that owns the canvas. var const int FramePtr; // Scene frame pointer. var const int RenderPtr; // Render device pointer, only valid during UGameEngine::Draw var coords RenderCoords; // Used by 3D tile offset. // native functions. native(464) final function StrLen( coerce string String, out float XL, out float YL ); native(465) final function DrawText( coerce string Text, optional bool CR ); native(466) final function DrawTile( texture Tex, float XL, float YL, float U, float V, float UL, float VL ); native(467) final function DrawActor( Actor A, bool WireFrame, optional bool ClearZ ); native(468) final function DrawTileClipped( texture Tex, float XL, float YL, float U, float V, float UL, float VL ); native(469) final function DrawTextClipped( coerce string Text, optional bool bCheckHotKey ); native(470) final function TextSize( coerce string String, out float XL, out float YL ); native(471) final function DrawClippedActor( Actor A, bool WireFrame, int X, int Y, int XB, int YB, optional bool ClearZ ); native(477) final function DrawTileStretched( Texture Tex, int X1, int Y1, int X2, int Y2 ); native(480) final function DrawPortal( int X, int Y, int Width, int Height, actor CamActor, vector CamLocation, rotator CamRotation, optional int FOV, optional bool ClearZ ); // New U227 functions: /* Very fast: Draw a clipped 2D line on the frame (vectors are given in screen space) */ native(1750) final function Draw2DLine( Color Col, vector Start, vector End ); /* Very fast: Draw a 3D line (vectors are given in world space), rendering drivers notice: -OpenGL/D3D8/D3D9 seems to render the line in world (meaning it can go behind objects and so). */ native(1751) final function Draw3DLine( Color Col, vector Start, vector End ); /* Very fast: Convert a given world space location into screen location, note that coords should stand for camera rotation, example: Pos = Canvas.WorldToScreen(ThePosition); - The result: X = X screen location, Y = Y screen location, Z = 1, world location is in front of camera / -1, world location is behind the camera. */ native(1752) final function vector WorldToScreen( vector WorldPos, out float ZDistance ); /* Very fast: Convert a given screen location into world space location, note that the result must be transformed with camera rotation then added with camera location: Res = (Canvas.ScreenToWorld(ScreenPos) >> ViewRotation) + Location; */ native(1753) final function vector ScreenToWorld( vector ScreenPos ); /* Relative slow (debugging use only): Draw the path network on HUD */ native(1754) final function DrawPathNetwork( bool bOnlyWalkable, optional float MaxDistance /*def 2000*/ ); /* enum ELineFlags { LINE_None, = 0 LINE_Transparent, = 1 LINE_DepthCued = 2 };*/ // Render a circle // Position is defined in world position. native(1755) final function DrawCircle( Color Col, int LineFlags, vector Position, float Radius ); // Render a 3D box in world position. native(1756) final function DrawBox( Color Col, int LineFlags, vector Start, vector End ); /* Very fast: Get current camera location + rotation: CamLocation = Origin CamRotation = OrthoRotation(XAxis,YAxis,ZAxis) */ native(1757) final function coords GetCameraCoords(); // Set Tile drawing 3D offset. // It is recommended you clear Z before using this (using Canvas.DrawActor(None,false,true);) native(1758) final function SetTile3DOffset( bool bEnable, optional vector Offset, optional rotator RotOffset, optional bool bFlatZ, optional float Scale ); // UnrealScript functions. event Reset() { Font = Default.Font; SpaceX = Default.SpaceX; SpaceY = Default.SpaceY; OrgX = Default.OrgX; OrgY = Default.OrgY; CurX = Default.CurX; CurY = Default.CurY; Style = Default.Style; DrawColor = Default.DrawColor; CurYL = Default.CurYL; bCenter = false; bNoSmooth = false; Z = 1.0; SetTile3DOffset(false); } final function SetPos( float X, float Y ) { CurX = X; CurY = Y; } final function SetOrigin( float X, float Y ) { OrgX = X; OrgY = Y; } final function SetClip( float X, float Y ) { ClipX = X; ClipY = Y; } final function DrawPattern( texture Tex, float XL, float YL, float Scale ) { DrawTile( Tex, XL, YL, (CurX-OrgX)*Scale, (CurY-OrgY)*Scale, XL*Scale, YL*Scale ); } final function DrawIcon( texture Tex, float Scale ) { if ( Tex != None ) DrawTile( Tex, Tex.USize*Scale, Tex.VSize*Scale, 0, 0, Tex.USize, Tex.VSize ); } final function DrawRect( texture Tex, float RectX, float RectY ) { DrawTile( Tex, RectX, RectY, 0, 0, Tex.USize, Tex.VSize ); } defaultproperties { Z=1.000000 Style=1 DrawColor=(R=127,G=127,B=127) SmallFont=Font'Engine.SmallFont' MedFont=Font'Engine.MedFont' BigFont=Font'Engine.BigFont' LargeFont=Font'Engine.LargeFont' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |