OnMarkerHit: Difference between revisions
Jump to navigation
Jump to search
m (→Parameters) |
m (→Parameters) |
||
Line 8: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''hitElement''': | *'''hitElement''': the [[element]] that hit the [[marker]]. | ||
*'''matchingDimension''': | *'''matchingDimension''': a [[boolean]] representing whether the [[element]] is in the same dimension as the [[marker]]. | ||
==Source== | ==Source== |
Revision as of 22:05, 2 April 2018
This event is triggered when an element enters a marker created using createMarker.
Parameters
element hitElement, bool matchingDimension
- hitElement: the element that hit the marker.
- matchingDimension: a boolean representing whether the element is in the same dimension as the marker.
Source
The source of this event is the marker that got hit by the element.
Example
This example will output a message what type of element has entered a marker.
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerHit function
Issues
Issue ID | Description |
---|---|
#6098 | If a marker was attached to another element, onMarkerHit won't be triggered |
See Also
Marker events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled