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.

  • "nonchiedercilaparola" started this thread

Posts: 148

Location: Italy

Occupation: Freelance Fotographer

  • Send private message

1

Wednesday, December 4th 2013, 6:06pm

hotspot as a parent for a layer doesn't work?

Hi, i would like to use skin_bottonglow function over my layer and over my hotspot so i have change the default skin_bottonglow function because in the log i have this error: "no parent 'btn-gallery-bagni2' found" and the glow effect doesn't appear over the hotspot.
This is my code (my changes in red):



if(%1 != null,
set(strength,0.7);
if(%2 != null, set(strength,%2));
if (hotspot[1%].name === %1,
set(layer[skin_buttonglow].parent, hotspot[1%]);,
set(layer[skin_buttonglow].parent, %1);
);
set(layer[skin_buttonglow].visible, true);
tween(layer[skin_buttonglow].alpha, get(strength), 0.07);
,
tween(layer[skin_buttonglow].alpha, 0.0, 0.1, default, set(layer[skin_buttonglow].parent, null); set(layer[skin_buttonglow].visible, false); );
);

but the i get the same error. so i'm thinking is it possible to have an hotspot like a parent for a layer?

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Thursday, December 5th 2013, 8:57am

Hotspots and layers are in different "dimensions"! Hotspots are inside panorama while layers are on the screen. So it is impossible to set hotspot as parent for a layer. Instead, create a "glow" hotspot using the same crop as the "buttonglow" image and use this hotspot to "jump" over other hotspots.
Regards,

Alexey

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

3

Friday, December 6th 2013, 3:31pm

Not true, i use hotspots as parents for layers all the time.

His problem is not the hotspot parent, but the layer parent. It is not found.

Hotspots and Parents
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

4

Friday, December 6th 2013, 3:41pm

Sorry, didn't know that.
Regards,

Alexey

Arsdezi

Intermediate

Posts: 174

Location: Ukraine

  • Send private message

5

Friday, December 6th 2013, 3:48pm

Not true, i use hotspots as parents for layers all the time.

His problem is not the hotspot parent, but the layer parent. It is not found.
Hotspots and Parents


you have a working example of this function? Very be interesting to see its use! *question*
Tnx!

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

6

Friday, December 6th 2013, 4:10pm

Okay, I've made a quick test with the standard skin and went the easiest way: joined styles for hotspots:

Source code

1
<hotspot name="spot1" style="skin_hotspotstyle|skin_glow" ath="53.498" atv="13.032" linkedscene="scene_25" />


I see the error that "ERROR: no parent "spot1" found". However, I see the glow layer somewhere near the middle of the screen.

Check out the link:

http://vt-vr.most-inform.com/glow_test/

I suppose there must be some further playing with sphere to screen to calculate where the glow layer must appear.
Regards,

Alexey

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

7

Friday, December 6th 2013, 5:01pm

Not true, i use hotspots as parents for layers all the time.

His problem is not the hotspot parent, but the layer parent. It is not found.
Hotspots and Parents


you have a working example of this function? Very be interesting to see its use! *question*
Tnx!


layers with hotspot parents look like just two hotspots next two each other. Use ox and oy for positioning.

hotspots with hotspot parents are really strange though. I suggest you try that!
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

8

Friday, December 6th 2013, 8:37pm

This action almost works)))

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<action name="skin_buttonglow">
		if(%1 != null,
			set(strength,0.7);
			if(%2 != null, set(strength,%2));
			ifnot(hotspot[get(name)].name == %1,set(layer[skin_buttonglow].parent, %1););
			set(layer[skin_buttonglow].visible, true);
			if(hotspot[get(name)].name == %1,
			set(layer[skin_buttonglow].align,lefttop);set(layer[skin_buttonglow].edge,top);
			spheretoscreen(ath,atv,glow_x,glow_y);
			set(layer[skin_buttonglow].x,get(glow_x));set(layer[skin_buttonglow].y,get(glow_y)); 
			);
			tween(layer[skin_buttonglow].alpha, get(strength), 0.07);
		  ,
			tween(layer[skin_buttonglow].alpha, 0.0, 0.1, default, set(layer[skin_buttonglow].parent, null); set(layer[skin_buttonglow].visible, false); );
			delayedcall(0.1, set(layer[skin_buttonglow].align,center);set(layer[skin_buttonglow].edge,null);set(layer[skin_buttonglow].x,0);set(layer[skin_buttonglow].y,1););
		  );
		 
	</action>

Check out the link again:
http://vt-vr.most-inform.com/glow_test/
Regards,

Alexey

This post has been edited 1 times, last edit by "Alexey Tkachenko" (Dec 9th 2013, 8:12am)