Event Behaviors ⌨¶
The flame_behaviors
package also provides event behaviors. These behaviors are a layer over the
existing Flame event mixins for components. These behaviors will trigger when the user interacts
with their parent entity. So these events are always relative to the parent entity.
TappableBehavior¶
The TappableBehavior
allows developers to use the tap events from Flame on
their entities.
class MyTappableBehavior extends TappableBehavior<MyEntity> {
@override
void onTapDown(TapDownEvent event) {
// Do something on tap down update event.
}
}
DraggableBehavior¶
The DraggableBehavior
allows developers to use the drag events from Flame on
their entities.
class MyDraggableBehavior extends DraggableBehavior<MyEntity> {
@override
void onDragUpdate(DragUpdateEvent event) {
// Do something on drag update event.
}
}
The content on this page is licensed under the CC BY 4.0 License,
and code samples under the MIT License.