mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
Properly propagate onMount and onRemove to children (#579)
* Fix rendering of children * Game loop handles other restore * Properly propagate onMount and onRemove to children * Use BaseGame on gestures to minimize confusion * Fix linting * All children don't need preparation * Add composability example * gameRef might not be defined * Add mustCallSuper * isMounted on game * Remove unused gameRef argument * Made isMounted only modifiable by the component * Move dartdoc to public isMounted * Fix formatting
This commit is contained in:
@ -48,6 +48,7 @@ class Square extends PositionComponent with HasGameRef<MyGame> {
|
||||
|
||||
@override
|
||||
void onMount() {
|
||||
super.onMount();
|
||||
size = Vector2.all(gameRef.squareSize);
|
||||
anchor = Anchor.center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user