rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 262 forks source link

How to only interact with child of sizer in scrollable panel? #433

Closed ngodinhdai286 closed 1 month ago

ngodinhdai286 commented 5 months ago

I create a scrollable panel with the code below, but I can not find way to only interact with the child of the sizer (here is the button), please help me

code

rexrainbow commented 5 months ago

Sorry for missing this issue. Here is the solution of interactive with children of scrollable panel. The easy way is to set scene.input.topOnly to false.

rexrainbow commented 5 months ago

Or, disable scroller by adding

{
    // ...
    scroller: false
}

in config parameter of creating scrollablepanel

ngodinhdai286 commented 5 months ago

Thanks for replying me rex, but I am still stuck in that issue. The situation is I just want to be able to click in the red marked button in the picture image

rexrainbow commented 5 months ago

Here is a test case, interactive logic is at line 49-62.