prepare method

  1. @override
void prepare(
  1. Component parent
)
override

Prepares the Component to be added to a parent, and if there is an ancestor that is a FlameGame that game will do necessary preparations for this component. If there are no parents that are a Game false will be returned and this will run again once an ancestor or the component itself is added to a Game.

Implementation

@override
void prepare(Component parent) {
  super.prepare(parent);
  debugMode |= parent.debugMode;
  isPrepared = true;
  if (hasGameRef) {
    onGameResize(gameRef.size);
  }
}