Help on coding a Hotspot  

Share your tips and tricks here or get help with any Panotour problem!
No bug reports (of any kind) in this forum!
no avatar
marco.lanciani
Member
 
Posts: 157
Joined: Thu Feb 23, 2006 2:55 pm
Location: Italy - Roma

Help on coding a Hotspot

by marco.lanciani » Sat Nov 20, 2010 2:25 am

This is the code generated by PTP:

Code: Select all
    <!--************** Hotspots and lensflares ***************************************************-->
    <hotspot name="spot1" onclick="action(closeglobalobjects);action(closeallobjects);set(plugin[spot1object].visible,true);tween(plugin[spot1object].alpha, 1);" bordercolorhover="0xffffffff" borderalphahover="0.501961" fillcolorhover="0xffffffff" fillalphahover="0.25098">
        <point ath="402.367" atv="-3.9668"/>
        <point ath="419.457" atv="-5.07286"/>
        <point ath="419.252" atv="9.23766"/>
        <point ath="402.204" atv="7.16097"/>
    </hotspot>
    <plugin name="spot1object" visible="false" url="indexdata/graphics/spots/object0.png" align="center" alpha="0" onclick="action(closeglobalobjects);tween(alpha, 0);delayedcall(0.5,set(visible,false));" width="600" height="prop"/>
    <hotspot name="spot2" onclick="action(closeglobalobjects);action(closeallobjects);set(plugin[spot2object].visible,true);tween(plugin[spot2object].alpha, 1);" url="indexdata/graphics/spots/spot0.png" onhover="showtext(Zoom);" ath="419.163" atv="9.21974"/>
    <plugin name="spot2object" visible="false" url="indexdata/graphics/spots/object0.png" align="center" alpha="0" onclick="action(closeglobalobjects);tween(alpha, 0);delayedcall(0.5,set(visible,false));" width="600" height="prop" onhover="showtext(Zoom);"/>
    <!-- close all hotspots -->
    <action name="closeallobjects">set(plugin[spot1object].alpha, 0);set(plugin[spot1object].visible,false);set(plugin[spot2object].alpha, 0);set(plugin[spot2object].visible,false);</action>

What I need is the area hotspot (spot1) to appear on over/hover the image hotspot (spot2)
and to open the linked image (object0.png) only clicking on spot2 (that is, spot1 inactive as a link but active to show the area interested).
Attached an image.

I think I need the "parent tag": I tried but maybe I'm doing something wrong.

Also I'd like the image (object0.png) to open on a dark transparent background and the possibility to add a title (up) and a text description (down)

I'm starting to understand how krpano works but, you know, a full krpano GUI would help a lot, even a buggy one. :)

Thanks in advance for your help.
Marco



no avatar
mediavets
Moderator
 
Posts: 14268
Joined: Wed Nov 14, 2007 2:12 pm
Location: Isleham, Cambridgeshire, UK.

by mediavets » Sat Nov 20, 2010 10:40 am

marco.lanciani wrote:What I need is the area hotspot (spot1) to appear on over/hover the image hotspot (spot2)
and to open the linked image (object0.png) only clicking on spot2 (that is, spot1 inactive as a link but active to show the area interested).

I think I need the "parent tag": I tried but maybe I'm doing something wrong.

I guess I don't really understand what effect you are trying to achieve because I don't understand why you need to use two hotspots.

On the face of it it would appear that you could do this with a single polygon hotspot.

Also I'd like the image (object0.png) to open on a dark transparent background and the possibility to add a title (up) and a text description (down)

So just make the transparent background and title and descriptive text part of the PNG image.

See screenshot sequence.








Last edited by mediavets on Sat Nov 20, 2010 11:04 am, edited 1 time in total.
Andrew Stephens
Many different Nodal Ninja and Agnos pano heads. Merlin/Panogear mount with Papywizard on Nokia Internet tablets.
Nikon D5100 and D40, Sigma 8mm f3.5 FE, Nikon 10.5mm FE, 35mm, 50mm, 18-55mm, 70-210mm. Promote control.

no avatar
marco.lanciani
Member
 
Posts: 157
Joined: Thu Feb 23, 2006 2:55 pm
Location: Italy - Roma

by marco.lanciani » Sat Nov 20, 2010 1:18 pm

Actually I need only one hotspot. I created 2 hotspots just to try to merge the code.
This is the effect I'm looking for:
to highlight the area (the shape) of the linked object when moving the mouse on the loop image. Then open the image clicking either on the small loop image or the area highlighted.
I hope you understand now.

As for the text, that's a solution but I'd like to do the same by coding, that is, using the "textfield" plugin or something like the Highslide JS, which is not included in krpano/PTP.
Regards,
Marco

no avatar
mediavets
Moderator
 
Posts: 14268
Joined: Wed Nov 14, 2007 2:12 pm
Location: Isleham, Cambridgeshire, UK.

by mediavets » Sat Nov 20, 2010 1:58 pm

marco.lanciani wrote:Actually I need only one hotspot. I created 2 hotspots just to try to merge the code.
This is the effect I'm looking for:
to highlight the area (the shape) of the linked object when moving the mouse on the loop image. Then open the image clicking either on the small loop image or the area highlighted.
I hope you understand now.

I think I may understand now.

I found a way that I think gets close to the effect you want.

First place a Point hotspot with your loop image as the Display Object (I've used a regular theme icon in this demo, but you can instead choose a custom graphic).

Then place a Polygon hotspot over the top of the Point hotspot which links to your 'pop-up' image.

That way your object's outline will be displayed when the viewer rolls overs the loop image (and a larger area than that of course) and clicking will display the 'pop-up' image.

Is that good enough?

As for the text, that's a solution but I'd like to do the same by coding, that is, using the "textfield" plugin or something like the Highslide JS, which is not included in krpano/PTP.
Regards,
Marco

I don't think you can get that effect using the "textfield" plug-in.










Last edited by mediavets on Sat Nov 20, 2010 2:28 pm, edited 1 time in total.
Andrew Stephens
Many different Nodal Ninja and Agnos pano heads. Merlin/Panogear mount with Papywizard on Nokia Internet tablets.
Nikon D5100 and D40, Sigma 8mm f3.5 FE, Nikon 10.5mm FE, 35mm, 50mm, 18-55mm, 70-210mm. Promote control.

no avatar
mediavets
Moderator
 
Posts: 14268
Joined: Wed Nov 14, 2007 2:12 pm
Location: Isleham, Cambridgeshire, UK.

by mediavets » Sun Nov 21, 2010 2:29 pm

Marco,

What did you think of my suggested 'solution'?
Andrew Stephens
Many different Nodal Ninja and Agnos pano heads. Merlin/Panogear mount with Papywizard on Nokia Internet tablets.
Nikon D5100 and D40, Sigma 8mm f3.5 FE, Nikon 10.5mm FE, 35mm, 50mm, 18-55mm, 70-210mm. Promote control.

no avatar
marco.lanciani
Member
 
Posts: 157
Joined: Thu Feb 23, 2006 2:55 pm
Location: Italy - Roma

by marco.lanciani » Sun Nov 21, 2010 3:12 pm

Hi Andrew,

sorry to be so late on answering and, yes, your solution is good. :)

Marco


Return to Using Panotour / Panotour Pro 1.8

Who is online

Users browsing this forum: No registered users and 1 guest