mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
22 lines
712 B
Dart
22 lines
712 B
Dart
import 'package:dashbook/dashbook.dart';
|
|
import 'package:flame/flame.dart';
|
|
import 'package:flame/widgets.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
final anchorOptions = Anchor.values.map((e) => e.name).toList();
|
|
|
|
Widget spriteWidgetBuilder(DashbookContext ctx) {
|
|
return Container(
|
|
width: ctx.numberProperty('container width', 400),
|
|
height: ctx.numberProperty('container height', 200),
|
|
decoration: BoxDecoration(border: Border.all(color: Colors.amber)),
|
|
child: SpriteWidget(
|
|
sprite: Sprite(Flame.images.fromCache('shield.png')),
|
|
anchor: Anchor.valueOf(
|
|
ctx.listProperty('anchor', 'center', anchorOptions),
|
|
),
|
|
),
|
|
);
|
|
}
|