Note that this is only a demonstration of the simple main menu. It's quite easy to understand as well from the end-programmer side:
// Main.cpp#include "lucid/base.h"// The label at the bottomclass CLabelTest : public System::GUI::Label { void Initialize(){ Text("This is a label."); SetPosition(0, 0, System::Width, System::Height); VerticalAlignment(2); // Bottom HorizontalAlignment(1); // Middle }}LabelTest;// The main menuclass CMenuTest : public System::GUI::Menu { void Initialize(){ // Add some items to it AddItem("New Game"); AddItem("Load Game"); AddItem("Highscores"); AddItem("Exit"); // Change look Items.BackColour(0,150,0,255); Items.HoverColour(0,200,0,255); // Location Width(150); Height(50); x(System::Width/2 - Width()/2); y(20); } // When an item was selected void Select(std::string item){ LabelTest.Text(item); // Change the label text }}MenuTest;// The main game stateclass CGameState : public System::State { void Initialize(){ // Load a font System::Text::LoadFont("goth","data/bgothl.ttf",16); // Add the GUI objects AddGUIObject(&LabelTest); AddGUIObject(&MenuTest); }}GameState;int main(int argc, char *argv[]){ // Initialize System::Initialize(400,300,false,&GameState,60,"You Gotta Move It","icon.png"); // Enter the main game loop System::MainLoop(); return 0;}
If you don't understand the source, please tell me. I'm trying to make this engine as easy as possible for 2D game creation. It looks pretty good so far.
Once I complete all the required file stuff (highscores, etc), I'll move onto working on the Asteroids clone again. With these new "features" to Lucid, it'll make it so much easier.
In other news, I'm missing the GDC.