Пример #1
0
        public GUILabel CreateGUILabel(Engine.GUI gui, Handle handle, Vector2 pos)
        {
            var GuiLabel = new GUILabel(gui, handle);

            GuiLabel.pos = pos;
            gui.add(GuiLabel);

            return(GuiLabel);
        }
Пример #2
0
        public PlayerSelection(Game engine, Engine.GUI gui)
        {
            this.engine = engine;
            this.gui    = gui;

            humanHandle    = new Handle(engine.resourceComponent, SelectHandleNames.humanResString);
            computerHandle = new Handle(engine.resourceComponent, SelectHandleNames.computerResString);
            noneHandle     = new Handle(engine.resourceComponent, SelectHandleNames.noneResString);
        }
Пример #3
0
        public void initializeInfoBox()
        {
            Engine.GUI tempGUI = engine.graphicsComponent.gui;

            playerInfoLabel        = new GUILabel(tempGUI, new Handle(engine.resourceComponent, "GUI\\PlayerInfoBg.png"));
            playerInfoOutlineLabel = new GUILabel(tempGUI, new Handle(engine.resourceComponent, "GUI\\PlayerInfoOutline.png"));
            healthInfoBox          = new GUITextBox(tempGUI, "");
            attackInfoBox          = new GUITextBox(tempGUI, "");
            levelInfoBox           = new GUITextBox(tempGUI, "");

            tempGUI.add(playerInfoOutlineLabel);
            tempGUI.add(playerInfoLabel);
            tempGUI.add(healthInfoBox);
            tempGUI.add(attackInfoBox);
            tempGUI.add(levelInfoBox);

            teamBox = new GUILabel(tempGUI);
            tempGUI.add(teamBox);
        }
Пример #4
0
 public PauseMenu(Game p_engine, Engine.GUI p_gui, GameWorld p_world)
 {
     engine = p_engine;
     gui    = p_gui;
     world  = p_world;
 }
Пример #5
0
        private void UpdateInfoBox()
        {
            if (teamBoxCooldown == 0)
            {
                teamBox.texture = null;
            }
            else
            {
                teamBoxCooldown--;
            }

            Engine.GUI tempGUI = engine.graphicsComponent.gui;                                                                           //setting a temporary gui again just to set a GUI
            highlightTile = (GameTile)getTileAt(engine.graphicsComponent.camera.screen2World(engine.inputComponent.getMousePosition())); //the tile that the mouse is hovering over

            if (highlightTile != null)
            {
                //locationBox.texture = highlightTile.texture;
                highLightPlayer = (this.getAnimalOnTile(highlightTile) as AnimalActor);

                //updates the Player Information box
                if (highLightPlayer != null)
                {
                    //draws the image of the tile when it has one
                    //the text shows the Name and Health of the actor
                    healthInfoBox.text  = " Health: " + (highLightPlayer as AnimalActor).life.health + " ";
                    attackInfoBox.text  = " Attack: " + (highLightPlayer as AnimalActor).attackDamage.ToString() + " ";
                    attackInfoBox.text += "| Defense: " + (highLightPlayer as AnimalActor).defense.ToString() + " ";
                    levelInfoBox.text   = " Level: " + (highLightPlayer as AnimalActor).level.ToString() + " ";

                    if ((highLightPlayer as AnimalActor).level != AnimalActor.maxLevel)
                    {
                        levelInfoBox.text += "| Exp: " + (highLightPlayer as AnimalActor).expPoints.ToString() + "/" + (highLightPlayer as AnimalActor).expLevel[(highLightPlayer as AnimalActor).level + 1].ToString();
                    }
                    else
                    {
                        levelInfoBox.text += "| Exp: " + (highLightPlayer as AnimalActor).expLevel[(highLightPlayer as AnimalActor).level] + "/" + (highLightPlayer as AnimalActor).expLevel[(highLightPlayer as AnimalActor).level].ToString();
                    }

                    var mousePos = engine.inputComponent.getMousePosition();
                    if (mousePos.x < engine.graphicsComponent.camera.screenWidth - 165)
                    {
                        playerInfoOutlineLabel.pos = mousePos + new Vector2(13, -2);
                        playerInfoLabel.pos        = mousePos + new Vector2(15, 0);
                        healthInfoBox.pos          = mousePos + new Vector2(15, 0);
                        attackInfoBox.pos          = mousePos + new Vector2(15, 15);
                        levelInfoBox.pos           = mousePos + new Vector2(15, 30);
                    }
                    else
                    {
                        playerInfoOutlineLabel.pos = mousePos + new Vector2(148, -2);
                        playerInfoLabel.pos        = mousePos - new Vector2(150, 0);
                        healthInfoBox.pos          = mousePos - new Vector2(150, 0);
                        attackInfoBox.pos          = mousePos + new Vector2(-150, 15);
                        levelInfoBox.pos           = mousePos + new Vector2(-150, 30);
                    }

                    playerInfoOutlineLabel.visible = true;
                    playerInfoLabel.visible        = true;
                    healthInfoBox.visible          = true;
                    attackInfoBox.visible          = true;
                    levelInfoBox.visible           = true;
                }
                else
                {
                    playerInfoOutlineLabel.visible = false;
                    playerInfoLabel.visible        = false;
                    healthInfoBox.visible          = false;
                    attackInfoBox.visible          = false;
                    levelInfoBox.visible           = false;
                    healthInfoBox.text             = "";
                    attackInfoBox.text             = "";
                    levelInfoBox.text = "";
                }
            }
        }