Ejemplo n.º 1
0
        public static void checkInput(UiGrid passedGrid, InputMngr inputMngr)
        {
            if (inputMngr.checkInput(controls.pressEnter))
            {
                UIObj activeObject = passedGrid.getSelObject();

                activeObject.runInstruction();
            }

            if (inputMngr.checkInput(controls.pressUp))
            {
                passedGrid.updateGridPos(UiGrid.direction.up);
            }

            if (inputMngr.checkInput(controls.pressLeft))
            {
                passedGrid.updateGridPos(UiGrid.direction.left);
            }

            if (inputMngr.checkInput(controls.pressDown))
            {
                passedGrid.updateGridPos(UiGrid.direction.down);
            }

            if (inputMngr.checkInput(controls.pressRight))
            {
                passedGrid.updateGridPos(UiGrid.direction.right);
            }

            passedGrid.updateSelected();
        }
Ejemplo n.º 2
0
        public void drawUi(UiGrid passedGrid, BasicEffect basicEffect)
        {
            for (int posY = 0; posY < passedGrid.edge.Item2; posY++)
            {
                for (int posX = 0; posX < passedGrid.edge.Item1; posX++)
                {
                    if (passedGrid.getObject(posX, posY) != null)
                    {
                        UIObj crtUiObj = passedGrid.getObject(posX, posY);

                        passedGrid.selection.draw(basicEffect);
                        crtUiObj.billboard.draw(basicEffect);
                    }
                }
            }
        }