Files
Renan ccee9a466b Move files to src and comply with the dart package layout convention (#621)
* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631)

* Move files to src and comply with the dart package layout convention

* Fixing widgets example

Co-authored-by: Serge Matveenko <lig@countzero.co>
Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
2021-01-20 09:05:43 -03:00

19 lines
362 B
Dart

import 'package:flame/components.dart';
import 'dart:ui';
class Square extends PositionComponent {
static final _paint = Paint()..color = const Color(0xFFFFFFFF);
Square() {
size = Vector2.all(100);
anchor = Anchor.center;
}
@override
void render(Canvas canvas) {
super.render(canvas);
canvas.drawRect(size.toRect(), _paint);
}
}