BIS fnc rscLayer: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "<syntaxhighlight lang="javascript">/* Author: Karel Moricky Description: Register RSC layer. Parameter(s): _this select 0: STRING - layer name. Parent function name is use...")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *L([a-z ])" to "$1 - l$2")
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<syntaxhighlight lang="javascript">/*
{{RV|type=function
Author: Karel Moricky


Description:
|game1= arma3
Register RSC layer.
|version1= 1.00


Parameter(s):
|gr1= GUI
_this select 0: STRING - layer name. Parent function name is used automatically when param is nil.


Returns:
|descr= Register RSC layer and returns a '''unique''' ID.
NUMBER
*/


private ["_name","_list","_id"];
|s1= [layerName] call [[BIS_fnc_rscLayer]]
_name = [_this,0,"",[""]] call bis_fnc_param;
_list = missionnamespace getvariable ["bis_fnc_rscLayer_list",[]];


if (_name == "") then {
|p1= layerName: [[String]] - layer name. Parent function name is used automatically when param is [[nil]].
if (_fnc_scriptNameParent != _fnc_scriptName) then {
_name = _fnc_scriptNameParent;
};
};
if (_name == "") exitwith {"RSC Layer name cannot be empty string" call bis_fnc_error; -1};


_id = _list find _name;
|r1= [[Number]] - layer ID
_id = if (_id < 0) then {
_id = (count _list + 2) / 2;
_list set [count _list,_name];
_list set [count _list,_id];
_id
} else {
_list select (_id + 1)
};


missionnamespace setvariable ["bis_fnc_rscLayer_list",_list];
|x1= <sqf>private _id = ["myLayerName"] call BIS_fnc_rscLayer;</sqf>
_id
 
</syntaxhighlight>
|seealso= [[allCutLayers]] [[titleRsc]] [[cutText]] [[cutObj]] [[cutFadeOut]] [[setTitleEffect]]
}}

Latest revision as of 16:38, 8 November 2023

Hover & click on the images for description

Description

Description:
Register RSC layer and returns a unique ID.
Execution:
call
Groups:
GUI

Syntax

Syntax:
[layerName] call BIS_fnc_rscLayer
Parameters:
layerName: String - layer name. Parent function name is used automatically when param is nil.
Return Value:
Number - layer ID

Examples

Example 1:
private _id = ["myLayerName"] call BIS_fnc_rscLayer;

Additional Information

See also:
allCutLayers titleRsc cutText cutObj cutFadeOut setTitleEffect

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