Author Topic: GUI Help.  (Read 1866 times)

Is there a retail GUI tutorial anywhere?

How would i do something like this:

Code: [Select]
function guiHello(%arg){
guiHello.settext(//Get this to equal...)
}

function blahHello(%arg){
//something something ... This
}

guiHello = Name of the test thingy in the gui.
%arg = any arguments needed.

Help please.
« Last Edit: June 01, 2007, 11:08:12 AM by MrPickel »

Well, there are a few things to know. First, make a GUI using the Blockland Editor then F10. Save it to something, then open some script with a GUI (A good thing to use is Ephi's Macro Saver), then copy the first bit to get how to assign keys, open GUIs with keys, etc. Then make a function and do something like this to set text in a label/textbox if the object is named Example: Example.setvalue("Whatever");. Notice the lack of a %. For buttons, I think it's Example.settext("Whatever");.

Yeah, i got my gui and everything, i kinda taught myself roughly by looking at Space Guys bot gui. Im using MlText i think thats what its called, Space guy used objectname.settext(%client.mybot.name) but %client.mybot.name i dont see where it sets mybot.name thats what i mean.


As far as I know, the GUI is broken and will not work for anyone but the host.

If you are trying to set the text on a GUI remotely:

Add-Ons/Client/GUIHello_client.cs
Code: [Select]
function clientcmdGUIset(%obj,%text)
{
 %obj.setText(%text);
}

function guiHello::onWake(%this)
{
 commandtoserver('updateHelloGUI');
}

Add-Ons/Hello.cs
Code: [Select]
function servercmdupdatehelloGUI(%client)
{
 commandtoclient(%client,'GUIset',txtHello,"Hello " @ %client.name);
}

... Where guiHello is created by you with one control, "txtHello" as a MLTextCtrl.

Whats the thingy called that has all the names of the people in the server called? EG the thingy in admin menu.

lstAdminPlayerList or something.

Thanks, shall say if it is.

I ment the object bit not its name xD, Worked it out now. Thanks.
« Last Edit: June 05, 2007, 11:11:51 AM by MrPickel »