Forum Replies Created

  • Tom Stanton

    April 8, 2020 at 1:50 am in reply to: decode effect based on a Dan Ebberts expression

    dredging this one up from the depths, but does anyone have a way to complete this effect with the characters resolving at random, rather than right to left? I’ve been trying to make it work for a while and it’s currently beyond me.

    Thanks in advance!

    choices = "QAZWSXEDCRFVTGBYHNUJMIKOLP";

    str = "this is my string";

    tStart = 1; //time at which the animation starts

    tStop = 2.4; //time at which the animation stop

    cps = 0; // characters per second

    if (time < tStart){

    seed = Math.floor(time*cps);

    seedRandom(seed,true);

    s = "";

    for (i = 0; i < str.length; i++){

    idx1 = Math.floor(random(choices.length));

    s += choices[idx1];

    }

    }

    else if (time >= tStart && time < tStop){

    seed = Math.floor(time*cps);

    seedRandom(seed,true);

    s = "";

    sRand = "";

    for (i = 0; i < str.length; i++){

    idx1 = Math.floor(random(choices.length));

    idx2 = Math.floor(linear(time,tStart,tStop,0,1)*str.length);

    sRand += choices[idx1];

    s = str.substr(0,idx2) + sRand.substr(idx2,str.length);

    }

    }else{

    s = str;

    }

    s

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy