drawStringXY method

  1. @override
void drawStringXY(
  1. num x,
  2. num y,
  3. String s,
  4. Color3i color,
)

Draw a string.

Implementation

@override
void drawStringXY(num x, num y, String s, Color3i color) {
  var textPainter = TextPainter(
    text: TextSpan(
      text: s,
      style: TextStyle(
        color: Color.fromARGB(255, color.r, color.g, color.b),
      ),
    ),
    textDirection: TextDirection.ltr,
  );
  textPainter.layout();
  textPainter.paint(canvas, Offset(x.toDouble(), y.toDouble()));
}