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 |
//============================================================================= // 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 expands Object intrinsic; // 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 DrawCR. var color DrawColor; // Color for drawing. var bool bCenter; // Whether to center the text. var bool bNoSmooth; // Don't bilinear filter. var const int SizeX, SizeY; // Zero-based actual dimensions. // Stock fonts. var const font SmallFont; // Small system font. var const font MedFont; // Medium system font. var const font BigFont; // Big system font. var const font LargeFont; // Large system font. // Internal. var const viewport Viewport; // Viewport that owns the canvas. var const int FramePtr; // Scene frame pointer. // Intrinsic functions. intrinsic(465) final function DrawText( coerce string[255] Text, optional bool CR ); intrinsic(466) final function DrawTile( texture Tex, float XL, float YL, float U, float V, float UL, float VL ); // 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; } 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 ) { 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 ); } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |