Exemple #1
0
        public override void initializeGameComponent(ContentManager content)
        {
            enemyHistoryWindow = new UniqueWindow <GameComponent>(content, 6);
            //newHistory = duplicate(moveHistory);
            //newHistory.type = MoveHistory.Type.Previous;
            enemyHistoryWindow.updateObj(moveHistory);
            enemyHistoryWindow.setPos(Game1.windowW / 2, Game1.windowH / 2);
            historyWindow = new UniqueWindow <GameComponent>(content, 6);
            //historyWindow.setPos(Game1.windowW - GraphicsSettings.toResolution(500), 100);
            historyButton = new UniqueButtonPopper <UniqueWindow <GameComponent>, GameComponent>(content, historyWindow);
            historyButton.setSprite(content, "pastMovesButton");
            historyButton.setButtonText("Past Moves");
            historyButton.wantedScale = .5f;
            historyButton.centerText(historyButton.getWidth() / 2 - GraphicsSettings.toResolution(80), historyButton.getHeight() / 2 - GraphicsSettings.toResolution(40));
            historyButton.updateObj(moveHistory);
            historyButton.setPos(Game1.windowW - GraphicsSettings.toResolution(500), 0);

            historyWindow.setPos(Game1.windowW - GraphicsSettings.toResolution(500), 100);
            UpButton upButton = new UpButton();

            upButton.setTexture(UpButton.texture);
            upButton.setOffset(historyWindow.getWidth(), 0);

            DownButton downButton = new DownButton();

            downButton.setTexture(DownButton.texture);
            downButton.setOffset(historyWindow.getWidth(), upButton.getHeight() * 2);

            LeftButton leftButton = new LeftButton();

            leftButton.setTexture(LeftButton.texture);
            leftButton.setOffset(0, historyWindow.getHeight() / 2);

            RightButton rightButton = new RightButton();

            rightButton.setTexture(RightButton.texture);
            rightButton.setOffset(historyWindow.getWidth(), historyWindow.getHeight() / 2);

            upButton.setAction(() => {
                moveHistory.ScrollUp();
            });
            downButton.setAction(() => {
                moveHistory.ScrollDown();
            });
            rightButton.setAction(() => {
                moveHistory.NextTurn();
            });
            leftButton.setAction(() => {
                moveHistory.PreviousTurn();
            });

            historyWindow.addNewComponent(upButton);
            historyWindow.addNewComponent(downButton);
            historyWindow.addNewComponent(rightButton);
            historyWindow.addNewComponent(leftButton);

            castManuever.setPos(Game1.windowW - GraphicsSettings.toResolution(400), GraphicsSettings.toResolution(200));
            endGamePopup.initializeGameComponent(content);
            rowFog.setSprite(content, "rowNotRevealed");
        }
Exemple #2
0
 public void imageAndFunctionsSetup(ContentManager content)
 {
     initAllComponents();
     background.setSprite(content, "board");
     textures = new BoardTextures(this);
     textures.initTextures(content);
     initButtons(content);
 }