Jump to content

How to add mouse wheel callback only for specific sprite/group?


loover
 Share

Recommended Posts

Scrolling it. I have a two "screens" (group with sprites). Like a list with many items. Some items are hidden and scrolling using for reveal they. Need to achieve the scrolling if user use scroll wheel in any place on the screen.

But if first screen is hidden (alpha = 0, x = -10000, for example) and user try to scrolling the another one - list on the first screen scrollied also.

Link to comment
Share on other sites

You can add the screens/list to some array, then iterate trough that array to check if some condition is met when the mouseWheelCallback is executed:

The example can also check if mouse is hovering over some list, see commented code inside scroll().

Link to comment
Share on other sites

  • 1 year later...

Hi Loover, can you explain how you did it? I have used mousewheelcallback on input over of each sprites. But it is still working on input out. I have added function in input out to remove input over events. Still its catching mousewheelcallback. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...