상속: Image
예제 #1
0
        public MainMenuScreen(int widthScreen, int heightScreen, IScreenMaster master)
            : base(widthScreen, heightScreen, master)
        {
            Texture2D up = Load<Texture2D>("Image/buttonUp");
            Texture2D down = Load<Texture2D>("Image/buttonDown");
            SpriteFont font = Load<SpriteFont>("Font/text");

            int centerX = widthScreen / 2 - up.Width / 2;
            int buttonStartY = heightScreen / 3;
            int buttonSpacing = 10;

            ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black);
            bg = c;

            Label t = new Label(widthScreen / 2, 10, font, "Project: Height");
            t.x -= (int)t.GetDim().X / 2;
            title = t;

            Button newGame = new TextButton(centerX, buttonStartY, up, down, font, "New Game");
            Button loadGame = new TextButton(centerX, buttonStartY + up.Height + buttonSpacing, up, down, font, "Load Game");
            Button options = new TextButton(centerX, buttonStartY + 2 * (up.Height + buttonSpacing), up, down, font, "Options");

            newGame.select += delegate() { LevelLoader.Load(1); ChangeScreen<StoryScreen>(); };
            loadGame.select += delegate() { ChangeScreen<LoadGameScreen>(); };
            options.select += delegate() { ChangeScreen<OptionScreen>(); };

            buttons.Add(newGame);
            buttons.Add(loadGame);
            buttons.Add(options);
        }
예제 #2
0
         public SelectScreen2(int width, int height, IScreenMaster master)
            : base(width, height, master)
        {
            input = Settings.in2;

            Texture2D up = Load<Texture2D>("Image/buttonUp");
            Texture2D down = Load<Texture2D>("Image/buttonDown");
            SpriteFont font = Load<SpriteFont>("Font/text");

            int centerX = widthScreen / 2 - up.Width / 2;

            ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black);
            bg = c;

            Label t = new Label(widthScreen / 2, 10, font, "P2, Select Character");
            t.x -= (int)t.GetDim().X / 2;
            title = t;

            Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back");

            back.select += delegate() { ChangeScreen<SelectScreen1>(); };



            CharacterButton wasp = new CharacterButton(100, 100, LoadAnim("waspIdle"), up, down);
            wasp.select += delegate() { Settings.P2_FIGHTER = "wasp"; ChangeScreen<GameScreen>(); };
            buttons.Add(wasp);

            CharacterButton beetle = new CharacterButton(180, 100, LoadAnim("beetleIdle"), up, down);
            beetle.select += delegate() { Settings.P2_FIGHTER = "beetle"; ChangeScreen<GameScreen>(); };
            buttons.Add(beetle);
            buttons.Add(back);
        }
예제 #3
0
        public LoadGameScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master)
        {
            Texture2D up = Load<Texture2D>("Image/buttonUp");
            Texture2D down = Load<Texture2D>("Image/buttonDown");
            SpriteFont font = Load<SpriteFont>("Font/text");

            int centerX = widthScreen / 2 - up.Width / 2;

            ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black);
            bg = c;

            Label t = new Label(widthScreen / 2, 10, font, "Load Game");
            t.x -= (int)t.GetDim().X / 2;
            title = t;

            Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back");

            back.select += delegate() { ChangeScreen<MainMenuScreen>(); };

            buttons.Add(back);
        }