feat: Add HueEffect and HueDecorator#3852
feat: Add HueEffect and HueDecorator#3852s1r1m1r1 wants to merge 7 commits intoflame-engine:mainfrom
Conversation
…orrectly handle prefixes and different asset types. [flame-engine#3844]
Prepared all packages to be released to pub.dev Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
spydon
left a comment
There was a problem hiding this comment.
Docs and examples are missing, other than that it looks good!
|
This should be a general comment on decorators in the docs, if it's not already in there. |
doc/flame/examples/lib/main.dart
Outdated
| 'decorator_rotate3d': DecoratorRotate3DGame.new, | ||
| 'decorator_shadow3d': DecoratorShadowGame.new, | ||
| 'decorator_tint': DecoratorTintGame.new, | ||
| 'decorator_hue': HueDecoratorGame.new, |
| In this example we show how the `HueEffect` can be used. | ||
| Ember will shift its hue over time. |
There was a problem hiding this comment.
| In this example we show how the `HueEffect` can be used. | |
| Ember will shift its hue over time. | |
| In this example we show how the `HueEffect` can be used. | |
| Ember will shift its hue over time. |
| Future<void> onLoad() async { | ||
| add( | ||
| Ember( | ||
| position: Vector2(size.x / 2, size.y / 2), |
There was a problem hiding this comment.
| position: Vector2(size.x / 2, size.y / 2), | |
| position: size / 2, |
| In this example we show how the `HueDecorator` can be used. | ||
| Click anywhere to cycle through different hue shifts on Ember. |
There was a problem hiding this comment.
| In this example we show how the `HueDecorator` can be used. | |
| Click anywhere to cycle through different hue shifts on Ember. | |
| In this example we show how the `HueDecorator` can be used. | |
| Click anywhere to cycle through different hue shifts on Ember. |
| @override | ||
| Future<void> onLoad() async { | ||
| add( | ||
| ember = Ember( |
There was a problem hiding this comment.
It would be good to use nested components in this example to show when a decorator can be used when an effect doesn't work.
| @@ -1,13 +1,17 @@ | |||
| # Decorators | |||
| ## Performance Warning: Decorators vs Effects | |||
There was a problem hiding this comment.
The main section should still be Decorators and have a description about what decorators are, it shouldn't start with a warning before the user knows what they are reading about.
| ..add( | ||
| 'Hue Decorator', |
There was a problem hiding this comment.
We should probably add a new section called decorators, since we're missing examples for the rest of the decorators.
| /// a component and requires that the component implement [PaintProvider]. | ||
| class HueEffect extends Effect with EffectTarget<PaintProvider> { | ||
| HueEffect( | ||
| this.angle, |
There was a problem hiding this comment.
This will need both a To and a By effect, similar to MoveToEffect and MoveByEffect.
…r hue manipulation.
Description
This PR adds a new
HueEffect
to the Flame effects library. This effect allows animating the hue shift of a component's paint over time.
Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues