Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowDialogControl | +--UWindow.UWindowLabelControl
DropAmountX,
DropAmountY
bool
bDropShadow
void
BeforePaint(Canvas C, float X, float Y)
Created()
Paint(Canvas C, float X, float Y)
00001 class UWindowLabelControl extends UWindowDialogControl; 00002 00003 var bool bDropShadow; 00004 var int DropAmountX, DropAmountY; 00005 00006 00007 function Created() 00008 { 00009 TextX = 0; 00010 TextY = 0; 00011 } 00012 00013 function BeforePaint(Canvas C, float X, float Y) 00014 { 00015 local float W, H; 00016 00017 // Implemented in a child class 00018 00019 Super.BeforePaint(C, X, Y); 00020 00021 TextSize(C, Text, W, H); 00022 WinHeight = H+1; 00023 //WinWidth = W+1; 00024 TextY = (WinHeight - H) / 2; 00025 switch (Align) 00026 { 00027 case TA_Left: 00028 break; 00029 case TA_Center: 00030 TextX = (WinWidth - W)/2; 00031 break; 00032 case TA_Right: 00033 TextX = WinWidth - W; 00034 break; 00035 } 00036 } 00037 00038 function Paint(Canvas C, float X, float Y) 00039 { 00040 if(Text != "") 00041 { 00042 C.Font = Root.Fonts[Font]; 00043 00044 if (bDropShadow) 00045 { 00046 C.DrawColor.R = 0; 00047 C.DrawColor.G = 0; 00048 C.DrawColor.B = 0; 00049 ClipText(C, TextX+DropAmountX, TextY+DropAmountY, Text, true); 00050 } 00051 00052 C.DrawColor = TextColor; 00053 ClipText(C, TextX, TextY, Text); 00054 C.DrawColor.R = 255; 00055 C.DrawColor.G = 255; 00056 C.DrawColor.B = 255; 00057 } 00058 } 00059 00060 defaultproperties 00061 { 00062 DropAmountX=1 00063 DropAmountY=1 00064 }