예제 #1
0
        private void SetupGameViewAndGameContext()
        {
            // Force the format of the window color buffer (avoid conversions)
            // TODO: PDX-364: depth format is currently hard coded (need to investigate how it can be transmitted)
            var windowColorBufferFormat = Format.Rgba8888;

            // Set the main view of the Game
            var context = PlatformAndroid.Context;

            if (context != this)
            {
                try
                {
                    var windowManager = context.GetSystemService(WindowService).JavaCast <IWindowManager>();
                    var mainView      = LayoutInflater.From(context).Inflate(Resource.Layout.Game, null);
                    windowManager.AddView(mainView, new WindowManagerLayoutParams(WindowManagerTypes.SystemAlert, WindowManagerFlags.Fullscreen, windowColorBufferFormat));
                    mainLayout = mainView.FindViewById <RelativeLayout>(Resource.Id.GameViewLayout);
                }
                catch (Exception) {} // don't have the Alert permissions
            }
            if (mainLayout == null)
            {
                Window.SetFormat(windowColorBufferFormat);
                SetContentView(Resource.Layout.Game);
                mainLayout = FindViewById <RelativeLayout>(Resource.Id.GameViewLayout);
            }

            // Set the content of the view
            mainLayout.AddView(GameView);

            // Create the Game context
            GameContext = new GameContextAndroid(GameView, FindViewById <RelativeLayout>(Resource.Id.EditTextLayout));
        }
예제 #2
0
        private void SetupGameViewAndGameContext()
        {
            // Set the main view of the Game
            SetContentView(Resource.Layout.Game);
            mainLayout = FindViewById <RelativeLayout>(Resource.Id.GameViewLayout);
            mainLayout.AddView(gameView);

            // Create the Game context
            GameContext = new GameContextAndroid(gameView, FindViewById <RelativeLayout>(Resource.Id.EditTextLayout));
        }
        private void SetupGameViewAndGameContext()
        {
            // Set the main view of the Game
            SetContentView(Resource.Layout.Game);
            mainLayout = FindViewById<RelativeLayout>(Resource.Id.GameViewLayout);
            mainLayout.AddView(gameView);

            // Create the Game context
            GameContext = new GameContextAndroid(gameView, FindViewById<RelativeLayout>(Resource.Id.EditTextLayout));
        }
예제 #4
0
 protected virtual void SetupGameContext()
 {
     // Create the Game context
     GameContext = new GameContextAndroid(null, FindViewById <RelativeLayout>(Resource.Id.EditTextLayout));
 }