mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
Adding new text related components and upgrading old components to use the new features like anchor
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flame/components/component.dart';
|
||||
@ -10,7 +9,8 @@ import 'package:ordered_set/ordered_set.dart';
|
||||
/// A component that lets your component be composed by others
|
||||
/// It resembles [BaseGame]. It has an [components] property and an [add] method
|
||||
mixin ComposedComponent on Component {
|
||||
OrderedSet<Component> components = new OrderedSet(Comparing.on((c) => c.priority()));
|
||||
OrderedSet<Component> components =
|
||||
new OrderedSet(Comparing.on((c) => c.priority()));
|
||||
|
||||
@override
|
||||
render(Canvas canvas) {
|
||||
@ -45,4 +45,4 @@ mixin ComposedComponent on Component {
|
||||
|
||||
List<Resizable> children() =>
|
||||
this.components.where((r) => r is Resizable).cast<Resizable>().toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user