public override void Draw(DrawContext context) { base.Draw(context); Texture2D texture2D = this.texture ?? context.BlankTexture; Vector2? sourceSize = this.SourceSize; Vector2 vector = sourceSize.HasValue ? sourceSize.GetValueOrDefault() : base.Size; Rectangle rectangle = new Rectangle { X = (int)this.origin.X, Y = (int)this.origin.Y, Width = (int)vector.X, Height = (int)vector.Y }; Rectangle destinationRectangle = new Rectangle { X = (int)context.DrawOffset.X, Y = (int)context.DrawOffset.Y, Width = (int)base.Size.X, Height = (int)base.Size.Y }; context.SpriteBatch.Draw(texture2D, destinationRectangle, new Rectangle?(rectangle), this.Color); }
public override void Draw(DrawContext context) { base.Draw(context); context.SpriteBatch.DrawString(this.font, this.Text, context.DrawOffset, this.Color); }
public virtual void Draw(DrawContext context) { Vector2 drawOffset = context.DrawOffset; for (int i = 0; i < this.ChildCount; i++) { Control control = this.children[i]; if (control.Visible) { context.DrawOffset = drawOffset + control.Position; control.Draw(context); } } }
public override void Draw(DrawContext context) { context.DrawOffset.Y = (float)(-(float)this.scrollTracker.ViewRect.Y); base.Draw(context); }