GUI Control Skining
From TorqueWiki
Contents |
[edit] Skinning
EGPGT p. 476
[edit] Links
[edit] Skin Bitmap
A skin is a bitmap, specified in the profile of a control. Every control interpreds it differently. It is composed of rows and columns folling a set of rules:
GUI Control Skining
GPGT p. 476
[edit] Workshop: Create you own GuiWindowCtrl Skin
GPGT p. 488
The bitmap has to be set in the profile of the window in the file /control/client/profiles.cs:
new GuiWindowCtrl() {
profile = "MyGuiWindowProfile";
.
.
.
Add the new profile in the /control/client/profile.cs:
new GuiControlProfile(MyGuiWindowProfile : GuiWindowProfile)
{
bitmap = "./interfaces/myWindowCtrl";
};
[edit] Workshop: Skin GuiBitmapBorderCtrl
GPPT. p. 492
Replace the GuiControl with a GuiBitmapBorderCtrl:
//new GuiControl(selectGui) {
new GuiBitmapBorderCtrl(selectGui) {
...
Profile = "selectGuiWindowProfile";
...
Add the bitmap to the profile:
new GuiControlProfile( selectGuiWindowProfile : GuiDefaultProfile )
{
// use fillColor for guiControl background
opaque = true;
// draw a border
//border = 1;
// set the border color -> "R G B"
//borderColor = "80 140 140";
// set the background color -> "R G B A"
fillColor = "40 165 20 110";
bitmap = "~/client/ui/bitmapBorderSkin";
};
The bitmap has the folling parts:
| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 |
|---|---|---|---|---|
| Upper-left-border | Upper-right-border | Top Border | - | - |
| Left Border | Right Border | Lower-left-border | Lower Border | Lower-right-border |

