P.OnCursorEntered
From GMod Wiki
Revision as of 23:27, 18 September 2009 by Unrealomega (Talk | contribs)
Event Hook | |
Hook Name | OnCursorEntered |
Syntax | PANEL:OnCursorEntered( ) |
Description | This is called whenever the mouse enters the rectangular area of the control. |
Returns | Nil |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=P.OnCursorEntered]P.OnCursorEntered [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | N/A | ||
---|---|---|---|
Used on | |||
Code |
| ||
Output | N/A |
Additional Notes
- All panels are rectangular. The screen space of a panel is between xpos and xpos+width-1 on the x axis, and between ypos and ypos+height-1 on the y axis. Whether or not the cursor is hovering above a panel depends on if the cursor's hotspot (the point where clicks occur - the tip of the arrow for example) is in the panel's screenspace.
- Panels that exist but are invisible (panel:SetVisible(false)) do not respond to any mouse events.
- When a cursor "enters" the panel, it means the cursor is now directly above the panel. That is to say, if another panel is between the cursor and this panel, the cursor "enters" that panel instead.
- The cursor can only hover one panel at a time. Whenever a panel is entered by the cursor, the cursor exits from the previous panel it was hovering.
- If a panel suddenly appears beneath the cursor (new panel created, invisible panel becomes visible, existing panel moves beneath the cursor) then the cursor enters that panel.
See Also
- N/A