BIS fnc scaleAndTranslate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|Multiplayer Effects(...)
(Page filling)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function
{{RV|type=function


| arma3
|game1= arma3
|version1= 1.78


|1.78
|gr1= Systems


|gr1 = Systems
|descr= Translates, scales (with pivot) and fades a picture control over time.


<!---|arg= local |Multiplayer Arguments=--->
|s1= [picture, scaleFactor, pivot, translation, durationOrSpeed, isDuration, fade] call [[BIS_fnc_scaleAndTranslate]]


<!---|eff= local |Multiplayer Effects=--->
|p1= picture: [[Control]] - picture that has to be modified


| <pre>/*
|p2= scaleFactor: [[Number]] - (Optional, default 1) how much the picture has to be scaled (> 1 makes it bigger, 1 keeps it the same, < 1 makes it smaller)
Author: Riccardo Argiolas


Description:
|p3= pivot: [[String]] - (Optional, default "center") select the pivot's position (i.e. center of the scaling process); can be one of:
    Translates and scales (with pivot) and fades a picture over time.
{{Columns|3|
 
* "topLeft"
Parameters:
* "topCenter"
Select 0 - CONTROL: picture that has to be modified
* "topRight"
Select 1 - NUMBER: how much the picture has to be scaled (>1 makes it bigger, 1 keeps it the same, <1 makes it smaller)
* "centerLeft"
Select 2 - STRING: select the pivot's position (i.e. center of the scaling process)
* "center"
Select 3 - ARRAY: how much the picture has to be translated/moved in [X,Y] format
* "centerRight"
Select 4 - NUMBER: either the duration of the animation(default) or the speed of the translation, depending on what the next parameter is set to.
* "bottomLeft"
Select 5 - BOOL: true = duration will be used, false = speed will be used.
* "bottomCenter"
Select 6 - NUMBER: transparency of the image at the end of the animation (1 = invisible)
* "bottomRight"
}}


Returns:  
|p4= translation: [[Array]] format [x, y] - (Optional, default [0, 0]) how much the picture has to be moved
NUMBER: Duration of the animation. (Useful for determining how much sleep time is needed between animations)


Examples:
|p5= durationOrSpeed: [[Number]] - (Optional, default 2) either the duration of the animation(default) or the speed of the translation, depending on what the next parameter is set to
[_controlFront, 0.8, "topLeft"] call BIS_fnc_scaleAndTranslate;
_t = [_controlFront, 1, "bottomRight", [0.1, 0.1], 0.5, false] call BIS_fnc_scaleAndTranslate;
sleep (_t * 2);
[_controlFront, 0.8, "topRight", [0.5, 0.3]] call BIS_fnc_scaleAndTranslate;
*/</pre>{{placeholder}}<!-- Remove this after fill-in -->


|[] call [[BIS_fnc_scaleAndTranslate]]
|p6= isDuration: [[Boolean]] - (Optional, default [[true]]) if [[true]], ''durationOrSpeed'' is considered duration; if [[false]] it is considered speed


|p1= parameter: Datatype - (Optional, default defValue) description
|p7= fade: [[Number]] - (Optional, default 0) transparency of the image at the end of the animation (in range 0..1: 0 = visible, 1 = invisible)


|Datatype - description
|r1= [[Number]] - duration of the animation; useful for determining how much sleep time is needed between animations


|x1= <code></code>
|x1= <sqf>
[_controlFront, 0.8, "topLeft"] call BIS_fnc_scaleAndTranslate;
private _t = [_controlFront, 1, "bottomRight", [0.1, 0.1], 0.5, false] call BIS_fnc_scaleAndTranslate;
sleep (_t * 2);
[_controlFront, 0.8, "topRight", [0.5, 0.3]] call BIS_fnc_scaleAndTranslate;
</sqf>


|exec= call|
|seealso= [[ctrlSetPosition]] [[ctrlSetFade]] [[ctrlCommit]]
}}
}}
[[Category:Functions|{{uc:scaleAndTranslate}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:scaleAndTranslate}}]]

Latest revision as of 23:40, 4 June 2024

Hover & click on the images for description

Description

Description:
Translates, scales (with pivot) and fades a picture control over time.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[picture, scaleFactor, pivot, translation, durationOrSpeed, isDuration, fade] call BIS_fnc_scaleAndTranslate
Parameters:
picture: Control - picture that has to be modified
scaleFactor: Number - (Optional, default 1) how much the picture has to be scaled (> 1 makes it bigger, 1 keeps it the same, < 1 makes it smaller)
pivot: String - (Optional, default "center") select the pivot's position (i.e. center of the scaling process); can be one of:
  • "topLeft"
  • "topCenter"
  • "topRight"
  • "centerLeft"
  • "center"
  • "centerRight"
  • "bottomLeft"
  • "bottomCenter"
  • "bottomRight"
translation: Array format [x, y] - (Optional, default [0, 0]) how much the picture has to be moved
durationOrSpeed: Number - (Optional, default 2) either the duration of the animation(default) or the speed of the translation, depending on what the next parameter is set to
isDuration: Boolean - (Optional, default true) if true, durationOrSpeed is considered duration; if false it is considered speed
fade: Number - (Optional, default 0) transparency of the image at the end of the animation (in range 0..1: 0 = visible, 1 = invisible)
Return Value:
Number - duration of the animation; useful for determining how much sleep time is needed between animations

Examples

Example 1:
[_controlFront, 0.8, "topLeft"] call BIS_fnc_scaleAndTranslate; private _t = [_controlFront, 1, "bottomRight", [0.1, 0.1], 0.5, false] call BIS_fnc_scaleAndTranslate; sleep (_t * 2); [_controlFront, 0.8, "topRight", [0.5, 0.3]] call BIS_fnc_scaleAndTranslate;

Additional Information

See also:
ctrlSetPosition ctrlSetFade ctrlCommit

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