screenPosition method

Vector2 screenPosition()

Return screen position of this component.

Implementation

Vector2 screenPosition() {
  if (hasGameRef) {
    return gameRef.camera.worldToScreen(
      position,
    );
  }
  return Vector2.zero();
}