Skip to content

Commit

Permalink
change the flalert recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Jan 30, 2024
1 parent 40658b4 commit d2fa522
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/touchpriority.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Touch Priority

You probably had this issue of "Why does my button not wowrk?" whenever you added a button into a popup before. If not, consider yourself lucky. This tutorial will cover how Geometry Dash handles touch priority, and how you should use it.
You probably had this issue of "Why does my button not work?" whenever you added a button into a popup before. If not, consider yourself lucky. This tutorial will cover how Geometry Dash handles touch priority, and how you should use it.

## What is touch priority?

Expand Down Expand Up @@ -34,6 +34,6 @@ If your popup subclasses `geode::Popup<>`, the registering and unregistering is

If you're adding new touch layers after the initiation has been done, you can again call `geode::cocos::handleTouchPriority` for redoing the touch priorities for the new layers.

If you're not using `geode::Popup<>` class and directly subclassing `FLAlertLayer` instead, you should call `CCTouchDispatcher::registerForcePrio` inside your init. The `FLAlertLayer::registerWithTouchDispatcher` handles the delegate, and `~FLAlertLayer` handles unregistering of the force priority.
If you're not using `geode::Popup<>` class and directly subclassing `FLAlertLayer` instead, you should call `FLAlertLayer::int(int opacity)` inside your init. This will handle the registering of the force priority, along with creating the `m_mainLayer`. The `FLAlertLayer::registerWithTouchDispatcher` handles the delegate, and `~FLAlertLayer` handles unregistering of the force priority.

If you don't want to use the geode utility and set the priorities manually, you can call `CCLayer::setTouchPriority`/`CCMenu::setHandlerPriority` on your layer with the `CCTouchDispatcher::getTargetPrio` value.

0 comments on commit d2fa522

Please sign in to comment.