onGameResize method

  1. @mustCallSuper
  2. @override
void onGameResize(
  1. Vector2 size
)
override

It receives the new game size. Executed right after the component is attached to a game and right before onLoad is called.

Implementation

@mustCallSuper
@override
void onGameResize(Vector2 size) {
  super.onGameResize(size);
  if (!isFullscreen) {
    return;
  }
  final newSize = gameRef.camera.viewport.effectiveSize;
  this.size.setFrom(newSize);
  parallax?.resize(newSize);
}