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

Friday, September 26th 2014, 3:56pm

Hotspot question

Hello all!

I'm creating pano with some extracted hotspots.

I need to load first hotspot (priborka.jpg) at start.
Then i need to disable/enable it by tap at second hotspot (priborka_btn).

Here is my code:

<hotspot name="priborka" capture="false" handcursor="false" alpha="0"
url="panamera.tiles/priborka.jpg"
distorted="true"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(39, 13.906, 19.316, -0.913);"
onclick="switch(alpha,0,1);"
/>
<hotspot name="priborka_btn" style="knopka" ath="0" atv="17"/>



How to do it?

2

Saturday, September 27th 2014, 9:01am

Hi,

if you want to switch the alpha of the hotspot 'priborka' from the hotspot 'priborka_btn' do this:

<hotspot name="priborka_btn" style="knopka" ath="0" atv="17" onclick="switch(hotspot[priborka].alpha, 0, 1);/>

Best regards,
Klaus

3

Monday, September 29th 2014, 9:56am

Hi Klaus, thank you!

You answered at my 2nd question.
But how to make priborka.jpg loaded at pano start?


<hotspot name="priborka" capture="false" handcursor="false" alpha="0"
url="panamera.tiles/priborka.jpg"
distorted="true"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(39, 13.906, 19.316, -0.913);"
onclick="switch(alpha,0,1);"
/>

This post has been edited 2 times, last edit by "rankov" (Sep 29th 2014, 11:20am)


4

Monday, October 6th 2014, 11:04am

Hi,

you could try adding such to preload the image:

Source code

1
<layer name="priborka_preload" url="panamera.tiles/priborka.jpg" visible="false" keep="true" preload="true" />


Best regards,
Klaus

5

Wednesday, October 22nd 2014, 2:27pm

Hi Klaus,

Thank you for reply. I've tried it, but this code makes nothing. When i set visible="true", image appears, but fill the whole screen. What's wrong here?

6

Wednesday, October 22nd 2014, 2:42pm

Hi,

that only code 'pre-loads' that image file, so that it will be loaded at first (before anything else).

That was your question, or?

Best regards,
Klaus

7

Wednesday, October 22nd 2014, 2:51pm

Klaus, i need to preload the image from this hotspot. Distorted and with pixel alignment.

<hotspot name="priborka" capture="false" handcursor="false" alpha="0"
url="panamera.tiles/priborka.jpg"
distorted="true"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(39, 13.906, 19.316, -0.913);"
onclick="switch(alpha,0,1);"
/>

I made it with this instruction
Example/Tutorial - Extract a Distorted Hotspot from any kind of Pano Image (with perfect pixel alignment)



It fits perfectly, but i just need to load it automatically, without click.

8

Wednesday, October 22nd 2014, 3:32pm

It loads automatically, but you have set alpha=0 (=transparent) and on click you are setting alpha=1 (not-transparent).

9

Wednesday, October 22nd 2014, 4:18pm

Ok, it works. I changed alpha and priborka.jpg appears at start.

I have a button over it, to switch alpha for this hotspot.
<hotspot name="priborka_btn" style="knopka" ath="-14.5" atv="21.5" onclick="switch(hotspot[priborka].alpha,0,1);"/>


Now this button became hidden. How to bring it to front and hide after switch "priborka" alpha?

10

Wednesday, October 22nd 2014, 6:04pm

If the hotspots are at the same location, order them by setting different zorder setting for them.
And to make them alternately visible, set different visible setting and change both on click:

e.g. (remove your old alpha code)

Source code

1
2
<hotspot name="priborka"     ... zorder="1" visible="false" onclick="set(visible,false); set(hotspot[priborka_btn].visible,true);" />
<hotspot name="priborka_btn" ... zorder="2" visible="true"  onclick="set(visible,false); set(hotspot[priborka].visible,true);" />

11

Thursday, October 23rd 2014, 12:13pm

Klaus, i need to make both hotspots visible at the same time, visible = "true".
zorder change doesn't do the result, priborka_btn is invisible at start

12

Friday, October 24th 2014, 9:04pm

For html5 you might need to add zorder2="1.0" to the priborka_btn hotspot:
http://krpano.com/docu/xml/#hotspot.zorder2