Is It Possible to create a Draggable Layer

  • krpano 1.18
    working from standard vTourSkin.xml

    I would like to move the map layer out of the scroll_layer into its own layer so ive moved it to its own map_layer under the scroll_layer.


    I've also added a small button image as the first layer inside the map_layer. I would like to be able to have the user mousedown on the button and drag the layer around the screen.

    Is it possible to do this? Any example xml markup available?

    Thanks

  • RESOLVED

    Thank you for the link Umalo. I had seen another example like this and it was a conformation that it was possible, however it offered no markup example.

    I was able to hobble some markup code that seems to work:

    The Action

    Code
    <action name="draglayer">
      if(dragging, 
    	set(layer[your_layername].x,get(mouse.stagex));
    	set(layer[your_layername].y,get(mouse.stagey));
    	delayedcall(0,draglayer());
    	);
    </action>

    Calling the Action

    Code
    ondown="set(dragging,true); draglayer();" onup="set(dragging,false);"

    I wanted the image, and the control bar to still be available, and had to make sure bgcapture='false'. This allowed the rest of the UI to remain active.


    Thanks again

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!