Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XInterface.DrawOpBase


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
class DrawOpBase extends Object;

var float           Top, Lft, Height, Width;    // Location/size is always range 0.0 to 1.0
var byte            RenderStyle;                // Render Style to use for this particular Image
var byte            Justification;              // 0 - Left/Top   1 - Centered  2 - Right/Bottom
var Color           DrawColor;                  // Color to set Canvas to.

function SetPos(float T, float L)
{
    Top = T;
    Lft = L;
}

function SetSize(float H, float W)
{
    Height = H;
    Width = W;
}

function Draw(Canvas Canvas)
{
    Canvas.SetPos(Lft * Canvas.SizeX, Top * Canvas.SizeY);
    Canvas.Style = RenderStyle;
    Canvas.DrawColor = DrawColor;
}

simulated function Font GetFont(string FontClassName, float ResX)
{
    local Font fnt;

    fnt = GetGUIFont(FontClassName, ResX);
    if ( fnt == None )
        fnt = Font(DynamicLoadObject(FontClassName, class'Font'));

    if ( fnt == None )
        log(Name$" - FONT NOT FOUND '"$FontClassName$"'",'Error');

    return fnt;
}

simulated function Font GetGUIFont( string FontClassName, float ResX )
{
local class<GUIFont>    FntCls;
local GUIFont Fnt;

    FntCls = class<GUIFont>(DynamicLoadObject(FontClassName, class'Class',True));
    if (FntCls != None)
        Fnt = new(None) FntCls;

    if ( Fnt == None )
        return None;

    return Fnt.GetFont(ResX);
}

defaultproperties
{
     RenderStyle=1
     DrawColor=(B=255,G=255,R=255,A=255)
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:30:36.000 - Creation time: Wed 7/2/2007 19:16:37.406 - Created with UnCodeX