renderSpriteByRadAngle function
void
renderSpriteByRadAngle(})
Implementation
void renderSpriteByRadAngle(
Canvas canvas,
double radAngle,
Rect position,
Sprite sprite, {
Paint? overridePaint,
}) {
canvas.save();
canvas.translate(position.center.dx, position.center.dy);
canvas.rotate(radAngle == 0.0 ? 0.0 : radAngle + (pi / 2));
canvas.translate(-position.center.dx, -position.center.dy);
sprite.render(
canvas,
position: position.positionVector2,
size: position.sizeVector2,
overridePaint: overridePaint,
);
canvas.restore();
}