OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Nico [BOS] on 25 Oct 2009, 19:36:03

Title: How to animate letters ?
Post by: Nico [BOS] on 25 Oct 2009, 19:36:03
Hello,

I have displayed a sentence on screen by using a file "description.ext" and the command TitleRsc ["texte1","plain",2].

I found a script from BIS for animate the letters (one of those used in the "credits" scene), but I don't know how to use it.

It's this one :

Code: [Select]
//Animation mode 1 - characters enter the screen behind the camera and move away from the camera.
disableSerialization;

private ["_ctrl", "_char", "_pos", "_slot"];
_ctrl = _this select 0;
_char = _this select 1;
_pos = _this select 2;
_slot = _this select 3;

call (compile ("BIS_Credits_Pool" + (str _slot) + " = BIS_Credits_Pool" + (str _slot) + " - [_ctrl]"));

_ctrl ctrlSetText _char;

_ctrl ctrlSetPosition [(_pos * 0.03) + 0.1,0.05 + _slot / 400];
_ctrl ctrlSetFade 0;
_ctrl ctrlSetScale 10;
_ctrl ctrlCommit 0;

_ctrl ctrlSetScale 1;
_ctrl ctrlCommit 0.5;

//Make sure the proper text / fade level is set.
sleep 2;

_ctrl ctrlSetText _char;
_ctrl ctrlSetFade 0;
_ctrl ctrlSetPosition [(_pos * 0.03) + 0.1,0.05 + _slot / 400];
_ctrl ctrlSetScale 1;
_ctrl ctrlCommit 0;

/*sleep (2 + ((6 - (_slot / 30)) * ((30 * 0.06) + 0.5)));

_ctrl ctrlSetFade 1;
_ctrl ctrlCommit 1;*/

true
Do you know how to use this script ?

Thank you.
Title: Re: How to animate letters ?
Post by: Mandoble on 26 Oct 2009, 20:16:09
No idea about the BIS script, but you can create a text control per leter in your tittle (instead of only one with all the text), then you can use ctrlSetPosition and ctrlCommit commands to change their positions and sizes at will.