## XIDInterf
Class XIIIInputConfigButton

source: C:\XIII\XIDInterf\Classes\XIIIInputConfigButton.uc

    Core.Object
       |
       +--GUI.GUI
          |
          +--GUI.GUIComponent
             |
             +--GUI.GUILabel
                |
                +--XIDInterf.XIIIGUIBaseButton
                   |
                   +--XIDInterf.XIIIInputConfigButton

Direct Known Subclasses:None

class XIIIInputConfigButton
extends XIDInterf.XIIIGUIBaseButton

Variables
`TextX,` | `TextY`
`bool` | `bDisabled`

Function Summary
`void` | `Paint(Canvas C, float X, float Y)`
    //____________________________________________________________________
    // MLK    Print the text clipped to the dimensions of the button
`void` | `created()`

Source Code

    00001	class XIIIInputConfigButton extends XIIIGUIBaseButton;
    00002
    00003	var  int TextX, TextY;
    00004	var bool bDisabled;
    00005
    00006
    00007	function created()
    00008	{
    00009	    super.created();
    00010	    TextAlign = TXTA_Center;
    00011	}
    00012
    00013	//____________________________________________________________________
    00014	// MLK    Print the text clipped to the dimensions of the button
    00015	function Paint(Canvas C, float X, float Y)
    00016	{
    00017	     local float W, H;
    00018
    00019	//    if (C.Viewport != myRoot.ViewportOwner) return;
    00020		 if ( Text=="" )
    00021		 {
    00022			 C.TextSize( "M", W, H);
    00023			 W=0;
    00024			 TextX = WinWidth*640*fRatioX*0.5;
    00025			 TextY = WinHeight*480*fRatioY*0.5;
    00026		 }
    00027		 else
    00028		 {
    00029	     C.TextSize( Text, W, H);
    00030	    if ((W > WinWidth*640*fRatioX) || bSmallFont)
    00031	    {
    00032	        C.Font = font'XIIIFonts.XIIIConsoleFont';
    00033	        C.TextSize( Text, W, H);
    00034	        bSmallFont = true;
    00035	    }
    00036			 if (TextAlign == TXTA_Center)
    00037				 TextX = (WinWidth*640*fRatioX - W)/2;
    00038	     TextY = (WinHeight*480*fRatioY - H)/2;
    00039	}
    00040	    super.Paint(C,X,Y);
    00041
    00042	    C.Style = 5;
    00043	    if (bDisabled) C.DrawColor.A = 255;
    00044	    else {
    00045	        if (bHasFocus) C.DrawColor.A = 192;
    00046	        else C.DrawColor.A = 128;
    00047	    }
    00048	    C.bUseBorder = true;
    00049	    DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, myRoot.FondMenu);
    00050	    C.bUseBorder = false;
    00051
    00052	    C.DrawColor = TextColor;
    00053	    if(Text!= "")
    00054	    {
    00055	        if (bSmallFont)
    00056	        C.Font = font'XIIIFonts.XIIIConsoleFont';
    00057	        else C.Font = font'XIIIFonts.PoliceF16';
    00058	         C.SetPos(TextX, TextY);
    00059	         C.DrawText( Text, false);
    00060	    }
    00061		if ( bDisabled && (myRoot.GetPlayerOwner().Level.TimeSeconds-int(myRoot.GetPlayerOwner().Level.TimeSeconds)<0.5) )
    00062		{
    00063			DrawStretchedTexture(C, TextX+W, TextY-2+H*0.75, 8, 2, myRoot.FondMenu);
    00064		}
    00065	    C.Style = 1;
    00066	}
    00067
    00068
    00069	defaultproperties
    00070	{
    00071	}

End Source Code