Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Freitag, 26. September 2014, 15:56

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

Samstag, 27. September 2014, 09:01

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

Montag, 29. September 2014, 09:56

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

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »rankov« (29. September 2014, 11:20)


4

Montag, 6. Oktober 2014, 11:04

Hi,

you could try adding such to preload the image:

Quellcode

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


Best regards,
Klaus

5

Mittwoch, 22. Oktober 2014, 14:27

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

Mittwoch, 22. Oktober 2014, 14:42

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

Mittwoch, 22. Oktober 2014, 14:51

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

Mittwoch, 22. Oktober 2014, 15:32

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

9

Mittwoch, 22. Oktober 2014, 16:18

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

Mittwoch, 22. Oktober 2014, 18:04

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)

Quellcode

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

Donnerstag, 23. Oktober 2014, 12:13

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

Freitag, 24. Oktober 2014, 21:04

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