I would like to apply a tweentype on a random value
if it was possible, how would you do it?
I would like to apply a tweentype on a random value
if it was possible, how would you do it?
Hi
a simple way could be:
<hotspot name="p1" type="text" width="30" height="30" ath="0" atv="0" onclick="DoRandomtween" />
<action name="DoRandomtween" scope="local">
mul(val, random, 6);
add(val, 1);
roundval(val);
v = val*10;
tween(hotspot[p1].ath, *v);
</action>
so.. i take a number between 1 and 6 .. do that * 10.. and tween the hotspot ath that amount when you click it.
krpano.com - Documentation - Actions / Scripting Reference
Tuur
thx !! i' ill try to adapt you're approach.
just finished an action for randomcalling hotspots :)
(bigtime for an beginner :D)
<!-- ////////////random_show_hotspots ////////////-->
<!-- ////////////random_show_hotspots ////////////-->
<action name="delayed_show">
delayedcall(get(global.randomized_time),
trace('Hotspot UP : ', %1);
tween(hotspot[%1].alpha, 0.6, 1, easeinoutcubic);
);
</action>
<action name="random_show_hotspots" scope="local">
for(set(i, 0), i LE hotspot.count, inc(i),
mul(global.randomized_time, random, 0.8);
roundval(global.randomized_time, 2);
copy(hotspot_name, hotspot[get(i)].name);
delayed_show(get(hotspot_name));
);
</action>
<!-- ////////////random_show_hotspots ////////////-->
<!-- ////////////random_show_hotspots ////////////-->
<!-- ////////////random_show_hotspots //////////// -->
Display More
Don’t have an account yet? Register yourself now and be a part of our community!