fuse library

Implement function-based behavior composition in Flame.

See Fuse for usage details.

Mixins

Fuse
Adds a fuse method to a Flame component. While inside this method, behavior may be composed by calling any number of fuse* functions.
FuseCollisions
Mixin that enables the usage of collision fuses:
FuseDoubleTaps
Mixin that enables the usage of double-tap fuses:
FuseHovers
Mixin that enables the usage of hover fuses:
FuseKeys
Mixin that enables the usage of key fuses:
FusePointers
Mixin that enables the usage of pointer fuses:
FuseTaps
Mixin that enables the usage of tap fuses:

Functions

fuseCamera() → CameraComponent
Returns the current Flame game's camera.
fuseCollision<C extends PositionComponent>(FuseCollisionFn<C> fn) → void
Calls fn when this component is colliding with another component of type C.
fuseCollisionEnd<C extends PositionComponent>(FuseCollisionEndFn<C> fn) → void
fuseCollisionPoints<C extends PositionComponent>(FuseCollisionPointsFn<C> fn) → void
Calls fn when this component is colliding with another component of type C.
fuseCollisionStart<C extends PositionComponent>(FuseCollisionFn<C> fn) → void
Calls fn when this component collides with another component of type C.
fuseCollisionStartPoints<C extends PositionComponent>(FuseCollisionPointsFn<C> fn) → void
Calls fn when this component collides with another component of type C.
fuseComponent<C extends Fuse>() → C
Returns the current Flame component.
fuseDoubleTapCancel(FuseDoubleTapCancelFn fn) → void
Calls fn when a double-tap cancel event occurs.
fuseDoubleTapDown(FuseDoubleTapDownFn fn) → void
Calls fn when a double-tap down event occurs.
fuseDoubleTapUp(FuseDoubleTapFn fn) → void
Calls fn when a double-tap up event occurs.
fuseGame<G extends FlameGame<World>>() → G
Returns the current Flame game.
fuseHoverEnter(FuseHoverEnterFn fn) → void
Calls fn when hover enters this component.
fuseHoverExit(FuseHoverExitFn fn) → void
Calls fn when hover exits this component.
fuseHoverUpdate(FuseHoverUpdateFn fn) → void
Calls fn while hovering over this component.
fuseKeyEvent(FuseKeyEventFn fn) → void
Calls function fn when a key event occurs.
fuseLongTapDown(FuseLongTapDownFn fn) → void
Calls fn when a long tap down event occurs.
fusePointerMove(FusePointerMoveFn fn) → void
Calls fn when the pointer moves.
fusePointerMoveStop(FusePointerMoveStopFn fn) → void
Calls fn when the pointer stops.
fuseRemove(FuseRemoveFn fn) → void
Calls function fn when the current Flame component is removed.
fuseResize(FuseResizeFn fn) → void
Calls function fn when the current Flame game is resized.
fuseTapCancel(FuseTapCancelFn fn) → void
Calls fn when a tap cancel event occurs.
fuseTapDown(FuseTapDownFn fn) → void
Calls fn when a tap down event occurs.
fuseTapUp(FuseTapUpFn fn) → void
Calls fn when a tap up event occurs.
fuseTimer(double limit, FuseTimerFn fn, {bool repeat = false, bool autoStart = true}) → Timer
Adds a Flame Timer to a Fuse component.
fuseUpdate(FuseUpdateFn fn) → void
Calls function fn on every Flame game update.
fuseWorld() → World
Returns the current Flame game's world.

Typedefs

FuseCollisionEndFn<C extends PositionComponent> = void Function(C other)
FuseCollisionFn<C extends PositionComponent> = void Function(C other)
FuseCollisionPointsFn<C extends PositionComponent> = void Function(C other, Set<Vector2> points)
FuseDoubleTapCancelFn = void Function(DoubleTapCancelEvent event)
FuseDoubleTapDownFn = void Function(DoubleTapDownEvent event)
FuseDoubleTapFn = void Function(DoubleTapEvent event)
FuseHoverEnterFn = dynamic Function()
FuseHoverExitFn = dynamic Function()
FuseHoverUpdateFn = dynamic Function(double dt)
FuseKeyEventFn = bool? Function(KeyEvent event, Set<LogicalKeyboardKey> keysPressed)
FuseLongTapDownFn = void Function(TapDownEvent event)
FusePointerMoveFn = dynamic Function(PointerMoveEvent event)
FusePointerMoveStopFn = dynamic Function(PointerMoveEvent event)
FuseRemoveFn = dynamic Function()
FuseResizeFn = dynamic Function(Vector2 size)
FuseTapCancelFn = void Function(TapCancelEvent event)
FuseTapDownFn = void Function(TapDownEvent event)
FuseTapUpFn = void Function(TapUpEvent event)
FuseTimerFn = void Function()
FuseUpdateFn = dynamic Function(double dt)