Updated the widgets docs (#628)

Co-authored-by: Erick <erickzanardoo@gmail.com>
This commit is contained in:
Jochum van der Ploeg
2021-01-17 15:17:15 +01:00
committed by GitHub
parent 11d93c23b2
commit 9890ad73ed
3 changed files with 10 additions and 10 deletions

View File

@ -12,6 +12,7 @@
- Adding shortcut for loading Sprites and SpriteAnimation from the global cache
- Adding loading methods for the different `ParallaxComponent` parts and refactor how the delta velocity works
- Add tests for `Timer` and fix a bug where `progress` was not reported correctly
- Updated the `widgets.md` documentation
## 1.0.0-rc5
- Option for overlays to be already visible on the GameWidget

View File

@ -125,7 +125,7 @@ void main() async {
to: 3,
loop: true,
);
dashbook.storiesOf('AnimationWidget').decorator(CenterDecorator()).add(
dashbook.storiesOf('SpriteAnimationWidget').decorator(CenterDecorator()).add(
'default',
(ctx) => Container(
width: ctx.numberProperty('container width', 400),

View File

@ -1,6 +1,6 @@
# Widgets
One cool feature when developing games with Flutter is the ability to use Flutter's extensive toolset for building UIs, Flame tries to expand that introducing widgets which are specially made with games in mind.
One cool feature when developing games with Flutter is the ability to use Flutter's extensive toolset for building UIs, Flame tries to expand on that by introducing widgets that are made with games in mind.
Here you can find all the available widgets provided by Flame.
@ -57,21 +57,20 @@ How to use it:
```dart
SpriteWidget(
sprite: shieldSprite,
center: true,
),
anchor: Anchor.center,
)
```
## AnimationWidget
## SpriteAnimationWidget
`AnimationWidget` is a widget used to display [Animations](https://github.com/flame-engine/flame/blob/master/lib/animation.dart) inside a widget tree.
`SpriteAnimationWidget` is a widget used to display [SpriteAnimations](https://github.com/flame-engine/flame/blob/master/lib/sprite_animation.dart) inside a widget tree.
How to use it:
```dart
AnimationWidget(
SpriteAnimationWidget(
animation: _animation,
playing: true,
center: true,
),
anchor: Anchor.center,
)
```