Hi,
I got the VR thumbs menu from this example https://krpano.com/releases/1.20.…tml5=only+webgl
showing up at the origin of my depthmap panos when pressing the HOME button in VR. The code below will show the thumbs menu at origin, also when I'm in a pano with offset.
Now I struggle calculating the current offset and adjust it dynamically in the showthumbs action, before the thumbs get tweened from ty=10000 to ty=0 with ox|oy offset, whereever the cameraposition is at the moment.
Could someone give me a push in the right direction at which position to maybe copy the current location coords and use them to show the thumbs correctly? I tried tracing various coords without success.
Thanks,
loki
Code
<action name="add_example_thumb" scope="local" args="title, ath, yoffset, thumburl, clickaction">
addhotspot(auto,bg);
addhotspot(auto,thumb);
addhotspot(auto,text);
set(bg, distorted=true, zorder=1, enabled=false, type=text, bgcolor=0x000000, bgalpha=0.5, bgroundedge=0, width=220, height=160, ath=get(ath), oy=calc((yoffset+20)*0.15*0.5), depth=150, scale=0.15);
set(thumb, distorted=true, zorder=2, capture=false, url=get(thumburl), width=200, height=120, ath=get(ath), oy=calc(yoffset*0.15*0.5), depth=149, scale=0.15, onover=tween(depth,147), onout=tween(depth,149), clickaction=get(clickaction), onclick='set(enabled,false); clickaction();');
set(text, distorted=true, zorder=3, enabled=false, type=text, html=get(title), css='text-align:center;color:#FFFFFF;font-size:15px;font-weight:bold;', oversampling=3, mipmapping=true, bgcolor=0xFFFFFF, bgalpha=0.004, width=200, height=20, ath=get(ath), oy=calc((yoffset+145)*0.15*0.5), depth=149, scale=0.15);
set(bg, ty=10000, autoalpha=true, alpha=0);
set(thumb, ty=10000, autoalpha=true, alpha=0);
set(text, ty=10000, autoalpha=true, alpha=0);
<!-- store the current local scope to have later access to its local variables -->
set(global.thumbs[get(global.thumbs.length)],get(local));
</action>
<action name="showthumbs" scope="local">
for(set(i,0), i LT global.thumbs.length, inc(i),
scope(get(global.thumbs[get(i)]),
callwith(bg, tween(ty|alpha, 0|1, 3.0, easeOutQuint|easeOutQuad); );
callwith(thumb, tween(ty|alpha, 0|1, 3.0, easeOutQuint|easeOutQuad); );
callwith(text, tween(ty|alpha, 0|1, 3.0, easeOutQuint|easeOutQuad); );
);
);
</action>
Alles anzeigen