Adding new text related components and upgrading old components to use the new features like anchor

This commit is contained in:
Luan Nico
2019-01-01 22:48:08 -02:00
parent 307e375378
commit 8dacfc90a6
8 changed files with 239 additions and 78 deletions

View File

@ -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();
}
}