BIS fnc isInsideArea: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " +\] +" to "] ")
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Geometry


|gr1 = Geometry |GROUP1=
|descr= Detects whether a position is within a square area of given size about center.


| Detects whether a position is within a square area of given size about center. |DESCRIPTION=
|s1= [center, size, position] call [[BIS_fnc_isInsideArea]]


| [center, size, position ] call [[BIS_fnc_isInsideArea]] |SYNTAX=
|p1= center: [[Array]] - center [[Position]] of area to check
|p2= size: [[Array]] - [x,y] offsets from center


|p1= center: [[Array]] - Center [[Position]] of area to check |Parameter1=
|p3= position: [[Array]] - [[Position]] to check
|p2= size: [[Array]] - [x,y] offsets from center |Parameter2=


|p3= position: [[Array]] - [[Position]] to check |PARAMETER2=
|r1= [[Boolean]] - true when position is in area, false otherwise


| [[Boolean]] - true when position is in area, false otherwise|RETURNVALUE=
|x1= <sqf>// Check an area, centered on the player that is 10m wide and 10m tall
 
|x1= <code>{{cc|Check an area, centered on the player that is 10m wide and 10m tall}}
_size = [5, 5];
_size = [5, 5];
_checkPos = [[getPos]] [[player]];
_checkPos = getPos player;
_inArea = [_checkPos, _size, _checkPos] [[call]] [[BIS_fnc_isInsideArea]];</code> |EXAMPLE1=
_inArea = [_checkPos, _size, _checkPos] call BIS_fnc_isInsideArea;</sqf>


| [[createTrigger]] [[createMarker]] [[setTriggerArea]] [[setMarkerSize]] [[triggerArea]] [[markerSize]] [[BIS_fnc_inAngleSector]] |SEEALSO=
|seealso= [[createTrigger]] [[createMarker]] [[setTriggerArea]] [[setMarkerSize]] [[triggerArea]] [[markerSize]] [[BIS_fnc_inAngleSector]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:isInsideArea}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:isInsideArea}}]]

Latest revision as of 17:49, 8 November 2023

Hover & click on the images for description

Description

Description:
Detects whether a position is within a square area of given size about center.
Execution:
call
Groups:
Geometry

Syntax

Syntax:
[center, size, position] call BIS_fnc_isInsideArea
Parameters:
center: Array - center Position of area to check
size: Array - [x,y] offsets from center
position: Array - Position to check
Return Value:
Boolean - true when position is in area, false otherwise

Examples

Example 1:
// Check an area, centered on the player that is 10m wide and 10m tall _size = [5, 5]; _checkPos = getPos player; _inArea = [_checkPos, _size, _checkPos] call BIS_fnc_isInsideArea;

Additional Information

See also:
createTrigger createMarker setTriggerArea setMarkerSize triggerArea markerSize BIS_fnc_inAngleSector

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note