PDA

View Full Version : How to make a single sprite draggable only when multiple sprites on a draw container



spits79
5 Mar 2015, 4:38 AM
Hello,

I'm in the process of migrating to 5.1 and we have a panel which displays a list of images on the right, in the center there is the full size actual image selected and smaller image overlayed on top which a red rectangle to indicate where on the image you are looking. You can drag the main image around the panel and use the mouse scroll wheel to zoom in and out.

51895

I've tried using multiple draw.container and multipe sprites on a single container and I am not sure which is the correct way to do this. In Ext 4.2 I used 2 draw.components and had the main image in one and the smaller image and the rectangle overlay on the other. Having 2 draw.containers seems to match this idea.

Secondally it seems that you can no longer make sprites draggable but it has to be on the draw.container instead (at least according to the documentation), in 4.2 I made the image sprite draggable = true. This is fine as I have just made the draw.component the same size as the sprite but the problem there is that even if I set the image to be constrain : false you can't drag the draw.container so that any of the image is rendered outside the bounds of the browser. So if the image displayed is larger than the dimensions of your browser window then you can't drag the image at all. Is there a way around this. Or is this all looking at the wrong thing.

Should I perhaps be looking at image instead of draw for this?