protected override void OnActivateScene(object parameter) { PlayerOneSlide.Stop(); PlayerOneSlide.GoLastFrame(); PlayerTwoSlide.Stop(); PlayerTwoSlide.GoLastFrame(); PlayerOneFace.FaceID = -1; PlayerTwoFace.FaceID = -1; UsePlayerOne = false; UsePlayerTwo = false; PlayerOneSwitch.IsDown = false; PlayerOneSwitch.Name = ""; PlayerTwoSwitch.IsDown = false; PlayerTwoSwitch.Name = ""; Difficulty.IsDown = true; }
public MenuScene(Module App) : base(App) { Background = "sta.pac"; Music = "15_MUS 15_HSC.ogg"; Position = (app.Engine.GameResolution - new Vector2(320, 200)) / 2; // face PlayerOneFace = new FaceWindow(App); PlayerOneFace.MaxFaceID = 5; PlayerOneFace.Position = new Vector2(33, 28); PlayerOneFace.Group = 3; Windows += PlayerOneFace; PlayerTwoFace = new FaceWindow(App); PlayerTwoFace.MaxFaceID = 5; PlayerTwoFace.Position = new Vector2(223, 28); PlayerTwoFace.Group = 3; Windows += PlayerTwoFace; // face slides Image image = new Image(App, "sta.ani?10-16"); image.Position = new Vector2(30, 26); image.Layer++; PlayerOneSlide = image.Background.Animation; Windows += image; image = new Image(App, "sta.ani?10-16"); image.Position = new Vector2(220, 26); image.Layer++; PlayerTwoSlide = image.Background.Animation; Windows += image; PlayerOneSlide.Speed = 10; PlayerTwoSlide.Speed = 10; PlayerOneSlide.Endless = false; PlayerOneSlide.Stop(); PlayerOneSlide.GoLastFrame(); PlayerTwoSlide.Endless = false; PlayerTwoSlide.Stop(); PlayerTwoSlide.GoLastFrame(); // buttons Button button = new Button(App); button.Position = new Vector2(131, 42); button.Image = "sta.ani?17"; button.HoverImage = "sta.ani?18"; button.Command += OnButtonStart; Windows += button; button = new Button(App); button.Position = new Vector2(131, 15); button.Image = "sta.ani?19"; button.HoverImage = "sta.ani?20"; button.Command += OnButtonLoad; Windows += button; // exit button button = new Button(App); button.Image = "gfx/menu_exit.png"; button.HoverImage = "gfx/menu_exit_hover.png"; button.Position = new Vector2(276, 163); button.Command += OnButtonExit; Windows += button; // player names PlayerOneSwitch = new NameWindow(App); PlayerOneSwitch.Position = new Vector2(15, 92); PlayerOneSwitch.Image = "sta.ani?6"; PlayerOneSwitch.DownImage = "sta.ani?7"; PlayerOneSwitch.DownCommand += OnPlayerOneDown; PlayerOneSwitch.UpCommand += OnPlayerOneUp; PlayerOneSwitch.Command += OnPlayerOneClick; PlayerOneSwitch.Font = new GuiFont(BurntimeClassic.FontName, new PixelColor(184, 184, 184)); Windows += PlayerOneSwitch; PlayerTwoSwitch = new NameWindow(App); PlayerTwoSwitch.Position = new Vector2(204, 92); PlayerTwoSwitch.Image = "sta.ani?6"; PlayerTwoSwitch.DownImage = "sta.ani?7"; PlayerTwoSwitch.DownCommand += OnPlayerTwoDown; PlayerTwoSwitch.UpCommand += OnPlayerTwoUp; PlayerTwoSwitch.Command += OnPlayerTwoClick; PlayerTwoSwitch.Font = new GuiFont(BurntimeClassic.FontName, new PixelColor(184, 184, 184)); Windows += PlayerTwoSwitch; // color Radio radio = new Radio(App); radio.Position = new Vector2(45, 121); radio.Image = "sta.ani?8"; radio.DownImage = "sta.ani?9"; radio.Mode = RadioMode.Round; radio.Group = 2; Color = radio; Windows += radio; radio = new Radio(App); radio.IsDown = true; radio.Position = new Vector2(237, 121); radio.Image = "sta.ani?8"; radio.DownImage = "sta.ani?9"; radio.Mode = RadioMode.Round; radio.Group = 2; Windows += radio; // difficulty for (int i = 0; i < 3; i++) { radio = new Radio(App); if (i == 0) { radio.IsDown = true; Difficulty = radio; } radio.Position = new Vector2(100 + 45 * i, 149); radio.Image = "sta.ani?" + (i * 2).ToString(); radio.HoverImage = "sta.ani?" + (i * 2 + 1).ToString(); radio.DownImage = "sta.ani?" + (i * 2 + 1).ToString(); radio.Group = 1; Windows += radio; } // input conversion conversionTable = new Burntime.Platform.IO.ConfigFile(); conversionTable.Open(Burntime.Platform.IO.FileSystem.GetFile("conversion_table.txt")); PlayerOneSwitch.Table = conversionTable; PlayerTwoSwitch.Table = conversionTable; }