tween plugin blur radius

  • Hi all,
    I feel a bit foolish asking this question, as I'm sure the answer must be very simple, but I have reached the boundries of my limited knowledge and searched the forum to no avail.
    I'm trying to create a very simply action to reveal a logo at the start of a tour. I have blurred the plugin(a .png file) using 'effect="blur(20)" and, as the plugin is revealed, I want the blur to clear.
    Here is the relevant code:
    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    logo());
    </action>

    <action name="logo">
    tween(plugin[logo].alpha,1,2);
    tween(plugin[logo].blur,0,2);
    </action>

    <plugin name="logo" url="plugins/logo.png" align="center" keep="true" alpha="0" scale="0.5" effect="blur(20)" devices="all"
    onloaded="if(isdesktop,mul(scale,1.5));"
    onclick="go()"/>

    In my searches around the forum I have seen the line of code tween(plugin[.....].blur,... so I assume the action is possible so, what could be the reason for this not working?

  • Hi,

    only the Flash textfield plugin has a 'blur' setting, the normal plugin elements not, and in HTML5 there is currently no cross-browser possibility for that.

    For clearing the blur, just set the 'effect' attribute back to an empty string ("") or to null.

    A possibility for tweening the blur, would be too tween a custom 'blur' variable and use the 'updatecall' to dynamically reconstruct the 'effect' setting (by using the txtadd() action).

    Here a small example, where the blur will be changed in the mouse over/out events:

    Code
    <plugin name="blurtest"
       	...
       	blur="0"
       	onover="tween(blur, 8, 0.5, default, null, txtadd(effect,'blur(',get(blur),')') );"
       	onout="tween(blur, 0, 0.5, default, null, txtadd(effect,'blur(',get(blur),')') );"
       	/>

    Best regards,
    Klaus

  • Hi Klaus, this is definitely the effect I am looking for but, are you saying that there is no way to put it into an action?
    EDIT:
    Ok... for anyone that's interested, I've found a workaround to create the effect I was after.
    Here's the code:

    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    );
    </action>

    <action name="logo">
    set(plugin[logo].visible,true);
    tween(plugin[logo].alpha,1,3);
    tween(view.fov,85,6);
    </action>

    <action name="go">
    tween(plugin[logo].alpha,0,2,,
    set(plugin[logo].visible,false);
    set(autorotate.enabled,true)));
    </action>

    <plugin name="logo" url="plugins/logo.png" align="center" keep="true" visible="false" alpha="0" scale="0.5" devices="all" blur="200"
    onloaded="logo();if(isdesktop,mul(scale,1.5)); tween(blur, 0, 3, default, null, txtadd(effect,'blur(',get(blur),')') );"
    onclick="go(); tween(blur,200, 3, default, null, txtadd(effect,'blur(',get(blur),')') );"/>

    And here's what it does:

    http://www.360examples.net/jubany_2/tour.html

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!