mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
18 lines
319 B
Dart
18 lines
319 B
Dart
import 'package:flame/components/component.dart';
|
|
|
|
import 'dart:ui';
|
|
|
|
class Square extends PositionComponent {
|
|
static final _paint = Paint()..color = const Color(0xFFFFFFFF);
|
|
|
|
Square() {
|
|
width = 100;
|
|
height = 100;
|
|
}
|
|
|
|
@override
|
|
void render(Canvas canvas) {
|
|
canvas.drawRect(toRect(), _paint);
|
|
}
|
|
}
|