mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
* Add priority to all component constructors * Remove SvgComponent priority but add TODO * Fix formatting * Remove leftover default
26 lines
507 B
Dart
26 lines
507 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flame/components.dart';
|
|
|
|
import './svg.dart';
|
|
|
|
class SvgComponent extends PositionComponent {
|
|
Svg svg;
|
|
|
|
SvgComponent.fromSvg(
|
|
this.svg, {
|
|
Vector2? position,
|
|
Vector2? size,
|
|
}) : super(position: position, size: size);
|
|
|
|
/// TODO(spydon): Once rc12 is released
|
|
// int? priority,
|
|
//}) : super(position: position, size: size, priority: priority);
|
|
|
|
@override
|
|
void render(Canvas canvas) {
|
|
super.render(canvas);
|
|
svg.render(canvas, size);
|
|
}
|
|
}
|