Clamp a transition

In Lime I have made it easier for a user to move the “camera” around using various helper functions including transitions and in all of these functions I clamp the position of the “camera” to within the maps bounds and this works great however I have come across a problem when using my helper function that allows sliding/scrolling of the map.

When I start the transition I register an enterFrame handler to continuously call my clamp function however the transition seems to override the actual position so that my clamped position is only used when the transition ends.

Any idea on a possible solution to this? [import]uid: 5833 topic_id: 5455 reply_id: 305455[/import]

Maybe instead of calling Corona’s transition commands directly you should write your own transition function that clamps the end position before calling Corona’s transition command. [import]uid: 12108 topic_id: 5455 reply_id: 18317[/import]

That sounds like a very good solution! I will give it a go and report back. [import]uid: 5833 topic_id: 5455 reply_id: 18318[/import]

Yup, that is done and works great! Thank you for your quick response :slight_smile: [import]uid: 5833 topic_id: 5455 reply_id: 18322[/import]

Dont know how easy you found writing a transition function, but I found it to be a couple of days to replicate the corona transitions with full functionality. If you like maybe you could TTY modifying my pausable transition code to include clamp parameters: https://developer.anscamobile.com/forum/2010/11/20/pausable-transitionstween [import]uid: 8271 topic_id: 5455 reply_id: 18460[/import]

All I did was clamp the position first and then start the transition to that new position :slight_smile: However having it all in one would be very nice. [import]uid: 5833 topic_id: 5455 reply_id: 18525[/import]