public override void Draw(Canvas2D canvas) { canvas.DrawFrame(AbsoluteBoundingRect, Frames[State], FrameBorder, true, Color); if (_drawOverlay) { canvas.DrawSprite(AbsoluteBoundingRect, Overlay, ColorU.White); } var textSize = Canvas2D.MeasureText(Font, Text); Vector2 textDrawPos = new Vector2(AbsoluteBoundingRect.CenterX - textSize.X / 2, AbsoluteBoundingRect.CenterY - textSize.Y / 2); canvas.DrawText(Font, textDrawPos.Floored, Text, TextColor); base.Draw(canvas); }
public override void Draw(Canvas2D canvas) { canvas.DrawFrame(AbsoluteBoundingRect, BackGroundSprite, FrameBorder, true, Color); base.Draw(canvas); }