IsInsideRadarArea: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Zangomangu (talk | contribs) (Removed old issue & old warning) |
||
Line 2: | Line 2: | ||
{{Server client function}} | {{Server client function}} | ||
This function checks if a 2D position is inside a [[radararea|radar area]] or not. | This function checks if a 2D position is inside a [[radararea|radar area]] or not. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 27: | Line 27: | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Radar area functions}} | {{Radar area functions}} |
Latest revision as of 10:26, 30 January 2022
This function checks if a 2D position is inside a radar area or not.
Syntax
bool isInsideRadarArea ( radararea theArea, float posX, float posY )
OOP Syntax Help! I don't understand this!
- Method: radararea:isInside(...)
Required Arguments
- theArea: The radar area you're checking the position against.
- posX: The X coordinate of the position you're checking.
- posY: The Y coordinate of the position you're checking.
Returns
Returns true if the position is inside the radar area, false if it isn't or if any parameters are invalid.
Example
This function checks if an element is within a radar area.
function isElementInsideRadarArea ( theElement, theArea ) -- get the x, y coordinates from getElementPosition (z gets silently discarded) local posX, posY = getElementPosition( theElement ) -- call isInsideRadarArea with those coordinates and return its result return isInsideRadarArea ( theArea, posX, posY ) end
See Also
- createRadarArea
- getRadarAreaColor
- getRadarAreaSize
- isInsideRadarArea
- isRadarAreaFlashing
- setRadarAreaColor
- setRadarAreaFlashing
- setRadarAreaSize