limit dragable layer within the screen / canvas area

  • id notice this script an xml example of dragablelayer totally can drag out of screen / canvas area..

    anyway how to limit it with in canvas / screen

    thanks

  • Hi,

    that might be possible, but some work...

    after these calls:
    add(x, drag_currentx, dx);
    add(y, drag_currenty, dy);

    you would need to:
    - check if the correct x/y coordinates plus the current element size (pixelwidth,pixelheight) is within the screen (stagewidth,stageheight)
    - therefore it would be also necessary to check the 'edge' setting of the element and also add the ox/oy settings

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!