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,6 +1,7 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:dashbook/dashbook.dart';
|
||||
import 'package:examples/stories/widgets/paints.dart';
|
||||
import 'package:flame/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@ -17,6 +18,13 @@ Widget spriteWidgetBuilder(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