mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-29 16:05:47 +08:00
* Simplified the usage of ShapeComponent * Default constructor for _RandomCircle * Use default constructor * Forced Anchor.center on ShapeComponent * Fix examples using SquareComponent * Removed unnecesary import * Renamed edgeLength to size
19 lines
415 B
Dart
19 lines
415 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flame/components.dart';
|
|
import 'package:flame/effects.dart';
|
|
|
|
class SquareComponent extends RectangleComponent with EffectsHelper {
|
|
SquareComponent({
|
|
Vector2? position,
|
|
double size = 100.0,
|
|
Paint? paint,
|
|
int priority = 0,
|
|
}) : super(
|
|
Vector2.all(size),
|
|
position: position,
|
|
paint: paint,
|
|
priority: priority,
|
|
);
|
|
}
|