Stop event propagation on a button

Got a question? Need help? Post here!

Stop event propagation on a button

Postby tet2brick » Thu Feb 13, 2014 5:35 am

Hi,

Is it possible to stop the event propagation on a button?

I have some buttons overlaping one another and I don't want to activate the bottom button when I click on the top one.

Thanks!
tet2brick
Corporal
 
Posts: 19
Joined: Thu Jun 13, 2013 1:42 am

Re: Stop event propagation on a button

Postby Arkeus » Thu Feb 13, 2014 7:04 pm

Unfortunately axel doesn't support this well as there's not really an event system. I think the course I'd take is have the top button set a flag on the bottom button when you're hovering it, and the bottom one won't activate while that flag is set. Alternatively, clicking a button adds it to a queue of click events, and at the end of the frame, you only take the last one (the top most) and execute it.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Stop event propagation on a button

Postby tet2brick » Mon Feb 17, 2014 7:06 am

I used a flag when hover the first button, it worked perfectly :)

Thanks!
tet2brick
Corporal
 
Posts: 19
Joined: Thu Jun 13, 2013 1:42 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron