コード例 #1
0
        /// <inheritdoc/>
        public PointerState GetState()
        {
            var state = new PointerState();

            GetState(state);

            return(state);
        }
コード例 #2
0
        /// <inheritdoc/>
        public void GetState(PointerState state)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state");
            }

            state.Points.Clear();

            foreach (var point in statePointerPoints)
            {
                state.Points.Add(point);
            }
        }
コード例 #3
0
        public AudioGame()
        {
            // Creates a graphics manager. This is mandatory.
            graphicsDeviceManager = new GraphicsDeviceManager(this);

            // Create the pointer manager
            pointerManager = new PointerManager(this);
            pointerState = new PointerState();

            IsMouseVisible = true;

            random = new Random();

            audioManager = new AudioManager(this);
            audioManager.EnableMasterVolumeLimiter();
            //EnableSpatialAudioWithReverb();

            // Setup the relative directory to the executable directory
            // for loading contents with the ContentManager
            Content.RootDirectory = "Content";

        }
コード例 #4
0
ファイル: Camera.cs プロジェクト: danbystrom/VisionQuest
 public void UpdateInputDevices()
 {
     KeyboardState = KeyboardManager.GetState();
     KeyboardState.GetDownKeys(_downKeys);
     MouseState = MouseManager.GetState();
     if(PointerManager!=null)
         PointerState = PointerManager.GetState();
 }
コード例 #5
0
        /// <inheritdoc/>
        public PointerState GetState()
        {
            var state = new PointerState();

            GetState(state);

            return state;
        }
コード例 #6
0
        /// <inheritdoc/>
        public void GetState(PointerState state)
        {
            if(state == null) throw new ArgumentNullException("state");

            state.Points.Clear();

            foreach(var point in statePointerPoints)
                state.Points.Add(point);
        }
コード例 #7
0
        /// <summary>
        /// Update the state of all desired input devices.
        /// </summary>
        /// <param name="gameTime"></param>
        override public void Update(GameTime gameTime)
        {   
            // update state
            keyboardManager.Update(gameTime);
            keyboardState = keyboardManager.GetState();
            mouseState = mouseManager.GetState();
            pointerState = pointerManager.GetState();

              
            //mouseClick = mouseState.LeftButton.Pressed && !prevMouseState.LeftButton.Pressed;
            //mouseHeld = mouseState.LeftButton.Pressed && prevMouseState.LeftButton.Pressed;

            if (accelerometer != null) {
                accelerometerReading = accelerometer.GetCurrentReading();
                
            }

            // get mouse delta and reset mouse to centre of window
            if (useMouseDelta && mouseManager.Enabled) {
                mouseDelta = new Vector2(0.5f - mouseState.X, 0.5f - mouseState.Y);
                mouseManager.SetPosition(new Vector2(0.5f, 0.5f));
            }

            // record previous mouse state
            prevMouseState = mouseState;

 	        base.Update(gameTime);
        }