/// <summary> /// Constructs a new main menu scene for the given window. /// </summary> /// <param name="window">The window to construct the main menu scene for.</param> public MainMenuScene(Window window) : base(window) { Button songSelectButton = new Button("Song Select"); songSelectButton.OriginX = songSelectButton.Width / -2f; songSelectButton.Align( new RelativeAlignment(songSelectButton, window, true) { OffsetY = 10, PercentX = 0.5f } ); songSelectButton.Clicked += SongSelectButton_Clicked; addChild(songSelectButton); Button exitButton = new Button("Exit"); exitButton.OriginX = exitButton.Width / -2f; exitButton.Align( new RelativeAlignment(exitButton, songSelectButton, false) { OffsetY = songSelectButton.Height + 10 } ); exitButton.Clicked += ExitButton_Clicked; addChild(exitButton); }
/// <summary> /// Constructs a new song select scene for the given window. /// </summary> /// <param name="window">The window for the song select scene.</param> public SongSelectScene(Window window) : base(window) { foreach(MapSetMetadata mapSet in MapManager.GetMapSets()) { foreach(Map map in mapSet.GetMaps()) { Button mapBtn = new Button(map.Name); mapBtn.Align( new RelativeAlignment(mapBtn, window, true) { OffsetX = 20, OffsetY = 20 } ); Map targetMap = map; // for lambda capture mapBtn.Clicked += delegate { window.Transition(this, new PlayScene(window, targetMap)); }; addChild(mapBtn); } } }