Exemple #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();
        }
Exemple #2
0
        public void setGrid(UIObj uiObj, int posX, int posY)
        {
            if (NaviGrid[posX, posY] == null)
            {
                NaviGrid[posX, posY] = uiObj;
            }

            else if (NaviGrid[posX, posY].Equals(uiObj) == false)
            {
                NaviGrid[posX, posY] = uiObj;
            }
        }
Exemple #3
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);
                    }
                }
            }
        }
Exemple #4
0
        public void createGrid(int sizeX, int sizeY)
        {
            NaviGrid = new UIObj[sizeX, sizeY];

            edge = new Tuple <int, int>(sizeX, sizeY);
        }