Fix parallax size (#800)

* Non-fullscreen ParallaxComponent

* Updated examples with no size needed

* Formatting

* Add docs for fullscreen parallax

* Fix formatting

* Remove need of nullable size

* Add basic parallax sizing test

* Fix formatting

* Remove unused imports

* Info text for the parallax examples
This commit is contained in:
Lukas Klingsbo
2021-05-20 16:58:49 +02:00
committed by GitHub
parent bc5decd193
commit 8f7c773f82
12 changed files with 141 additions and 34 deletions

View File

@ -6,6 +6,7 @@ import 'advanced.dart';
import 'basic.dart';
import 'component.dart';
import 'no_fcs.dart';
import 'small_parallax.dart';
void addParallaxStories(Dashbook dashbook) {
dashbook.storiesOf('Parallax')
@ -13,20 +14,33 @@ void addParallaxStories(Dashbook dashbook) {
'Basic',
(_) => GameWidget(game: BasicParallaxGame()),
codeLink: baseLink('parallax/basic.dart'),
info: 'Shows the simplest way to use a fullscreen ParallaxComponent',
)
..add(
'Component',
(_) => GameWidget(game: ComponentParallaxGame()),
codeLink: baseLink('parallax/component.dart'),
info: 'Shows how to do initiation and loading of assets from within an '
'extended ParallaxComponent',
)
..add(
'Non-fullscreen',
(_) => GameWidget(game: SmallParallaxGame()),
codeLink: baseLink('parallax/small_parallax.dart'),
info: 'Shows how to create a smaller parallax in the center of the '
'screen',
)
..add(
'No FCS',
(_) => GameWidget(game: NoFCSParallaxGame()),
codeLink: baseLink('parallax/no_fcs.dart'),
info: "Shows how to use the parallax without Flame's component system",
)
..add(
'Advanced',
(_) => GameWidget(game: AdvancedParallaxGame()),
codeLink: baseLink('parallax/advanced.dart'),
info: 'Shows how to create a parallax with different velocity deltas on '
'each layer',
);
}