kalda341 wrote:How did you make the awesome menu?
It is paint!Wombat wrote:looks like paint for me.
The UI is from a game I made earlier and hopefully get time to finish some day.
http://love2d.org/wiki/Astropatrolonium
It is quite the simple "framework" though so making it from scratch shouldnt have taken that long either, maybe some hours, but as I had this already I just reused. It was basically copy&paste except adjusting the drawing functions.
I did not use ie chili/redui/iceui because figuring those out would have taken me longer.
The buttons are just rectangles drawn with gl.Rect and then i check if a mouse click was in the rectangle.
If you look in tp_singleplayermenu.lua
ie I for the "Start Game" button I just do:
Code: Select all
add_button (buttons, 0.4, 0.1, 0.25, 0.1, "Start Game", "button_start",{0,1,1,0.4})
The 0.4, 0.1, 0.25, 0.1 are position+size, the {0,1,1,0.4} is color.
buttons is the name of the list the button goes into.
"button_start" is the value returned if the button gets clicked.
Then to see if the button is clicked, I just do:
Code: Select all
local cb = clicked_button (buttons)
if (cb=="button_start") then
restart_spring (missions[selected_missionid].startscript_fn)
And if there is interesst and I feel really bored I might make a docu/tutorial on it. Though imo for somebody who knows how to use these buttons just doing them from scratch would be trivial.
The restarting of Spring is done via Spring.Restart ()
There is a folder with some startscript.txt files and they just get passed to the Restart command.
I made the startscripts with SpringLobby by setting up battle, start spring and get the file from folder.
With help by Zwszg I adjusted the startscripts to work in Singleplayer, some entries must be changed ie host ip adresses etc.