Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            inputState = new InputState();
            recorder = new Recorder();
            Pad.Played += new EventHandler(Pad_Played);

            // Frame rate is 30 fps (=333333 ticks) by default for Windows Phone 7. However later
            // Windows Phone releases should support 60 fps, so we'll try that
            TargetElapsedTime = TimeSpan.FromTicks(166666);
            System.Diagnostics.Debug.WriteLine("Target elapsed time " + TargetElapsedTime.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delivers touch input to the active views
        /// </summary>
        /// <param name="input"></param>
        private void HandleInput(InputState input)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            foreach (TouchLocation touch in input.touchState)
            {
                activeView.TouchEvent(touch);
            }
            foreach (GestureSample gesture in input.Gestures)
            {
                activeView.TouchEvent(gesture);
            }
        }