mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
Possibility to change priority and reorder the component list (#793)
* Possibility to change component priority * Fix formatting * Posibility to change priority * Docs for priority change * Priority example * Add section explaining priority * Update doc/game.md Co-authored-by: Erick <erickzanardoo@gmail.com> * Update examples/lib/stories/components/components.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * No null priorities in the super call chain * Possibility to wait for all children to be loaded * Test for addChildren * Introduce parent to Component * Check whether parent is BaseComponent Co-authored-by: Erick <erickzanardoo@gmail.com>
This commit is contained in:
@ -6,7 +6,11 @@ import 'package:flame/palette.dart';
|
||||
class SquareComponent extends PositionComponent {
|
||||
Paint paint = BasicPalette.white.paint();
|
||||
|
||||
SquareComponent() : super(size: Vector2.all(100.0));
|
||||
SquareComponent({int priority = 0})
|
||||
: super(
|
||||
size: Vector2.all(100.0),
|
||||
priority: priority,
|
||||
);
|
||||
|
||||
@override
|
||||
void render(Canvas c) {
|
||||
|
||||
Reference in New Issue
Block a user