mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
22 lines
388 B
Dart
22 lines
388 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,
|
|
int? priority,
|
|
}) : super(position: position, size: size, priority: priority);
|
|
|
|
@override
|
|
void render(Canvas canvas) {
|
|
svg.render(canvas, size);
|
|
}
|
|
}
|