How to drag sprite and canvas separately

Dear experts,

I have a HorizontalScrollAlignment, in which I've placed a canvas 2000 pixels wide (yes, very wider than screen size!).

When the app runs, the canvas can be dragged to left and right, as expected.

I've got four sprites on the canvas. I've written the blocks to drag the sprites. They work as expected when there is no canvas. But in the presence of the canvas, when I try to drag the sprites, the canvas itself is dragged.

The ideal scenario would be drag the canvas only when somewhere OUTSIDE the sprites is touched.

Could you please help?

Hi Sirous

I think the trick is not to use an Arrangement, given that the Canvas can be dragged independently.

You moved the Sprites without a Canvas? I thought sprites had a Canvas dependency......

Of course they are on the canvas.
I meant, for testing purposes, I set the canvas size so that it fits on the screen and thus it doesn't drag. In this condition, dragging of sprites works just fine.

Scott Ferguson posted on large Canvases at

1 Like