SetMarkerTarget: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(13 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | |||
This function sets the 'target' for a marker. Only the ''checkpoint'' and ''ring'' marker types can have a target. | |||
For ''checkpoint'' markers, the target is shown as an arrow aiming at the point specified. Only 5 arrows can be visible at the same time. | |||
For ''ring'' markers, the target is shown by rotating the whole ring so that it faces the point specified. | |||
This function is most useful for setting up markers for races, where each marker points to the next one's position. | |||
(This is mostly used in races!) | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setMarkerTarget ( | bool setMarkerTarget ( marker theMarker, float x, float y, float z ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Marker]]:setTarget|target|getMarkerTarget}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theMarker:''' The marker to set the target of | ||
*'''x:''' The x axis of the coordinate to target the marker at | |||
*'''y:''' The y axis of the coordinate to target the marker at | |||
*'''z:''' The z axis of the coordinate to target the marker at | |||
*''' | |||
*''' | |||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if target was set, ''false'' otherwise. | ||
==Example== | ==Example== | ||
Creates a marker in the center of the map and points it north. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | local newMarker = createMarker(0, 0, 5, "ring", 2, 255, 0, 0, 255) --Creates a marker | ||
setMarkerTarget(newMarker, 3000, 0, 0) --Face the marker north | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Marker functions}} |
Latest revision as of 15:43, 4 July 2024
This function sets the 'target' for a marker. Only the checkpoint and ring marker types can have a target.
For checkpoint markers, the target is shown as an arrow aiming at the point specified. Only 5 arrows can be visible at the same time.
For ring markers, the target is shown by rotating the whole ring so that it faces the point specified.
This function is most useful for setting up markers for races, where each marker points to the next one's position. (This is mostly used in races!)
Syntax
bool setMarkerTarget ( marker theMarker, float x, float y, float z )
OOP Syntax Help! I don't understand this!
- Method: Marker:setTarget(...)
- Variable: .target
- Counterpart: getMarkerTarget
Required Arguments
- theMarker: The marker to set the target of
- x: The x axis of the coordinate to target the marker at
- y: The y axis of the coordinate to target the marker at
- z: The z axis of the coordinate to target the marker at
Returns
Returns true if target was set, false otherwise.
Example
Creates a marker in the center of the map and points it north.
local newMarker = createMarker(0, 0, 5, "ring", 2, 255, 0, 0, 255) --Creates a marker setMarkerTarget(newMarker, 3000, 0, 0) --Face the marker north
See Also
- createMarker
- getMarkerColor
- getMarkerCount
- getMarkerIcon
- getMarkerSize
- getMarkerTarget
- getMarkerType
- setMarkerColor
- setMarkerIcon
- setMarkerSize
- setMarkerTarget
- setMarkerType
- isElementWithinMarker