render method
void
render(})
inherited
Renders text
on the canvas
at a given position
.
For example, if Anchor.center is specified, it's going to be drawn
centered around position
.
Implementation
@override
void render(
Canvas canvas,
String text,
Vector2 position, {
Anchor anchor = Anchor.topLeft,
}) {
final txt = formatter.format(text);
final box = txt.metrics;
txt.translate(
position.x - box.width * anchor.x,
position.y - box.height * anchor.y - box.top,
);
txt.render(canvas);
}