Ejemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            // Add drawable screens to drawingscreens list for drawing
            foreach (GameState screen in screens)
            {
                if (screen.ScreenState == ScreenStates.ACTIVE_DRAW || screen.ScreenState == ScreenStates.IDLE_DRAW)
                {
                    drawingScreens.Add(screen);
                }
            }

            ResolutionHelper.BeginDraw(BackgroundColor);

            ScreensSpriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend,
                                     SamplerState.PointClamp, null, null, null,
                                     ResolutionHelper.GetTransformationMatrix());

            while (drawingScreens.Count > 0)
            {
                GameState screen = drawingScreens[drawingScreens.Count - 1];

                screen.Draw(ScreensSpriteBatch);

                drawingScreens.RemoveAt(drawingScreens.Count - 1);
            }

            ScreensSpriteBatch.End();

            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        public TempleMain(Android.OS.Vibrator vib)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            var MainX = graphics.PreferredBackBufferWidth;
            var MainY = graphics.PreferredBackBufferHeight;


            ResolutionHelper.Init(graphics, MainX, MainY, 1280, 720, false);

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            graphics.ToggleFullScreen();

            MainContext = vib;
        }