You are not logged in.

mauma

Beginner

  • "mauma" started this thread

Posts: 24

Location: Lucca - Italy

Occupation: Photographer / Virtual Tour

  • Send private message

1

Sunday, March 31st 2019, 12:42pm

move layer in mouse position on click

Hi everyone, I don't understand how to do this:

I have two layers, one parent, I wish that when I click in the parent the child moves in the position of click.

I started with the krpano drag-layer example

The way I found works if I set the child with align = center, but unfortunately being connected to another script I can't move it.

The result is that when you click, the child level moves but with the parent's coordinates

Someone can help me

Thank you

Kima

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
<action name="clickhere">

screentolayer(get(box1), mouse.stagex,mouse.stagey, msx, msy);

set(layer[box2].x, get(msx));set(layer[box2].y, get(msy));

</action>

	<layer name="box1" type="container" align="center" edge="center" x="0" y="0" width="550" height="550" bgcolor="0x000000" bgalpha="0.5" bgcapture="true" maskchildren="false" onclick="clickhere();">

		<layer name="box2" type="container" edge="center" align="center" width="100" height="100" bgcolor="0x44AADD" bgalpha="1.0" bgcapture="true" ondown="draglayer();">

	</layer>	</layer>

mauma

Beginner

  • "mauma" started this thread

Posts: 24

Location: Lucca - Italy

Occupation: Photographer / Virtual Tour

  • Send private message

2

Saturday, April 27th 2019, 4:35pm

It's possible? Does nobody know? *cry*
thanks
mauma