How to get current x position of a HorizontalScrollArrangement

Dear Friends,

I have a HorizontalScrollArrangement and I've placed a canvas inside it.
The canvas width is 2000 pixels (very wide), and the height is set to "fill parent".
When the app runs, obviously I can scroll the canvas to left and right.

Now, is there a way to know the current X position of the scroll?
The reason for that is: I have placed two sprites on the canvas. I want when I scroll the canvas, the sprites automatically come to the center of the visible part of the canvas.

I hope my question is clear. The complete code is very long and confusing, but I can send a small example if needed.

Thanks,
Sirous

You will need a scroll handler extension for this:

https://puravidaapps.com/extensions.php

Two I know of, one by ColinTree (supposedly a bit buggy) and the other by vknow360

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.