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

XInterface.DrawOpImage


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
class DrawOpImage extends DrawOpBase
    DependsOn(GUI);

var Material           Image;
var byte               ImageStyle;
var float              SubX, SubY, SubXL, SubYL; // coordinates on Image
var deprecated bool    bStretch;                    // Stretch the picture;

function Draw(Canvas Canvas)
{
    local float X, Y, XL, YL, U, V, UL, VL;

    if ( Image == None )
        return;

    Canvas.Style = RenderStyle;
    Canvas.DrawColor = DrawColor;

    X = Lft * Canvas.SizeX;
    Y = Top * Canvas.SizeY;

    if ( Width < 0 )
        XL = Image.MaterialUSize();
    else XL = Width * Canvas.SizeX;

    if ( Height < 0 )
        YL = Image.MaterialVSize();
    else YL = Height * Canvas.SizeY;
    U = FMax(0, SubX);
    V = FMax(0, SubY);
    if ( SubXL < 0 )
        UL = Image.MaterialUSize();
    else
        UL = SubXL;

    if ( SubYL < 0 )
        VL = Image.MaterialVSize();
    else
        VL = SubYL;

    if ( Justification == 1 )
    {
        X -= XL / 2;
        Y -= YL / 2;
    }
    else if ( Justification == 2 )
    {
        X -= XL;
        Y -= YL;
    }

    Canvas.SetPos(X,Y);

    switch ( ImageStyle )
    {
    case 0: // Normal (scaled to fit)
        Canvas.DrawTile( Image, XL, YL, U, V, UL, VL );
        break;

    case 1: // Stretched
        Canvas.DrawTileStretched(Image,XL,YL);
        break;

    case 2: // Bound
        Canvas.DrawTileClipped( Image, XL, YL, U, V, UL, VL );
        break;
    }

    //Log("DrawOpImage.Draw Called");
}

defaultproperties
{
     SubX=-1.000000
     SubY=-1.000000
     SubXL=-1.000000
     SubYL=-1.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:48.000 - Creation time: Mo 16.4.2007 11:20:46.453 - Created with UnCodeX