Need little help with UIs... :P

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Need little help with UIs... :P

Postby atrey65789 » Wed Jun 06, 12 7:02 pm

I haven't ever messed with UI's.. could someone help find me a code for like a Template to start with? lol I would appreciate it.
Last edited by atrey65789 on Wed Jun 06, 12 7:02 pm, edited 1 time in total.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby SimonDenton » Sun Jun 10, 12 10:26 am

Coding with GUI ain't easy and I pursue the same thing. I just browse MenuScreen and HUD classes in Wotgreal and notice the elements such as the one below:

Code: Select all
***************************************************
Toggle Checkbox
***************************************************
var MenuUICheckboxWindow         checkboxVariableReference;

// ----------------------------------------------------------------------
// CreateControls()
// ----------------------------------------------------------------------

function CreateControls()
{
   Super.CreateControls();

   CreateConfirmCheckbox();
}

// ----------------------------------------------------------------------
// CreateConfirmCheckbox()
// ----------------------------------------------------------------------

function CreateConfirmCheckbox()
{
   checkboxVariableReference = MenuUICheckboxWindow(winClient.NewChild(Class'MenuUICheckboxWindow')); //This is the actual GUI element

   checkboxVariableReference.SetPos(*x position*, *y position*); //Positioning
   checkboxVariableReference.SetText(*Text to display regarding this checkbox*);
   checkboxVariableReference.SetFont(Font'*Name of font*');
   checkboxVariableReference.SetToggle(*bool we are toggling*);
}

// ----------------------------------------------------------------------
// ToggleChanged()
// ----------------------------------------------------------------------

event bool ToggleChanged(Window button, bool bNewToggle)
{   
   if (button == checkboxVariableReference)
   {
      *bool we are toggling* = bNewToggle;
      return True;
   }
   else
   {
      return False;
   }
}
Last edited by SimonDenton on Sun Jun 10, 12 10:26 am, edited 1 time in total.
SimonDenton
Wannabe
 
Posts: 117
Joined: Sun Oct 03, 10 12:06 pm

Postby Dae » Sun Jun 10, 12 12:08 pm

+ There's a lot you could pick up from Project 2027.
User avatar
Dae
Alpha
 
Posts: 12086
Joined: Sat Sep 06, 03 4:40 pm

Postby atrey65789 » Sun Jun 10, 12 12:56 pm

Thank you both... Simon, I'll be sure to keep that in mind.

Dae, That's a good idea, I'll do that.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 24 guests
cron