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

Wednesday, October 18th 2017, 9:35pm

Polygon hotspot and the picture above it (or beside it).

Hi! I want to make polygonal hotspot caused the image that would be as close as possible attached to him. As a parent/child does not work in polygon hotspots, I made it so that the mouse coordinates passed to the layer with the image. If you move the cursor off the polygonal hotspot, the image should disappear. But there is a problem! When I put my cursor over the hotspot, the picture turns on and off. Is there a way to make it so that while the cursor is over the polygon, the image would be stable?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<layer name="h_117"  url="117.png" visible="true"  scale="0.1" alpha="1.0"   capture="false" handcursor="false" bgcapture="true"	 enabled="true"  />

<layer url="117.png" visible="false" onloaded="removeplugin(get(name));" />

		<!-- place your scene hotspots here -->
		<hotspot name="hot1" fillcolor="0x37c837" fillalpha="0.5" borderwidth="3.0" bordercolor="0xfc0404" borderalpha="0.0"  capture="false" hovering="true"
	     	depth="1000"
	     	polyline="false"
	     	scaleflying="true"
	     	tx="0"
	     	ty="0"
	     	tz="0"
	     	onover="picture(); tween(layer[h_117].scale, 0.6, 0.2);  tween(alpha, 0.1, 0.25); "
			 ondown="set(fillcolor, 0xc83737)"
			 onout=" tween(layer[h_117].scale, 0.0, 0.3);  tween(alpha, 0.5, 0.25);"
			 onclick="">
			 
		
		<point ath="0.136446" atv="-0.124447" />
		<point ath="0.153899" atv="-0.103399" />
		<point ath="0.174588" atv="-0.119971" />
		<point ath="0.165469" atv="-0.130844" />
	</hotspot>
	
	<action name="picture">
            	set(Y1, get(mouse.y));
            	add(Y1, -20);
            	set(layer[h_117].x, get(mouse.x));
            	set(layer[h_117].y, get(Y1));
	</action>	

2

Thursday, October 19th 2017, 4:17pm

Hi,

you could simply use a hotspot with renderer="css3d" - that would be above the polygonal hotspot.

Currently the drawing order is:
- webgl content - the pano and hotspots by default
- svg content - polygonal hotspots (at the moment, in future versions they will be also webgl)
- html content - hotspots with renderer=css3d and layers

Best regards,
Klaus

3

Monday, October 30th 2017, 10:03am

Thank you for your answer, Klaus! It is very useful! But for future solutions. Now I was helped to answer this question San7
We did so. In order for the mouse to work, it is necessary to remove the cursor from the polygon hotspot.