{"name":"BIS_fnc_scaleAndTranslate","operator":null,"title":"BIS fnc scaleAndTranslate","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_scaleAndTranslate","revid":364739,"updated":"2024-06-04T21:40:23Z","groups":["Systems"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.78"}],"since":{"game":"arma3","name":"Arma 3","version":"1.78"},"arma3_since":"1.78","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Translates, scales (with pivot) and fades a picture control over time.","syntaxes":[{"syntax":"[picture, scaleFactor, pivot, translation, durationOrSpeed, isDuration, fade] call BIS_fnc_scaleAndTranslate","since":null,"effect":null,"exec":null,"params":[{"name":"picture","type":"Control","optional":false,"default":null,"description":"picture that has to be modified","types":["Control"],"since":null,"text":"picture: Control - picture that has to be modified"},{"name":"scaleFactor","type":"Number","optional":true,"default":"1","description":"how much the picture has to be scaled (> 1 makes it bigger, 1 keeps it the same, < 1 makes it smaller)","types":["Number"],"since":null,"text":"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)"},{"name":"pivot","type":"String","optional":true,"default":"\"center\"","description":"select the pivot's position (i.e. center of the scaling process); can be one of:\n- \"topLeft\"\n- \"topCenter\"\n- \"topRight\"\n- \"centerLeft\"\n- \"center\"\n- \"centerRight\"\n- \"bottomLeft\"\n- \"bottomCenter\"\n- \"bottomRight\"","types":["String"],"since":null,"text":"pivot: String - (Optional, default \"center\") select the pivot's position (i.e. center of the scaling process); can be one of:\n- \"topLeft\"\n- \"topCenter\"\n- \"topRight\"\n- \"centerLeft\"\n- \"center\"\n- \"centerRight\"\n- \"bottomLeft\"\n- \"bottomCenter\"\n- \"bottomRight\""},{"name":"translation","type":"Array format [x, y]","optional":true,"default":"[0, 0]","description":"how much the picture has to be moved","types":["Array"],"since":null,"text":"translation: Array format [x, y] - (Optional, default [0, 0]) how much the picture has to be moved"},{"name":"durationOrSpeed","type":"Number","optional":true,"default":"2","description":"either the duration of the animation(default) or the speed of the translation, depending on what the next parameter is set to","types":["Number"],"since":null,"text":"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"},{"name":"isDuration","type":"Boolean","optional":true,"default":"true","description":"if true, *durationOrSpeed* is considered duration; if false it is considered speed","types":["Boolean"],"since":null,"text":"isDuration: Boolean - (Optional, default true) if true, *durationOrSpeed* is considered duration; if false it is considered speed"},{"name":"fade","type":"Number","optional":true,"default":"0","description":"transparency of the image at the end of the animation (in range 0..1: 0 = visible, 1 = invisible)","types":["Number"],"since":null,"text":"fade: Number - (Optional, default 0) transparency of the image at the end of the animation (in range 0..1: 0 = visible, 1 = invisible)"}],"returns":{"type":"Number","types":["Number"],"description":"duration of the animation; useful for determining how much sleep time is needed between animations","text":"Number - duration of the animation; useful for determining how much sleep time is needed between animations"}}],"examples":[{"text":"```sqf\n[_controlFront, 0.8, \"topLeft\"] call BIS_fnc_scaleAndTranslate;\nprivate _t = [_controlFront, 1, \"bottomRight\", [0.1, 0.1], 0.5, false] call BIS_fnc_scaleAndTranslate;\nsleep (_t * 2);\n[_controlFront, 0.8, \"topRight\", [0.5, 0.3]] call BIS_fnc_scaleAndTranslate;\n```","code":["[_controlFront, 0.8, \"topLeft\"] call BIS_fnc_scaleAndTranslate;\nprivate _t = [_controlFront, 1, \"bottomRight\", [0.1, 0.1], 0.5, false] call BIS_fnc_scaleAndTranslate;\nsleep (_t * 2);\n[_controlFront, 0.8, \"topRight\", [0.5, 0.3]] call BIS_fnc_scaleAndTranslate;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlSetPosition","ctrlSetFade","ctrlCommit"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Systems","Functions","Introduced with Arma 3 version 1.78"],"docblock":null,"filled_from_docblock":[]}