Esempio n. 1
0
        public AndroidGamePlatform(Game game) : base(game)
        {
            Game.Activity.Game           = Game;
            AndroidGameActivity.Paused  += Activity_Paused;
            AndroidGameActivity.Resumed += Activity_Resumed;

            _gameWindow = new AndroidGameWindow(Game.Activity, game);
            Window      = _gameWindow;
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="orientation"></param>
        public override void OnOrientationChanged(int orientation)
        {
            if (orientation == OrientationEventListener.OrientationUnknown)
            {
                return;
            }
            if (ScreenReciever.ScreenLocked)
            {
                return;
            }

            var disporientation = AndroidCompatibility.GetAbsoluteOrientation(orientation);

            AndroidGameWindow gameWindow = (AndroidGameWindow)Game.Instance.Window;

            if ((gameWindow.GetEffectiveSupportedOrientations() & disporientation) != 0 && disporientation != gameWindow.CurrentOrientation)
            {
                gameWindow.SetOrientation(disporientation, true);
            }
        }
Esempio n. 3
0
 public AndroidTouchEventManager(AndroidGameWindow androidGameWindow)
 {
     _gameWindow = androidGameWindow;
 }
Esempio n. 4
0
 public XnAndroidGameView(Context context, AndroidGameWindow window, Game game) : base(context)
 {
     _touchManager = new AndroidTouchEventManager(window);
     _gameWindow   = window;
     _game         = game;
 }