//! The Scenenery is built here. public MainMenu() { Background = new Tornado(); //! Creates the Start- and Exit-Button. MainMenuStart = new SimpleDrawableObject("StartA") { Size = new Size(100f, 50f) }; MainMenuStart.Position = new Coordinate((Program.Size.width / 2) - (MainMenuStart.Size.width / 2), (Program.Size.height / 2) - (MainMenuStart.Size.height)); MainMenuExit = new SimpleDrawableObject("ExitA") { Size = new Size(100f, 50f) }; MainMenuExit.Position = new Coordinate((Program.Size.width / 2) - (MainMenuExit.Size.width / 2), (Program.Size.height / 2) + (MainMenuExit.Size.height)); //! Creates a Cursor. Cursor = new Cursor(); }
protected override void OnLoad() { Layer = LayerUI + 2; userData = MMW.GetAsset <UserData>(); var label = new Label( null, "MENU", new Font("Yu Gothic UI", 32.0f), new Vector2((MMW.Width - Drawer.MeasureString("MENU", new Font("Yu Gothic UI", 32.0f)).X) / 2.0f, 100.0f)); controls.Add(label); var btnShop = new Button(null, "Shop", new Vector2(200, 200), "click"); btnShop.Clicked += (s, e) => { type = "shop"; MMW.BroadcastMessage("show coin resolver"); }; controls.Add(btnShop); var btnSkill = new Button(btnShop, "Skill", new Vector2(0, 50), "click"); btnSkill.Clicked += (s, e) => { type = "skill"; MMW.BroadcastMessage("close coin resolver"); }; controls.Add(btnSkill); var btnPlayers = new Button(btnSkill, "Players", new Vector2(0, 50), "click"); btnPlayers.Clicked += (s, e) => { type = "players"; MMW.BroadcastMessage("close coin resolver"); }; controls.Add(btnPlayers); var btnGraphics = new Button(btnPlayers, "Graphics", new Vector2(0, 50), "click"); btnGraphics.Clicked += (s, e) => { type = "graphics"; MMW.BroadcastMessage("close coin resolver"); }; controls.Add(btnGraphics); var btnExit = new Button(btnGraphics, "Leave", new Vector2(0, 50), "click"); btnExit.Clicked += (s, e) => { type = "leave"; MMW.BroadcastMessage("close coin resolver"); }; controls.Add(btnExit); drawObj = new SimpleDrawableObject(); }