Пример #1
0
		public void Draw(DrawContext context, GameTime gameTime)
		{
			_views.Draw (context, gameTime);
		}
Пример #2
0
		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);
			}
		}
Пример #3
0
		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);
 }
Пример #5
0
		protected virtual void DrawAboveSubviews (DrawContext context, GameTime gameTime)
		{
		}
Пример #6
0
		protected virtual void DrawForeground (DrawContext context, GameTime gameTime)
		{
		}
Пример #7
0
		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);
			}
		}
Пример #8
0
		public virtual void Draw (DrawContext context, GameTime gameTime)
		{
			LayoutIfNeeded ();

			DrawBackground (context, gameTime);
			DrawForeground (context, gameTime);
			_subviews.Draw (context, gameTime);
			DrawAboveSubviews (context, gameTime);
		}