BIS fnc animatePicture: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Function|= Comments " to "{{Function|Comments= ")
(Page filling)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.78


|1.78|Game version=
|gr1= Systems


<!---|arg= local |Multiplayer Arguments=--->
|descr= Translates (relative or absolute), scales (relative or absolute), and sets the alpha over time on the provided control.


<!---|eff= local |Multiplayer Effects=--->
|s1= [control, durationOrSpeed, [translationPosition, isRelativeTranslation, useDuration], [scalePosition, isRelativeScale, scalePivot], alpha] call [[BIS_fnc_animatePicture]]


| <pre>/*
|p1= control: [[Control]] - the control to be moved
Author: Riccardo Argiolas


Description:
|p2= durationOrSpeed: [[Number]] - (Optional, default 2) transition duration ''or'' movement speed, depending on ''useDuration''
    Translates (relative or absolute), scales (relative or absolute), sets the alpha over time.


Parameters:
|p3= translationPosition: [[Array]] format [[Position#Position2D|Position2D]] - (Optional, default [0,0])
Select 0 - CONTROL: picture that has to be modified
Select 1 - NUMBER: duration of the animation (or speed of the translation, in case _translateUsingDuration is set to false)
Select 2 - ARRAY: array containing translation parameters
Select 0 - ARRAY: x and y translation coordinates
Select 1 - BOOL: whether the coordinates are relative (ie: will be added to the picture's current position) or absolute (move picture to those coordinates, ignoring current position)
Select 2 - BOOL: whether the _durationOrSpeed variable will be treated as a normal duration (by default) or as the translation speed.
Select 3 - ARRAY: array containing scaling parameters
Select 0 - ARRAY or NUMBER: x and y scale "amounts". If only a number is passed, both the x and y will be equal to that number
Select 1 - BOOL: whether the amounts are relative or absolute
Select 2 - STRING: the pivot/center of the scaling process
Select 4 - NUMBER: alpha/transparency of the image at the end of the animation (1 = invisible)


Returns:
|p4= isRelativeTranslation - [[Boolean]] - (Optional, default [[true]]) is ''translationPosition'' relative to the original ''control''<nowiki/>'s position
NUMBER: Duration of the animation. (Useful for determining how much sleep time is needed between animations)


Examples:
|p5= useDuration: [[Boolean]] - (Optional, default [[true]]) if set to [[false]], ''durationOrSpeed'' will be used as ''control'' speed (and effect duration will be recalculated from it)
_t =
[
_controlFront,
1,
[[0.5, 0.5], true, false],
[],
0.5
]
call BIS_fnc_animatePicture;
*/</pre>{{placeholder}}<!-- Remove this after fill-in --> |Description=


|[] call [[BIS_fnc_animatePicture]]|Syntax=
|p6= scalePosition: [[Number]] or [[Array]] of [[Number]]s - (Optional, default 1) define X and Y scale value


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|p7= isRelativeScale: [[Boolean]] - (Optional, default [[true]]) is ''scalePosition'' relative to the original ''control''<nowiki/>'s scale


|Datatype - description|Return value=
|p8= scalePivot: [[String]] - (Optional, default "center") case-'''in'''sensitive. Possible values:


|x1= <code></code>|Example 1=
{{Columns|3|
* "topLeft"
* "topCenter"
* "topRight"
* "centerLeft"
* "center" - fallback value
* "centerRight"
* "bottomLeft"
* "bottomCenter"
* "bottomRight"
}}
 
|p9= alpha: [[Number]] - (Optional, default 0) ''control''<nowiki/>'s final opacity
 
|r1= [[Number]] - animation's duration


|exec= call |Execution=
|x1= <sqf>
private _t =
[
_controlFront,
1,
[[0.5, 0.5], true, false],
[],
0.5
]
call BIS_fnc_animatePicture;
</sqf>


| |See also=
|seealso=
}}
}}
[[Category:Function Group: Systems|{{uc:animatePicture}}]]
[[Category:Functions|{{uc:animatePicture}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:animatePicture}}]]

Latest revision as of 17:43, 13 December 2022

Hover & click on the images for description

Description

Description:
Translates (relative or absolute), scales (relative or absolute), and sets the alpha over time on the provided control.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[control, durationOrSpeed, [translationPosition, isRelativeTranslation, useDuration], [scalePosition, isRelativeScale, scalePivot], alpha] call BIS_fnc_animatePicture
Parameters:
control: Control - the control to be moved
durationOrSpeed: Number - (Optional, default 2) transition duration or movement speed, depending on useDuration
translationPosition: Array format Position2D - (Optional, default [0,0])
isRelativeTranslation - Boolean - (Optional, default true) is translationPosition relative to the original control's position
useDuration: Boolean - (Optional, default true) if set to false, durationOrSpeed will be used as control speed (and effect duration will be recalculated from it)
scalePosition: Number or Array of Numbers - (Optional, default 1) define X and Y scale value
isRelativeScale: Boolean - (Optional, default true) is scalePosition relative to the original control's scale
scalePivot: String - (Optional, default "center") case-insensitive. Possible values:
  • "topLeft"
  • "topCenter"
  • "topRight"
  • "centerLeft"
  • "center" - fallback value
  • "centerRight"
  • "bottomLeft"
  • "bottomCenter"
  • "bottomRight"
alpha: Number - (Optional, default 0) control's final opacity
Return Value:
Number - animation's duration

Examples

Example 1:
private _t = [ _controlFront, 1, [[0.5, 0.5], true, false], [], 0.5 ] call BIS_fnc_animatePicture;

Additional Information

See also:
See also needed

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