attach method

void attach(
  1. PipelineOwner owner,
  2. GameRenderBox gameRenderBox
)
inherited

Marks game as attached to any Flutter widget tree.

Should not be called manually.

Implementation

void attach(PipelineOwner owner, GameRenderBox gameRenderBox) {
  if (isAttached) {
    throw UnsupportedError(
      '''
    Game attachment error:
    A game instance can only be attached to one widget at a time.
    ''',
    );
  }
  _gameRenderBox = gameRenderBox;
  onAttach();
}