Now for some information on the GUI Downloading in RTB3. The downloader currently supports the following controls:
- GuiBitmapButtonCtrl
- GuiButtonCtrl
- GuiBitmapCtrl
- GuiTextEditCtrl
- GuiTextCtrl
- GuiMLTextCtrl
- GuiSwatchCtrl
- GuiWindowCtrl
- GuiScrollCtrl
And the buttons are allowed to use the following commands:
- commandtoserver
- canvas.pushDialog
- canvas.popDialog
Parameters of the commandtoserver function call may consist of the following:
- A quoted value, e.g. "hello"
- An unquoted value, e.g. 400
- A value obtained from an element within the gui, e.g. MyTextBox.getValue()
Finally, here is an example GUI file that will download perfectly and exhibits all/most of the features.
//--- OBJECT WRITE BEGIN ---
new GuiControl(RTB_Example) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
script = "5992";
new GuiWindowCtrl() {
profile = "BlockWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "132 105";
extent = "375 270";
minExtent = "8 8";
visible = "1";
text = "RTB GUI Transfer Example";
maxLength = "255";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "Canvas.popDialog(RTB_Example);";
helpTag = "0";
new GuiBitmapButtonCtrl() {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "254 231";
extent = "107 26";
minExtent = "8 2";
visible = "1";
command = "canvas.popDialog(RTB_Example);";
text = "Close Window";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "0 0 255 255";
helpTag = "0";
};
new GuiTextEditCtrl(RTB_MessageBox) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "130 197";
extent = "113 18";
minExtent = "8 2";
visible = "1";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
};
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "17 197";
extent = "108 18";
minExtent = "8 2";
visible = "1";
text = "Send a chat message:";
maxLength = "255";
};
new GuiBitmapButtonCtrl() {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "14 231";
extent = "107 26";
minExtent = "8 2";
visible = "1";
command = "commandtoserver(\'light\');";
text = "Toggle Light";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 0 255";
helpTag = "0";
};
new GuiBitmapButtonCtrl() {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "134 231";
extent = "107 26";
minExtent = "8 2";
visible = "1";
command = "commandtoserver(\'wtf\');canvas.popDialog(RTB_Example);";
text = "WTF Emote";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 0 0 255";
helpTag = "0";
};
new GuiBitmapButtonCtrl() {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "254 193";
extent = "107 25";
minExtent = "8 2";
visible = "1";
command = "commandtoserver(\'messageSent\',RTB_MessageBox.getValue());canvas.popDialog(RTB_Example);";
text = "Send";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 255 255";
helpTag = "0";
};
new GuiScrollCtrl() {
profile = "GuiScrollProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "13 35";
extent = "346 152";
minExtent = "8 2";
visible = "1";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "alwaysOn";
constantThumbHeight = "0";
childMargin = "2 0";
rowHeight = "40";
columnWidth = "30";
new GuiMLTextCtrl() {
profile = "GuiMLTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "3 1";
extent = "344 154";
minExtent = "8 2";
visible = "1";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "This stretched the living crap out of my crap browser.";
maxBitmapHeight = "-1";
selectable = "1";
};
};
};
};
//--- OBJECT WRITE END ---
Notice how it can be saved straight out of the GUI Editor and RTB will do the rest of the work. In order to get it to download to a client, all you need to do is call this function:
RTB_registerGUI("Add-Ons/System_ReturnToBlockland/RTB_Example.gui");
Also notice how RTB breaks up large text fields into multiple commands to the client to avoid being limited by the character limits in commandtoclient commands. There will be more formal documentation on this system when RTB3 is released.