Sie sind nicht angemeldet.

Kev-in-spain

Fortgeschrittener

  • »Kev-in-spain« ist der Autor dieses Themas

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

1

Freitag, 14. September 2012, 11:36

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?

2

Freitag, 14. September 2012, 14:07

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:

Quellcode

1
2
3
4
5
6
<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

Kev-in-spain

Fortgeschrittener

  • »Kev-in-spain« ist der Autor dieses Themas

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

3

Freitag, 14. September 2012, 15:44


<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),')') );"
/>


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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Kev-in-spain« (14. September 2012, 18:09)


4

Samstag, 15. September 2012, 09:10

Hi,
are you saying that there is no way to put it into an action?
no - I'm not saying that! - you can use such code wherever you want
it doesn't matter if a code was written into an <action> or into an attribute...


nice!

best regards,
Klaus

Kev-in-spain

Fortgeschrittener

  • »Kev-in-spain« ist der Autor dieses Themas

Beiträge: 152

Wohnort: Barcelona

Beruf: VR Photographer

  • Nachricht senden

5

Donnerstag, 20. September 2012, 19:39

Thanks Klaus.

Is there any way to get this effect to work on an idevice?

6

Freitag, 21. September 2012, 12:06

Hi,

at the moment not,
but maybe in future, when css filtes become available in the most major browsers and perform good,

best regards,
Klaus