Parallax Scrolling Issue

I have an issue with my parallax scrolling in LD. I have about 20 frames but scrolling stops around two thirds of that can anyone shed some light on how to get the frames scrolling to the very last frame?

When you say ‘frames’ are you referring to screen widths?

If it is stopping it might be related to the camera bounds, do you have it set?

To remove camera bounds you can call  myLevel:setCameraBounds(nil)

Yes i mean screen width. Thanks that helped but i runs on and on it doesn’t stop at the set screen width, is there a way to stop or pause scrolling at a certain point during the parallax scroll.

And whats the difference between:

level:move(dx,dy)

level:moveCamera(x ,y)

i am not understanding when is it best to use one or the other when doing a parallax scroll level.

To make it stop at the end of your level you will need to call setCameraBounds(x1,y1,x2,y2).

When you load the level it actually sets the camera bounds to what it thinks the width and height of the level is;

level:setCameraBounds(0, 0, (level.canvasWidth - self.contentWidth), (level.canvasHeight - self.contentHeight))

This is why I suggested setting it to nil to disable camera bounds.

The function ‘moveCamera’  changes the viewport so for instance you want to start at a certain point in the level whereas ‘move’ has more intelligence to move objects by a delta and wrap them if needed.

There is more info here : http://www.retrofitproductions.com/level-director/utility-library/

I still cannot get this right so my canvas width is 24320 and height 800, when i call setCameraBounds it still doesn’t stop at the end of my level and setting the setCameraBounds(nil) make it just run on pass the end of the level. I am a newbie bear with me i am just stuck at this point just wish the documentations was a bit thorough for a novice as myself to understand.

Is it that the canvas width is too long because when i set the bounds to a lower it stops where i desired it to but not at the end of my level when i specify the bounds for the end of the level?

The bounds check is based on the top left corner of the screen, so when the bounds value is reached at the top left it will stop.

For instance, if your level is 24320 wide and your screen width is 480 and you want it to stop when showing the last full screen width of the level you will need to set the x2 bounds to 24320-480 (level width - screen width).

If you are still having problems then please send me your project so I can figure out why you are not getting the desired results.

Whats the email to send it to you

You can send it to support@retrofitproductions.com

Also, have you looked at the scroller and scroller2 examples projects that ship with LD as they display the current position of the camera?

I sent it . i will look at scroller2 over again to get pass this issue

so i find a solution:

myLevel:setCameraBounds(0, 0, (25600 + 20480), 0) 

after playing with that line the bounds extended to (25600 + 20480). In the LD ui my canvas width is 25600 but when i export and run it the camera bounds stops at half of the width 12800 even though when i open the level lua file the canvas width has a value of 25600, i had to increase the setCameraBounds value.

So i did a little test and created a new project in LD set the canvas width to 25600 and it runs without the previous issue.

so i am not sure what what happened to my previous project why it had the issue stated above.

When you say ‘frames’ are you referring to screen widths?

If it is stopping it might be related to the camera bounds, do you have it set?

To remove camera bounds you can call  myLevel:setCameraBounds(nil)

Yes i mean screen width. Thanks that helped but i runs on and on it doesn’t stop at the set screen width, is there a way to stop or pause scrolling at a certain point during the parallax scroll.

And whats the difference between:

level:move(dx,dy)

level:moveCamera(x ,y)

i am not understanding when is it best to use one or the other when doing a parallax scroll level.

To make it stop at the end of your level you will need to call setCameraBounds(x1,y1,x2,y2).

When you load the level it actually sets the camera bounds to what it thinks the width and height of the level is;

level:setCameraBounds(0, 0, (level.canvasWidth - self.contentWidth), (level.canvasHeight - self.contentHeight))

This is why I suggested setting it to nil to disable camera bounds.

The function ‘moveCamera’  changes the viewport so for instance you want to start at a certain point in the level whereas ‘move’ has more intelligence to move objects by a delta and wrap them if needed.

There is more info here : http://www.retrofitproductions.com/level-director/utility-library/

I still cannot get this right so my canvas width is 24320 and height 800, when i call setCameraBounds it still doesn’t stop at the end of my level and setting the setCameraBounds(nil) make it just run on pass the end of the level. I am a newbie bear with me i am just stuck at this point just wish the documentations was a bit thorough for a novice as myself to understand.

Is it that the canvas width is too long because when i set the bounds to a lower it stops where i desired it to but not at the end of my level when i specify the bounds for the end of the level?

The bounds check is based on the top left corner of the screen, so when the bounds value is reached at the top left it will stop.

For instance, if your level is 24320 wide and your screen width is 480 and you want it to stop when showing the last full screen width of the level you will need to set the x2 bounds to 24320-480 (level width - screen width).

If you are still having problems then please send me your project so I can figure out why you are not getting the desired results.

Whats the email to send it to you

You can send it to support@retrofitproductions.com

Also, have you looked at the scroller and scroller2 examples projects that ship with LD as they display the current position of the camera?

I sent it . i will look at scroller2 over again to get pass this issue