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

Sunday, April 7th 2013, 7:49pm

Implementing Tooltips in 1.16

I'm looking at the HTML5 tooltips example pano. http://krpano.com/examples/116/examples/…s/tooltips.html

However, I have not found any tutorial or code example provided in the dox. The closest I can come is to manually edit the URL address above to obtain its XML file. http://krpano.com/examples/116/examples/…ps/tooltips.xml

I looked it over, understand what is happening, but when I copy the relevant code (removing fade-in/out calls) to my own XML's generated with Kolor's PTP, I do NOT get any mouseover tooltips on a PC the same as with the demo (flash disabled, thus forced HTML5). Not expecting anything on mobile devices, so that's not an issue, but on desktops it is.

This is the code added/edited to one of my tour pano XMLs...

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<hotspot name="spot67" hview="90.85" vview="7.38" fovview="65" hcenter="15.3562" vcenter="0.47619" 
onclick="looktohotspot(get(name),get(view.fovmin),smooth(400,20,100));
mainloadpano(tour1.xml);
lookat(get(hview),get(vview),get(fovview));" 
url="tourdata/graphics/spots/spot0.png" ath="15.3562" atv="0.47619" 
style="tooltip"
tooltip="Office or Formal Dining" />

<!-- the 'tooltip' style - show tooltip textfield -->
<style name="tooltip" 
onover="copy(layer[tooltip].html, tooltip); 
set(layer[tooltip].visible, true);" 
onout="set(layer[tooltip].visible,false);"/>

<!-- the 'tooltip' textfield -->
<layer name="tooltip" keep="true" url="plugins/textfield.swf" parent="STAGE" visible="false" alpha="0" 
enabled="false" align="lefttop" edge="bottom" oy="-2" width="200" autoheight="true" background="true"
 backgroundcolor="0xFFFFFF" backgroundalpha="0.7" border="false" roundedge="7" shadow="0" 
textshadow="0" css="text-align:center; color:#000000; font-family:Arial; font-weight:bold; font-size:14px;" 
html=""/>


Since this is NOT working, even after clearing the browser's cache, there must be some OTHER code in another file to enable this. What and where is it?

That or please provide specific steps to implement this new option manually to existing XMLs.

jsimpson

Beginner

Posts: 10

Location: United States

Occupation: Programmer

  • Send private message

2

Sunday, April 7th 2013, 10:30pm

Implementing Tooltips in 1.16

Set the alpha value and the textfield position in the onover event of the tooltip style.

Try adding these two lines to the tooltip style:

set(layer[tooltip].alpha, 1.0);
asyncloop(hovering, copy(layer[tooltip].x,mouse.stagex); copy(layer[tooltip].y,mouse.stagey); );

The asyncloop continuously updates the textfield position.

3

Monday, April 8th 2013, 12:15am

asyncloop(hovering, copy(layer[tooltip].x,mouse.stagex); copy(layer[tooltip].y,mouse.stagey); );

The asyncloop continuously updates the textfield position.
Thanks! Updating the layer x y with mouse x y and setting the alpha was the solution (the layer's alpha=0 and visible=false looked suspicious, but it didn't click to fiddle with them). Since I don't want the tool tip to follow the mouse, I removed the asyncloop function call.

Now, I'd be truly happy if there was a way to auto-fit the width of the background to only the changing width of the HTML content.

4

Sunday, December 15th 2013, 10:55am

Set the alpha value and the textfield position in the onover event of the tooltip style.

Try adding these two lines to the tooltip style:

set(layer[tooltip].alpha, 1.0);
asyncloop(hovering, copy(layer[tooltip].x,mouse.stagex); copy(layer[tooltip].y,mouse.stagey); );

The asyncloop continuously updates the textfield position.

Hi there !

I'm new here and I've done a search on the forum. Here seems to be the most appropriate place for this question :

I have 2 polygon hotspots into panotour pro v2.
I would like them to be visible together when mouse is "onover" "onhover" on of them. I would like that both tooltips be visible as well together. So the first tooltip would appear next to the cursor, and the second tooltip would be displayed at one fixed place.
Do you think this is possible ?
Thank you for your help !
Cyril

5

Sunday, December 15th 2013, 12:46pm

I have tried this code to make the polygon appear:
It works exept for tooltip... do you understand why ?

<hotspot name="spotpolygon1"
visible="true"
style="Polygonpolygonevertimage80%"
descriptionid=""
onclick="onclickspotpolygon1"
tooltip="spotpolygon1_tooltip"
onover="displaypolygon2"
>

<action name="displaypolygon2">
set(hotspot[spotpolygon2].borderalpha, 1);
set(hotspot[spotpolygon2].fillalpha, 0.7);

set(tooltip[spotpolygon2_tooltip].alpha, 1); <--- is this alright ?
</action>


Maybe because tooltip have to be assigned to a fixed x,y position ?
Thanks again for your help !

This post has been edited 3 times, last edit by "aircamera" (Dec 15th 2013, 1:53pm)