Canvas event handling: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (local coordinates...)
No edit summary
Line 7: Line 7:


Listeners - simple Nasal functions - can be attached to every element inside the Canvas and the Canvas itself. Once a certain action - like moving the mouse or pressing a button - occurs the associated listeners are called. We can use this for example to detect whether the mouse has moved over an element or if a certain element has been clicked.
Listeners - simple Nasal functions - can be attached to every element inside the Canvas and the Canvas itself. Once a certain action - like moving the mouse or pressing a button - occurs the associated listeners are called. We can use this for example to detect whether the mouse has moved over an element or if a certain element has been clicked.
{{Note|{{FGCquote
  |Just keep in mind that there will be no support for mouseover/hover events.<br/>
Mouse clicks/wheel/drag work, but there is no support for mouse move in PUI/XML (CanvasWidget).
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=213533#p213533
    |title=<nowiki>Re: Using a PUI CanvasWidget as a Canvas.Window ?</nowiki>
    |author=<nowiki>TheTom</nowiki>
    |date=<nowiki>Thu Jun 26</nowiki>
  }}
}}
}}


= Listen for events =
= Listen for events =

Navigation menu