isVisible property
Param checks if this component is visible on the screen
Implementation
@override
bool get isVisible {
if (!hasGameRef) return false;
if (!gameRef.hasLayout) return false;
if (lightingConfig == null) return super.isVisible;
Rect rectLight = Rect.fromLTWH(
this.position.rect.center.dx -
(lightingConfig!.radius + lightingConfig!.blurBorder / 2),
this.position.rect.center.dy -
(lightingConfig!.radius + lightingConfig!.blurBorder / 2),
(lightingConfig!.radius * 2) + lightingConfig!.blurBorder,
(lightingConfig!.radius * 2) + lightingConfig!.blurBorder,
);
return gameRef.camera.isRectOnCamera(rectLight);
}
Param checks if this component is visible on the screen
Implementation
bool isVisible = false;