Paint.BaseGame.Draw C# (CSharp) Méthode

Draw() protected méthode

Called everytime we need to redraw the screen
protected Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime /// Allows you to monitor time passed since last draw ///
Résultat void
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice device = this.GraphicsDeviceManager.GraphicsDevice;

            // First set the render target to be our image that we update as we go along...
            device.SetRenderTarget(InMemoryCanvasRenderTarget);

            this.Canvas.Draw(this.CanvasTouchPoints);

            // Then we draw the toolbox
            device.SetRenderTarget(InMemoryToolboxRenderTarget);
            this.ToolBox.Draw(this.InitialDraw);

            // Thes switch back to drawing onto the screen where we copy our image on to the screen
            device.SetRenderTarget(null);
            device.Clear(this.BackgroundColor);

            this.GraphicsDisplay.BeginRender();

            this.DrawCanvasOnScreen();
            this.DrawToolboxOnScreen();

            this.GraphicsDisplay.EndRender();

            this.InitialDraw = false;

            // We've dealt with all the touch points so now we can start with a new list
            this.CanvasTouchPoints = new List<ITouchPointSizeColor>();

            base.Draw(gameTime);
        }