I was wondering if anyone knows if it is possible to zoom in and out of scene view in composer. Anyone run into this and know?
Thanks!
Alan
I was wondering if anyone knows if it is possible to zoom in and out of scene view in composer. Anyone run into this and know?
Thanks!
Alan
Have you tried scaling the sceneGroup (or equivalent) display group within which all your display objects are inserted? This is definitely a rather inelegant solution, but it does work for the most part.
I have. The problem is that it doesn’t zoom from the center of the screen and I can’t determine how to set the zoom point. Setting anchorX and anchorY doesn’t seem to work.
Not sure if this is what you’re looking for but in case you haven’t had a look already, it’s worth reading – http://coronalabs.com/blog/2013/01/22/implementing-pinch-zoom-rotate/
Yeah. That’s interesting but I can’t see how it helps here. I’m just looking to scale the whole scene at the start to say, twice the size, and then zoom out. It’s not clear to me where in that article I can find something like that.
I guess if I can’t just do this with the scene view then I’ll skip it.
BUT, if there are other suggestions, I’d love to hear them.
You’re going to have to use some math/trial-and-error to figure out the relative center of your sceneobject object and the scale to which you want to zoom in/out. I was able to get this working in another project. Where are you seeing problems? Can you post your function so far?
unless one of composer’s built-in “zoom” transitions does exactly what you want, you probably shouldn’t directly mess with the scene’s .view group as it has some odd anchoring to make the transitions work.
you’ll likely find it easier to create your own display group, insert that into the scene’s view group, then insert the rest of your display objects into this “zoomer” group (or groups), and scale THAT group instead.
Good call Dave, I was just looking over that project to remember how I achieved it, and I used the mechanic you’re describing.
Have you tried scaling the sceneGroup (or equivalent) display group within which all your display objects are inserted? This is definitely a rather inelegant solution, but it does work for the most part.
I have. The problem is that it doesn’t zoom from the center of the screen and I can’t determine how to set the zoom point. Setting anchorX and anchorY doesn’t seem to work.
Not sure if this is what you’re looking for but in case you haven’t had a look already, it’s worth reading – http://coronalabs.com/blog/2013/01/22/implementing-pinch-zoom-rotate/
Yeah. That’s interesting but I can’t see how it helps here. I’m just looking to scale the whole scene at the start to say, twice the size, and then zoom out. It’s not clear to me where in that article I can find something like that.
I guess if I can’t just do this with the scene view then I’ll skip it.
BUT, if there are other suggestions, I’d love to hear them.
You’re going to have to use some math/trial-and-error to figure out the relative center of your sceneobject object and the scale to which you want to zoom in/out. I was able to get this working in another project. Where are you seeing problems? Can you post your function so far?
unless one of composer’s built-in “zoom” transitions does exactly what you want, you probably shouldn’t directly mess with the scene’s .view group as it has some odd anchoring to make the transitions work.
you’ll likely find it easier to create your own display group, insert that into the scene’s view group, then insert the rest of your display objects into this “zoomer” group (or groups), and scale THAT group instead.
Good call Dave, I was just looking over that project to remember how I achieved it, and I used the mechanic you’re describing.