top | item 19770301

(no title)

Larowyn | 6 years ago

That's not how it would go, you don't need state to handle different events, in the case you describe the button is not clicked, of course the button would not trigger on anything else than a mouseup that would be incredibly dumb. It will go something like this: - The mouse is on top of the button, you could render your button differently with that information. - The mousdown event trigger on top of the button again you can do something to make the button render differently. - If the mouseup event occur the button trigger. Instead of keeping a state on your button you render your uis elements conditionned on the cursor position and state of the mouse (up or down)

discuss

order

No comments yet.