mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 04:18:25 +08:00
Migrate examples back, change to monorepo (#701)
This commit is contained in:
18
examples/lib/commons/square_component.dart
Normal file
18
examples/lib/commons/square_component.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flame/components.dart';
|
||||
import 'package:flame/palette.dart';
|
||||
|
||||
class SquareComponent extends PositionComponent {
|
||||
Paint paint = BasicPalette.white.paint;
|
||||
|
||||
SquareComponent() {
|
||||
size = Vector2.all(100.0);
|
||||
}
|
||||
|
||||
@override
|
||||
void render(Canvas c) {
|
||||
super.render(c);
|
||||
c.drawRect(size.toRect(), paint);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user