Sample Code Snippets

Button


uiTextValue=’Home’;
uiTextColor=c_navy;
uiYscale=2.0;
uiXscale=2.0;
uiAlign=fa_center;
uiAlignV=fa_middle;
uiDrawBackColor=false;
uiButtonSprite=spr_home;
uiSpriteAlign=fa_center;
uiSpriteAlignV=fa_middle;
uiSpriteScale=0;
uiDownColor=c_yellow;

 

Toggle Buttons


uiAlign=fa_center;
uiAlignV=fa_middle;
uiDrawBackColor=false;
uiSpriteAlign=fa_center;
uiSpriteAlignV=fa_middle;
uiSpriteScale=0;
uiBackColor=c_white; //blend with white when down (use sprite)
uiIsToggle=true;uiHoverMode=0;
uiButtonSprite=spr_volume;
uiSpriteIndex=0;
uiButtonSpriteDown=spr_volume;
uiSpriteIndexDown=1;

Group Buttons


uiBackColor=c_gray;
uiDrawBackColor=false;
uiButtonSprite=spr_volume;
uiSpriteIndex=2;
uiSpriteAlign=fa_center;
uiSpriteAlignV=fa_middle;
uiSpriteScale=0;
uiDownColor=c_white;
uiButtonGroup=1;
uiHoverMode=0;
uiButtonState=1; //default down this button

ListBox


items[0]=’Standard 1′;
items[1]=’Notice the’;
items[2]=’colors’;
uiBorderColor=c_navy;
uiBorderBackColor=c_blue;
uiAlign=fa_left;
uiDrawLines=true;
uiDrawHeader=false;
uiDrawSquare=true;
combo box
uiTextValue=’Combo Box’;
items[0]=’Combo Line 1′;
items[1]=’Combo Line 2′;
items[2]=’Combo Line 3′;
items[3]=’Combo Line 4′;
uiDrawArrowUp=true;
uiAlpha=1;
uiBackColor=c_orange;
uiTextColor=c_white;

CheckBox


uiTextValue=’Sound ON’;
uiAlign=fa_right;
uiDrawBackColor=false;
uiTextColor=c_white;

 

Horizontal Listbox


uiItemWidth=150; //set the width of each element…
for (fg=0;fg<10;fg+=1) { items[fg]=’Wide List ‘+string(fg);
sprites[fg]=choose(spr_home,spr_anib); }
uiTextLabel=’Horz with center snap’;
uiAlign=fa_center;
uiButtonList=true;
uiShowArrows=true;
uiDrawHeader=false;
//uiCustomDrawScript=scr_listbox_drawline;
uiDrawBackColor=false;
uiSnapLeft=true; //will snap the left item to the left of the widget (no left side clipping)….
uiLeftMargin=75;

Gauge


uiAniSpeed=3; //fast
animationuiBarLevel=50; //goes yellow (level2) at 50%
uiBarLevel2=25; //goes red at 25%
uiDrawBackColor=false; //transparent;

TextAnimation


uiTextValue=”Game Over!”;
uiTextColor=c_white;
uiFont=font_art;
//uiPath=path1;
uiPathSpeed=0;
uiAlign=fa_center;
//uiXscale=1;
uiWobble=15;
//uiPulse=0.5;
//uiPulseSpeed=0.1;
uiTextEffect=1;
uiAnimated=true;

Label


uiTextValue=’Right with Back’;
uiAlign=fa_right;
uiBackColor=c_navy;
uiTextColor=c_white;
uiDrawBackColor=true;
TextBox
uiTextValue=’Dogs are fun’;
uiTextLabel=’Edit it if you want’;
uiAlign=fa_center;

CheckGroup


items[0]=’Knife’;
items[1]=’Sword’;
items[2]=’Club’;
items[3]=’Cannon’;
items[4]=’Gun’;
uiTextLabel=’Select Many’;
uiMultiSelect=true;
itemschecked[0]=false;
itemschecked[1]=false;
itemschecked[2]=false;
itemschecked[3]=false;
itemschecked[4]=false;

Gauge


uiDrawSquare=true;
//squareuiAniDraw=false;//no animation
uiBackColor=c_black;
uiBorderColor=c_gray;
uiBarFlash=0; //no flash on dying
uiBarColor=c_teal;
uiBarColor2=c_navy;
uiBarColor3=c_yellow;

Custom Listbox


uiTextLabel=’Custom Scroll List’;
uiAlign=fa_left;
uiButtonList=true;
uiShowArrows=true;
uiDrawHeader=false;
uiCustomDrawScript=scr_listbox_drawline;
SlideruiMin=1;
uiMax=100;
uiInterval=1;
uiUpdateLabel=slide_inst;

Edit Box


uiTextColor=c_white;
uiBackColor=c_navy;
uiFocusColor=c_gray;
uiFocusTextColor=c_yellow;
uiCursorColor=c_red;
uiTabOrder=2;