mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
* Added FlameAnimationController class * Added MainAnimationController class * Update doc comments * formatting * rename MainAnimationController * Added tests for StandardAnimationController * Added more tests * comment * Added changelog note * Export StandardAnimationController * formatting * Use a default for 'curve' parameter * rename onsetDelay -> startDelay * Added Transofm2DEffect * Added EffectComponent * Added .transform getter * formatting * Rename EffectComponent -> Effect * Add documentation for the Effect class * minor * Added a test for Effect class * Adding tests for removeOnFinish * Adding tests for onStart and onFinish * Also check the effect after reset * Fix-up merge * formatting * added doc-comments * changelog note * Added test for transform2DEffect * Adjusted comments * Make PositionComponent._transform public * change changelog * Adding RotateEffect * wip on rotate2 example * Rename -> RotateEffect2 * export rotation effect * Finish example for RotateEffect2 * formatting * rename RotateEffect2 -> RotateEffect * Changelog note * Added test file * flutter format * Remove a print() call * _lastProgress moved to Transform2DEffect class * remove avoid_print for now * Moved description * Initialize paints during construction * Added a random test * flutter format Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
86 lines
2.5 KiB
Dart
86 lines
2.5 KiB
Dart
import 'package:dashbook/dashbook.dart';
|
|
import 'package:flame/game.dart';
|
|
|
|
import '../../commons/commons.dart';
|
|
import 'color_effect.dart';
|
|
import 'combined_effect.dart';
|
|
import 'infinite_effect.dart';
|
|
import 'move_effect.dart';
|
|
import 'opacity_effect.dart';
|
|
import 'remove_effect_example.dart';
|
|
import 'rotate_effect.dart';
|
|
import 'rotate_effect_example.dart';
|
|
import 'scale_effect.dart';
|
|
import 'sequence_effect.dart';
|
|
import 'size_effect.dart';
|
|
|
|
const scaleInfo = '''
|
|
The `ScaleEffect` scales up the canvas before drawing the components and its
|
|
children.
|
|
In this example you can tap the screen and the component will scale up or down,
|
|
depending on its current state.
|
|
''';
|
|
|
|
void addEffectsStories(Dashbook dashbook) {
|
|
dashbook.storiesOf('Effects')
|
|
..add(
|
|
'Size Effect',
|
|
(_) => GameWidget(game: SizeEffectGame()),
|
|
codeLink: baseLink('effects/size_effect.dart'),
|
|
info: sizeInfo,
|
|
)
|
|
..add(
|
|
'Scale Effect',
|
|
(_) => GameWidget(game: ScaleEffectGame()),
|
|
codeLink: baseLink('effects/scale_effect.dart'),
|
|
info: scaleInfo,
|
|
)
|
|
..add(
|
|
'Move Effect',
|
|
(_) => GameWidget(game: MoveEffectGame()),
|
|
codeLink: baseLink('effects/move_effect.dart'),
|
|
)
|
|
..add(
|
|
'Rotate Effect',
|
|
(_) => GameWidget(game: RotateEffectGame()),
|
|
codeLink: baseLink('effects/rotate_effect.dart'),
|
|
)
|
|
..add(
|
|
'Sequence Effect',
|
|
(_) => GameWidget(game: SequenceEffectGame()),
|
|
codeLink: baseLink('effects/sequence_effect.dart'),
|
|
)
|
|
..add(
|
|
'Combined Effect',
|
|
(_) => GameWidget(game: CombinedEffectGame()),
|
|
codeLink: baseLink('effects/combined_effect.dart'),
|
|
)
|
|
..add(
|
|
'Infinite Effect',
|
|
(_) => GameWidget(game: InfiniteEffectGame()),
|
|
codeLink: baseLink('effects/infinite_effect.dart'),
|
|
)
|
|
..add(
|
|
'Opacity Effect',
|
|
(_) => GameWidget(game: OpacityEffectGame()),
|
|
codeLink: baseLink('effects/opacity_effect.dart'),
|
|
)
|
|
..add(
|
|
'Color Effect',
|
|
(_) => GameWidget(game: ColorEffectGame()),
|
|
codeLink: baseLink('effects/color_effect.dart'),
|
|
)
|
|
..add(
|
|
'Rotate Effect (v2)',
|
|
(_) => GameWidget(game: RotateEffectExample()),
|
|
codeLink: baseLink('effects/rotate_effect_example.dart'),
|
|
info: RotateEffectExample.description,
|
|
)
|
|
..add(
|
|
'Remove Effect',
|
|
(_) => GameWidget(game: RemoveEffectExample()),
|
|
codeLink: baseLink('effects/remove_effect_example.dart'),
|
|
info: RemoveEffectExample.description,
|
|
);
|
|
}
|