GUI Control Skining

From TorqueWiki

Jump to: navigation, search

Contents

[edit] Skinning

EGPGT p. 476

[edit] Links

Video Tutorial

GUI Gimp Workflow

[1]


http://books.google.com/books?id=W_ChoAN4AboC&pg=PA482&lpg=PA482&dq=tge+skin+torque+game+engine+gui&source=web&ots=WYoaIKy7vF&sig=epTI5BYeQZBwAl9hH4TIMagDhGo#PPA482,M1

[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

The Image should follow the rules for skin bitmaps: image:bitmapBorderSkin.png.

Personal tools
Games
Game Development
Modeling for Torque
Torque Game Builder (2D)
Console