Ejemplo n.º 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.White);
            // TODO: Add your drawing code here

            spriteBatch.Begin();


            foreach (var actor in actors)
            {
                actor.Draw(currentCamera.ViewMatrix, currentCamera.ProjectionMatrix);
                actor.Draw(spriteBatch);
            }
            if (!IsMouseVisible)
            {
                mouseDisplayActor.Draw(spriteBatch);
                mouseDisplayActor.Draw(currentCamera.ViewMatrix, currentCamera.ProjectionMatrix);
            }
            spriteBatch.End();

            _desktop.Bounds = new Rectangle(0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth,
                                            GraphicsDevice.PresentationParameters.BackBufferHeight);
            _desktop.Render();

            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            host.Bounds = new Rectangle(0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight);
            host.Render();
        }
Ejemplo n.º 3
0
        protected override void Draw(GameTime gameTime)
        {
            if (RenderContext == null)
            {
                return;
            }

            GraphicsDevice.Clear(Color.Black);

            if (ScreenContainer.HasActiveScreen)
            {
                RenderContext.SpriteBatch.Begin();
                ScreenContainer.Screen.RenderBackgroundFrame(RenderContext);
                RenderContext.SpriteBatch.End();

                desktop.Render();

                RenderContext.SpriteBatch.Begin();
                ScreenContainer.Screen.RenderForegroundFrame(RenderContext);
                RenderContext.SpriteBatch.End();
            }

            base.Draw(gameTime);
        }