Files
Lukas Klingsbo f4ac1ec63a feat: The FunctionEffect, run any function as an Effect (#3537)
The `FunctionEffect` is super simple, but very powerful.
It makes it possible to run any function over time as an effect without
having to create a new effect.
This is very useful when for example doing state changes over time.
2025-03-25 10:32:43 +01:00

92 lines
3.5 KiB
Dart

import 'package:dashbook/dashbook.dart';
import 'package:examples/commons/commons.dart';
import 'package:examples/stories/effects/color_effect_example.dart';
import 'package:examples/stories/effects/dual_effect_removal_example.dart';
import 'package:examples/stories/effects/effect_controllers_example.dart';
import 'package:examples/stories/effects/function_effect_example.dart';
import 'package:examples/stories/effects/move_effect_example.dart';
import 'package:examples/stories/effects/opacity_effect_example.dart';
import 'package:examples/stories/effects/remove_effect_example.dart';
import 'package:examples/stories/effects/rotate_around_effect_example.dart';
import 'package:examples/stories/effects/rotate_effect_example.dart';
import 'package:examples/stories/effects/scale_effect_example.dart';
import 'package:examples/stories/effects/sequence_effect_example.dart';
import 'package:examples/stories/effects/size_effect_example.dart';
import 'package:flame/game.dart';
void addEffectsStories(Dashbook dashbook) {
dashbook.storiesOf('Effects')
..add(
'Move Effect',
(_) => GameWidget(game: MoveEffectExample()),
codeLink: baseLink('effects/move_effect_example.dart'),
info: MoveEffectExample.description,
)
..add(
'Dual Effect Removal',
(_) => GameWidget(game: DualEffectRemovalExample()),
codeLink: baseLink('effects/dual_effect_removal_example.dart'),
info: DualEffectRemovalExample.description,
)
..add(
'Rotate Effect',
(_) => GameWidget(game: RotateEffectExample()),
codeLink: baseLink('effects/rotate_effect_example.dart'),
info: RotateEffectExample.description,
)
..add(
'Rotate Around Effect',
(_) => GameWidget(game: RotateAroundEffectExample()),
codeLink: baseLink('effects/rotate_around_effect_example.dart'),
info: RotateAroundEffectExample.description,
)
..add(
'Size Effect',
(_) => GameWidget(game: SizeEffectExample()),
codeLink: baseLink('effects/size_effect_example.dart'),
info: SizeEffectExample.description,
)
..add(
'Scale Effect',
(_) => GameWidget(game: ScaleEffectExample()),
codeLink: baseLink('effects/scale_effect_example.dart'),
info: ScaleEffectExample.description,
)
..add(
'Opacity Effect',
(_) => GameWidget(game: OpacityEffectExample()),
codeLink: baseLink('effects/opacity_effect_example.dart'),
info: OpacityEffectExample.description,
)
..add(
'Color Effect',
(_) => GameWidget(game: ColorEffectExample()),
codeLink: baseLink('effects/color_effect_example.dart'),
info: ColorEffectExample.description,
)
..add(
'Sequence Effect',
(_) => GameWidget(game: SequenceEffectExample()),
codeLink: baseLink('effects/sequence_effect_example.dart'),
info: SequenceEffectExample.description,
)
..add(
'Remove Effect',
(_) => GameWidget(game: RemoveEffectExample()),
codeLink: baseLink('effects/remove_effect_example.dart'),
info: RemoveEffectExample.description,
)
..add(
'Function Effect',
(_) => GameWidget(game: FunctionEffectExample()),
codeLink: baseLink('effects/function_effect_example.dart'),
info: FunctionEffectExample.description,
)
..add(
'EffectControllers',
(_) => GameWidget(game: EffectControllersExample()),
codeLink: baseLink('effects/effect_controllers_example.dart'),
info: EffectControllersExample.description,
);
}