Hi,
I would like to make dynamically certain styles and layers active, when webvr is used or faked.
In my example I want to use hotspots for tooltips if webvr is enabled or faked
and use layers for tooltips in all other conditions.
If possible I would like to keep the original webvr events and procedures and to only add if necessary an own <action>.
Here are my styles (defined in vtourskin.xml):
QuoteDisplay More<!-- skin_tooltips - style for webvr is enabled or faked - use of hotspots-->
<style name="skin_tooltips"
onover="copy(hotspot[tooltip].html, tooltip);
set(hotspot[tooltip].visible, true);
tween(hotspot[tooltip].alpha, 1.0, 0.5);
calc(xmouse,mouse.stagex-stagewidth/2); calc(ymouse,0.90*(mouse.stagey-stageheight/2));
asyncloop(hovering, copy(hotspot[tooltip].ath, view.hlookat); copy(hotspot[tooltip].atv, view.vlookat);copy(hotspot[tooltip].ox,xmouse); copy(hotspot[tooltip].oy,ymouse); );"
onout="calc(xmouse,mouse.stagex-stagewidth/2); calc(ymouse,0.90*(mouse.stagey-stageheight/2)); tween(hotspot[tooltip].alpha, 0.0, 0.1, default, set(hotspot[tooltip].visible,false), copy(hotspot[tooltip].ox,xmouse); copy(hotspot[tooltip].oy,ymouse); );"
/>
QuoteDisplay More<!-- skin_tooltips - style for webvr is disabled - use of layers -->
<style name="skin_tooltips"
onover.mouse="copy(layer[skin_tooltip].html, tooltip);
set(layer[skin_tooltip].visible, calc(webvr.isenabled ? false : true));
tween(layer[skin_tooltip].alpha, 1.0, 0.1);
asyncloop(hovering, copy(layer[skin_tooltip].x,mouse.stagex); copy(layer[skin_tooltip].y,mouse.stagey); );"
onout.mouse="tween(layer[skin_tooltip].alpha, 0.0, 0.1, default, set(layer[skin_tooltip].visible,false), copy(layer[skin_tooltip].x,mouse.stagex); copy(layer[skin_tooltip].y,mouse.stagey); );"
/>
What is the best way to do the switch?
Can I check dynamically (during runtime) within the <style>, wheter webvr is enabled or faked?
All my tries failed so far. I would appreciate help for this topic. If possible without changing webvr events and procedures.
Is there a difference to switch in <styles> and <Layers>?