Draw() public method

public Draw ( ) : void
return void
Example #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(Color.CornflowerBlue);
            spriteBatch.Begin(samplerState: SamplerState.PointClamp, blendState: BlendState.NonPremultiplied);

            /*for (int x = 0; x < WIDTH; x++)
             * {
             *      for (int y = 0; y < HEIGHT; y++)
             *      {
             *              Color color = colors[depth - minDepth][x][y];
             *              spriteBatch.Draw(pixel, new Rectangle(x * SCALE, y * SCALE, SCALE, SCALE), color);
             *      }
             * }
             *
             * spriteBatch.DrawString(font, "Depth: " + depth, new Vector2(10, 380), Color.White, 0, Vector2.Zero, SCALE, SpriteEffects.None, 0);
             * spriteBatch.DrawString(font, hoverBiomeName, new Vector2(10, 10), Color.White, 0, Vector2.Zero, SCALE, SpriteEffects.None, 0);
             */

            gui.Draw(spriteBatch);

            if (!string.IsNullOrEmpty(tooltip))
            {
                Tooltip.DrawTooltip(spriteBatch, tooltip, input.GetMousePosition() + TOOLTIP_OFFSET);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
        public void Draw(GUIContainer container, ref Matrix4 projection)
        {
            this.matrix = projection;

            Vector2 _offset = container.Position;
            Rect _drawableArea = container.Bounds;
            this.SetSubRectDrawableArea(ref _drawableArea, ref _drawableArea, out _drawableArea);

            container.Draw(ref _drawableArea, this);

            this.batch.Draw(ref this.matrix);
        }