public void Draw(DrawContext context, GameTime gameTime) { _views.Draw (context, gameTime); }
protected override void DrawForeground(DrawContext context, GameTime gameTime) { if (Font != null && !string.IsNullOrWhiteSpace(Text)) { context.SpriteBatch.DrawString ( Font, Text, new Vector2(Padding.Left, Padding.Top), TextColor); } }
public override void Draw(GameTime gameTime) { base.Draw(gameTime); if (_drawContext == null || _drawContext.GraphicsDevice != GraphicsDevice) _drawContext = new DrawContext (GraphicsDevice, Matrix.Identity); _drawContext.Begin (Matrix.Identity); try { _universe.Draw (_drawContext, gameTime); } finally { _drawContext.End (); } }
public void Draw(DrawContext context, GameTime gameTime) { _views.Draw(context, gameTime); }
protected virtual void DrawAboveSubviews (DrawContext context, GameTime gameTime) { }
protected virtual void DrawForeground (DrawContext context, GameTime gameTime) { }
protected virtual void DrawBackground (DrawContext context, GameTime gameTime) { if (BackgroundColor.A > 0) { var swatch = Universe.Content.Load<Texture2D>(@"Textures\white-1"); context.SpriteBatch.Draw ( swatch, Vector2.Zero, null, BackgroundColor, 0, Vector2.Zero, new Vector2 (Frame.Width, Frame.Height), SpriteEffects.None, 0); } }
public virtual void Draw (DrawContext context, GameTime gameTime) { LayoutIfNeeded (); DrawBackground (context, gameTime); DrawForeground (context, gameTime); _subviews.Draw (context, gameTime); DrawAboveSubviews (context, gameTime); }