renderRect method
Same as render, but takes both the position and the size as a single Rect.
Note: only use this if you are already using Rect's to represent
both the position and dimension of your Sprite. If you are using
Vector2
s, prefer the other method.
Implementation
void renderRect(
Canvas canvas,
Rect rect, {
Paint? overridePaint,
}) {
render(
canvas,
position: rect.topLeft.toVector2(),
size: rect.size.toVector2(),
overridePaint: overridePaint,
);
}