Parallax Problems - Set Focus / Camera Issue - Lime

I'm trying to get Parallax working on my new side-scrolling project, but am having issues with getting the camera to focus. When parallax is enabled, the camera seems to be on a different layer or something -- it no longer focuses correctly and follows the target object. Instead, it seems to hang around the screen width instead of the stage width.

I have the ParallaxEnabled set to true on the map settings, parallaxBase setting on the "Platforms" layer and have a parallaxFactorX value of .5 on the Background layer. Any help getting this to work would be really appreciated.

Thanks a lot,
Clay

I'm now thinking this may have something to do with the xOffset variable in the map:setFocus function. Currently, I am not setting this value. Could you help me figure out how I'd compute it / if this might be related?

EDIT:

I take that back,the xOffset doesn't seem to help. The camera's bound width seems to only stretch about half the stage when it is focusing on an object. sliding works fine, however.

Thanks again,
Clay

Does the ParallaxAndPlayer sample work as I think that uses the setFocus() stuff?

Hey Graham,

The problem seems to be with the map:slideToPosition function. setFocus() works fine, but slideToPosition seems to not be locked to the parallaxBase layer or something.

It would be great if you could help me work this out -- the parallax really looks beautiful and I'd love to include it in the first release of my upcoming game!

Thanks for the quick response and the help so far!

- Clay

views:1501 update:2012/1/10 9:16:25
corona forums © 2003-2011