Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Updated docs for gesture detector lifecycle #2650

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions doc/flame/inputs/drag_events.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Drag Events

```{note}
This document describes the new drag events API. The old (legacy) approach,
which is still supported, is described in [](gesture_input.md).
This document describes the new drag events API. It is important to note that
when the first draggable component is added to the game, `FlameGame` must
temporarily remove itself and run the `GestureDetectorBuilder` which will add a
gesture detector as the first child to `FlameGame`, and then re-add itelf. As
such, `FlameGame`'s `onRemove` event will be triggered. A simple boolean flag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these probably should be two notes, or it's own section, now the next is in the middle of the previous note and reads a bit strange.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but thought two notes at the top looked weird. I was wanting to ride on the note about the new API, but I can put it down below.

can be used to ignore this event if your game is using the `onRemove` event.
The old (legacy) approach, which is still supported, is described in [](gesture_input.md).
```

**Drag events** occur when the user moves their finger across the screen of the device, or when they
Expand Down
9 changes: 7 additions & 2 deletions doc/flame/inputs/tap_events.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Tap Events

```{note}
This document describes the new tap events API. The old (legacy) approach,
which is still supported, is described in [](gesture_input.md).
This document describes the new tap events API. It is important to note that
when the first tappable component is added to the game, `FlameGame` must
temporarily remove itself and run the `GestureDetectorBuilder` which will add a
gesture detector as the first child to `FlameGame`, and then re-add itself. As
such, `FlameGame`'s `onRemove` event will be triggered. A simple boolean flag
can be used to ignore this event if your game is using the `onRemove` event.
The old (legacy) approach, which is still supported, is described in [](gesture_input.md).
```

**Tap events** are one of the most basic methods of interaction with a Flame game. These events
Expand Down