getPositionRect method
Implementation
Rect getPositionRect() {
switch (alignment) {
case GameObjectAlignment.center:
return Rect.fromPoints(position.toOffset - (size.toOffset / 2.0),
position.toOffset + (size.toOffset / 2.0));
case GameObjectAlignment.topLeft:
return Rect.fromPoints(
position.toOffset, position.toOffset + size.toOffset);
}
}