From 9890ad73ed428c7798afc86c26fa0a963f48e925 Mon Sep 17 00:00:00 2001 From: Jochum van der Ploeg Date: Sun, 17 Jan 2021 15:17:15 +0100 Subject: [PATCH] Updated the widgets docs (#628) Co-authored-by: Erick --- CHANGELOG.md | 1 + doc/examples/widgets/lib/main.dart | 2 +- doc/widgets.md | 17 ++++++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52c7c3a2..a6f4cb940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/doc/examples/widgets/lib/main.dart b/doc/examples/widgets/lib/main.dart index e0fa3a1ff..8adf16afb 100644 --- a/doc/examples/widgets/lib/main.dart +++ b/doc/examples/widgets/lib/main.dart @@ -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), diff --git a/doc/widgets.md b/doc/widgets.md index 106b52adc..1d87f2e2a 100644 --- a/doc/widgets.md +++ b/doc/widgets.md @@ -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, +) ```