コード例 #1
0
ファイル: CursorManager.cs プロジェクト: XZelnar/MicroWorld
        public static void Initialize()
        {
            normal = new NormalCursor();
            normal.Initialize();
            move = new MoveCursor();
            move.Initialize();
            moveVertical = new MoveCursorVertical();
            moveVertical.Initialize();
            moveHorizontal = new MoveCursorHorizontal();
            moveHorizontal.Initialize();
            moveRightDown = new MoveRightDown();
            moveRightDown.Initialize();
            moveRightUp = new MoveRightUp();
            moveRightUp.Initialize();

            curCursor = normal;
            curCursor.OnShow();
        }
コード例 #2
0
ファイル: CursorManager.cs プロジェクト: XZelnar/MicroWorld
        public static void Update()
        {
            int x = InputEngine.curMouse.X, y = InputEngine.curMouse.Y;
            Utilities.Tools.ScreenToGameCoords(ref x, ref y);
            if (Logics.GameInputHandler.isDragDrop ||
                (GUIEngine.s_subComponentButtons.isVisible && GUIEngine.s_subComponentButtons.SelectedComponent is Components.Wire &&
                    GUIEngine.s_subComponentButtons.SelectedComponent.isIn(x, y) && Components.Wire.DnDState == 0))
                CurCursor = move;
            else if (Components.Wire.DnDState == 1)
                CurCursor = moveVertical;
            else if (Components.Wire.DnDState == 2)
                CurCursor = moveHorizontal;
            else if (Logics.GameInputHandler.resizeType != Direction.None)
            {
                if (Logics.GameInputHandler.resizeType == Direction.Left || Logics.GameInputHandler.resizeType == Direction.Right)
                    CurCursor = moveHorizontal;
                else if (Logics.GameInputHandler.resizeType == Direction.Up || Logics.GameInputHandler.resizeType == Direction.Down)
                    CurCursor = moveVertical;
                else if (Logics.GameInputHandler.resizeType == Direction.RightUp|| Logics.GameInputHandler.resizeType == Direction.LeftDown)
                    CurCursor = moveRightUp;
                else if (Logics.GameInputHandler.resizeType == Direction.RightDown || Logics.GameInputHandler.resizeType == Direction.LeftUp)
                    CurCursor = moveRightDown;
            }
            else
                CurCursor = normal;

            curCursor.Update();
        }