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
Code
<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>
Display More