Beispiel #1
0
        private void createGUI()
        {
            GuiButton stopButton = new GuiButton(890, 870);

            stopButton.OnClickEvent += new GuiButton.ClickEventHandler(stopButton_OnClickEvent);
            this.addActor(stopButton);

            turnButton = new GuiButton(890, 10);
            turnButton.OnClickEvent += new GuiButton.ClickEventHandler(turnButton_OnClickEvent);
            turnButton.setImage("Images\\turndwarf.png");
            turnButton.setImageActive("Images\\turndwarf_a.png");
            this.addActor(turnButton);

            GuiButton dwarf = new GuiButton(20, 0);

            dwarf.receivesInput(false);
            dwarf.setImage("Images\\dwarf.png");
            this.addActor(dwarf);

            GuiButton troll = new GuiButton(20, 70);

            troll.receivesInput(false);
            troll.setImage("Images\\troll.png");
            this.addActor(troll);

            dwarfScore = new GuiText(90, 0);
            dwarfScore.setText("32");
            this.addActor(dwarfScore);

            trollScore = new GuiText(90, 70);
            trollScore.setText("32");
            this.addActor(trollScore);
        }
Beispiel #2
0
        public void displayWin(SIDE type)
        {
            String str = "Dwarves win!";
            String img = "Images\\dwarfbig.png";

            if (type == SIDE.TROLL)
            {
                str = "Trolls win!";
                img = "Images\\trollbig.png";
            }

            GuiText text = new GuiText(300, 300);

            text.setText(str);
            text.setFontColor(Color.Black);
            text.setFontSize(75);
            text.receivesInput(false);
            this.addActor(text);

            GuiButton image = new GuiButton(400, 500);

            image.setImage(img);
            image.receivesInput(false);
            this.addActor(image);
        }