You are not logged in.

> The forum rules have been updated. Please take a moment to read them.


#1 2012-06-25 04:29:33

loiclg
Member
From: Tasmania
Registered: 2012-02-16
Posts: 15
Website

how to stop autoration when hotspots are clicked ?

Hi

I have a tour with 5 panos and quite a few hotspots (loading flash movies).
What is the best way to code the project so that every time a hotspot is clicked, the autorotation stops ?

Thanks

Loic

Offline

 

#2 2012-06-25 12:55:48

gkaefer
Member
From: Salzburg
Registered: 2009-06-09
Posts: 2670
Website

Re: how to stop autoration when hotspots are clicked ?

following some plugins from my (unbublished) ptp theme template, the plugin names are standard, but ptp default plugins are not containing all the statements I used. The statements are code from krpano.com... so easy for you to find there the xml reference... ,-))

Code:

    <plugin name="autorotationON"
        debug=""
        debug-offset-y=""
        url="$(STYLEDIR)/gigapixel-menu-1a.png"
        width=""
        height="prop"
        blendmode="normal"
        keep="true"
        align="bottom"
        x="0"
        y="33"
        onclick="switch(autorotate.enabled);set(plugin[autorotationON].visible,false); set(plugin[autorotationOFF].visible,true);"
        crop="261|39|25|26"
        onovercrop="261|239|25|26"
        visible="false"
        enabled="true"
        handcursor=""
        zorder="15"
        scale=""
    />
    
    <plugin name="autorotationOFF"
        debug=""
        debug-offset-y=""
        url="$(STYLEDIR)/gigapixel-menu-1a.png"
        width=""
        height="prop"
        blendmode="normal"
        keep="true"
        align="bottom"
        x="0"
        y="33"
        onclick="switch(autorotate.enabled);set(plugin[autorotationOFF].visible,false); set(plugin[autorotationON].visible,true);"
        crop="261|139|25|26"
        onovercrop="261|339|25|26"
        visible="false"
        enabled="true"
        handcursor=""
        zorder="15"
        scale=""
    />

look at the onklick line. that means all listed commands are executed if user is klicking on plugin autorotationOFF or autorotationON...
and in both cases the switch(autorotate.enabled); is used... this can be used for your hotspots too...

open a build0.xml file (name of first pano if you use the default namingcheme of ptp...) and go to Hotspots section...

Code:

    <!--************** Hotspots and lensflares ****************************************************-->
    <hotspot name="spot0" onclick="mainloadpano(build1.xml);" url="builddata/graphics/spots/spot1.png" onhover="showtext(Salzburg - Salzachufer);" ath="-100.541" atv="4.87952"/>

here you also have an onover and onout statement ...

so to change your line containg the hotspots and add the onover="..." and onout="..." statements:

Code:

    <!--************** Hotspots and lensflares ****************************************************-->
    <hotspot name="spot3" onclick="closeallobjects();set(plugin[spot3object].visible,true);tween(plugin[spot3object].alpha, 1);" url="builddata/graphics/spots/spot2.png" onhover="showtext(myimage);" onover="switch(autorotate.enabled);" onout="switch(autorotate.enabled);" ath="77.7207" atv="23.4405"/>

and now ;-) if you go over the hotspot the autorotation will change the state (if until now autorotation is on its now turned off and vice versa...) same with onout statement, if the mouse is leaving the hotspot, autorotation is goin on again...

problem only: is user if disabling autorotation and than going over the hotspot than autorotation is enabled.... this could be captured by an additional if statement inside the onover and onout statements...

krpano docu onover....:
http://www.krpano.com/docu/xml/#plugin.onover

Georg

Last edited by gkaefer (2012-06-25 13:02:23)

Offline

 

#3 2012-06-26 03:17:41

loiclg
Member
From: Tasmania
Registered: 2012-02-16
Posts: 15
Website

Re: how to stop autoration when hotspots are clicked ?

ok I'll give that a try

thanks Georg

Loic

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson