I've written some (non-functional) code that i'm currently getting a run time error on. The code should display a window, and inside it is the text for my favourite server's rules.
It runs on the event OnGameStart, so it will pop up every time the player first joins a server. Nobody should have an excuse for not knowing the rules, and certainly not reading them with this nifty UI.
Shame it doesn't work. I'll keep working on it, if anyone out there spots any glaring errors, let me know.
require 'ui/uiHelpers'
------------------------------------------------------------------------
-- Creating a window with some text in it
------------------------------------------------------------------------
clickCounter = 0;
-- UI objects
mywindow =
{
x = 500,
y = 500,
width = 300,
height = 300,
hasClose = true;
};
mygenericelement =
{
x=550,
y=550,
width=320,
height=320,
render = function(element)
element:DrawTextCentre("Test Test Test Test Test Test", 150, 100, 1, 0, 0, 1);
end;
}
function DisplayServerRules()
LuaUI.createWindow(mywindow);
element = LuaUI.createElement(mygenericelement);
end
Events.OnGameStart.Add(DisplayServerRules());