You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, November 9th 2020, 5:54pm

Changing default hotspot type in droplet

I've searched for this answer, but couldn't find it. Let me begin by saying that I don't know much about how to code the xml files, other than trial and error and hoping it works out.

I'd like to change the default hotspot (the arrow) in the droplet app to use the animated white circle hotspot, so when I use the tour editor, the default hotspot uses the animated white circle.

If anyone can point me to which file to edit, and what code to add/replace that would be great. I'm looking to change the MAKE VTOUR (VR-OPT) droplet.
thanks!

kangsj2277

Trainee

Posts: 71

Location: Republic of Korea

  • Send private message

2

Tuesday, November 10th 2020, 1:36am

krpano-1.20.8 → templates → xml → skin → vtourskin_hotspot.png
image change :)

3

Tuesday, November 10th 2020, 3:25pm

krpano-1.20.8 → templates → xml → skin → vtourskin_hotspot.png
image change :)
But in order to make it animate, there's a bunch of code to go along with it, that's what I'm struggling with at the moment.

kangsj2277

Trainee

Posts: 71

Location: Republic of Korea

  • Send private message

4

Wednesday, November 11th 2020, 1:39am

krpano-1.20.8\templates\xml\tour.xml

Add the following code to tour.xml and add action to onloaded of hotspot.
<action name="do_crop_animation" scope="local" args="framewidth, frameheight, framerate">
<!-- define local variables -->
calc(local.xframes, (caller.imagewidth /framewidth) BOR 0);
calc(local.frames, xframes * ((caller.imageheight / frameheight) BOR 0));
def(local.frame, integer, 0);

<!-- set the first frame -->
calc(caller.crop, '0|0|' + framewidth + '|' + frameheight);

<!-- do the animation -->
setinterval(calc('crop_anim_' + caller.name), calc(1.0 / framerate),
if(caller.loaded,
inc(frame);
if(frame GE frames, if(caller.onlastframe !== null, callwith(caller, onlastframe() ) ); set(frame,0); );
mod(xpos, frame, xframes);
div(ypos, frame, xframes);
Math.floor(ypos);
mul(xpos, framewidth);
mul(ypos, frameheight);
calc(caller.crop, xpos + '|' + ypos + '|' + framewidth + '|' + frameheight);
,
<!-- stop the interval when the hotspot gets removed -->
clearinterval(calc('crop_anim_' + caller.name));
);
);
</action>


ex) <hotspot name="animate_circle_hotspot" onloaded="do_crop_animation(50,50,2);"/>)""

5

Wednesday, November 11th 2020, 3:18pm

Thank you! I'll give that a shot.

Similar threads