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

UTGame.UTScoreboardClockPanel


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
/**
 * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
 */

class UTScoreboardClockPanel extends UTDrawPanel;

var() Texture2D Background;
var() TextureCoordinates BackCoords;
var() LinearColor BackColor;

var() font ClockFont;
var() vector2d ClockPos;

/** Cached reference to the HUDSceneOwner */
var UTUIScene_Hud UTHudSceneOwner;

event PostInitialize()
{
    Super.PostInitialize();
    UTHudSceneOwner = UTUIScene_Hud( GetScene() );
}


event DrawPanel()
{
    local WorldInfo WI;
    local UTGameReplicationInfo GRI;
    local string Clock;
    local float TextWidth, TextHeight;
    local float PadWidth, PadHeight;

    WI = UTHudSceneOwner.GetWorldInfo();
    GRI = UTGameReplicationInfo(WI.GRI);
    if (GRI != None && !GRI.bMatchISOver)
    {
        if ( ClockFont != none )
        {
            Clock = class'UTHUD'.static.FormatTime( GRI.TimeLimit != 0 ? GRI.RemainingTime : GRI.ElapsedTime );
            Canvas.Font = ClockFont;
            Canvas.StrLen(Clock, TextWidth, TextHeight);
            Canvas.StrLen("00", PadWidth, PadHeight);

            // Draw the background
            if ( Background != none )
            {
                Canvas.ClipY = TextHeight + TextHeight*0.25f;
                Canvas.SetPos( Canvas.ClipX - (TextWidth + PadWidth), 0);
                Canvas.DrawColorizedTile(Background, TextWidth + PadWidth, Canvas.ClipY, BackCoords.U,BackCoords.V,BackCoords.UL,BackCoords.VL, BackColor);
            }

            Canvas.SetDrawColor(255,255,255,255);
            Canvas.SetPos( Canvas.ClipX - (TextWidth + PadWidth*0.5f), TextHeight*0.1 );
            Canvas.DrawText(Clock);
        }
    }
}

defaultproperties
{
   BackColor=(R=0.000000,G=0.000000,B=0.000000,A=1.000000)
   Begin Object Class=UIComp_Event Name=WidgetEventComponent ObjName=WidgetEventComponent Archetype=UIComp_Event'UTGame.Default__UTDrawPanel:WidgetEventComponent'
      ObjectArchetype=UIComp_Event'UTGame.Default__UTDrawPanel:WidgetEventComponent'
   End Object
   EventProvider=WidgetEventComponent
   Name="Default__UTScoreboardClockPanel"
   ObjectArchetype=UTDrawPanel'UTGame.Default__UTDrawPanel'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Thu 22/11/2007 16:06:04.000 - Creation time: Mon 26/11/2007 17:42:05.812 - Created with UnCodeX