コード例 #1
0
    public PauseMenu(MyGame pMyGame, Level pMyLevel)
    {
        _myGame = pMyGame;
        _level  = pMyLevel;
        createCanvas();

        _btnResume = new AnimationButton("assets\\UI\\resume_button00.png", 2, 1);
        AddChild(_btnResume);
        _btnResume.x = (game.width - _btnResume.width) / 2;
        _btnResume.y = ((game.height / 2) - (_btnResume.height * 2));

        _btnRestart = new AnimationButton("assets\\UI\\restart_button00.png", 2, 1);
        AddChild(_btnRestart);
        _btnRestart.x = (game.width - _btnRestart.width) / 2;
        _btnRestart.y = ((game.height / 2) - (_btnRestart.height / 2));

        _btnReturnToMainMenu = new AnimationButton("assets\\UI\\main_menu_button00.png", 2, 1);
        AddChild(_btnReturnToMainMenu);
        _btnReturnToMainMenu.x = (game.width - _btnReturnToMainMenu.width) / 2;
        _btnReturnToMainMenu.y = ((game.height / 2) + (_btnReturnToMainMenu.height));

        _btnQuit = new AnimationButton("assets\\UI\\quit_button00.png", 2, 1);
        AddChild(_btnQuit);
        _btnQuit.x = (game.width - _btnQuit.width) / 2;
        _btnQuit.y = ((game.height / 2) + ((_btnQuit.height * 2) + (_btnQuit.height / 2)));
    }
コード例 #2
0
    public MainMenu(MyGame myGame)
    {
        _myGame        = myGame;
        btnLevelSelect = new AnimationButton("assets\\UI\\play_button00.png", 2, 1);
        AddChild(btnLevelSelect);
        btnLevelSelect.x = (game.width - btnLevelSelect.width) / 2;
        btnLevelSelect.y = (game.height - btnLevelSelect.height) / 2;

        btnQuit = new AnimationButton("assets\\UI\\quit_button00.png", 2, 1);
        AddChild(btnQuit);
        btnQuit.x = (game.width - btnQuit.width) / 2;
        btnQuit.y = (game.height + (btnQuit.height * 2)) / 2;
    }
コード例 #3
0
    public WinScreen(MyGame pMyGame, int pAmountOfMovesAsScore)
    {
        _myGame        = pMyGame;
        _amountOfMoves = pAmountOfMovesAsScore;
        createCanvas();

        switch (_myGame.GetCompletedLevel)
        {
        case 1:
            _btnNextLevel = new AnimationButton("assets\\UI\\next_level_button00.png", 2, 1);
            break;

        case 2:
            _btnNextLevel = new AnimationButton("assets\\UI\\next_level_button00.png", 2, 1);
            break;

        case 3:
            _btnNextLevel = null;     // dont need this button because there is no next level at this point.
            break;

        default:
            break;
        }

        if (_btnNextLevel != null)
        {
            AddChild(_btnNextLevel);
            _btnNextLevel.x = (game.width - _btnNextLevel.width) / 2;
            _btnNextLevel.y = ((game.height / 2) - (_btnNextLevel.height * 2));
        }

        _btnRedoPreviousLevel = new AnimationButton("assets\\UI\\retry_button_00.png", 2, 1);
        AddChild(_btnRedoPreviousLevel);
        _btnRedoPreviousLevel.x = (game.width - _btnRedoPreviousLevel.width) / 2;
        _btnRedoPreviousLevel.y = ((game.height / 2) - (_btnRedoPreviousLevel.height / 2));

        _btnReturnToMainMenu = new AnimationButton("assets\\UI\\main_menu_button00.png", 2, 1);
        AddChild(_btnReturnToMainMenu);
        _btnReturnToMainMenu.x = (game.width - _btnReturnToMainMenu.width) / 2;
        _btnReturnToMainMenu.y = ((game.height / 2) + (_btnReturnToMainMenu.height));
    }