mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 00:17:20 +08:00
feat: Adding paint attribute to SpriteWidget and SpriteAnimationWidget (#3298)
Adds a `Paint` attribute to the `SpriteWidget` and `SpriteAnimationWidget` for an improved API. --------- Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'package:dashbook/dashbook.dart';
|
||||
import 'package:examples/stories/widgets/paints.dart';
|
||||
import 'package:flame/extensions.dart';
|
||||
import 'package:flame/widgets.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@ -20,6 +21,13 @@ Widget spriteAnimationWidgetBuilder(DashbookContext ctx) {
|
||||
anchor: Anchor.valueOf(
|
||||
ctx.listProperty('anchor', 'center', anchorOptions),
|
||||
),
|
||||
paint: paintList[paintChoices.indexOf(
|
||||
ctx.listProperty(
|
||||
'paint',
|
||||
'none',
|
||||
paintChoices,
|
||||
),
|
||||
)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user