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

21 lines
425 B
Dart

import 'dart:ui';
import 'package:flame/components.dart';
class Square extends PositionComponent {
final Paint _paint;
Square(this._paint, Vector2 position, {double angle = 0.0}) {
size = Vector2.all(100.0);
this.position = position;
this.angle = angle;
anchor = Anchor.center;
}
@override
void render(Canvas canvas) {
super.render(canvas);
canvas.drawRect(size.toRect(), _paint);
}
}