Beispiel #1
0
        public void Update(PicoInput input)
        {
            _uiMouseState.UpdatePosition(input.MouseX, input.MouseY);

            var leftDown   = input.MouseDown(MouseButton.Left);
            var middleDown = input.MouseDown(MouseButton.Middle);
            var rightDown  = input.MouseDown(MouseButton.Right);

            _uiMouseState.MouseLeftDown   = leftDown;
            _uiMouseState.MouseMiddleDown = middleDown;
            _uiMouseState.MouseRightDown  = rightDown;

            _root.Update(_uiMouseState);
        }
Beispiel #2
0
        public PicoGame()
        {
            Instance = this;

            PicoPlatform.Initialize();

            _gfx   = new PicoGfx();
            _input = new PicoInput();

            PicoPlatform.TerminateRequested += (sender, args) => this.Quit();
            PicoPlatform.DisplayResized     += OnDisplayResize;

            PicoPlatform.GamePadAdded   += (sender, gamepadDesc) => _input.AddGamePad(gamepadDesc);
            PicoPlatform.GamePadRemoved += (sender, slot) => _input.RemoveGamePad(slot);
        }