Jon? REALLY need zoom in IOS, trying to fake it, haven't figured it out


  • Posts: 355
I would LOVE to use the zoom scene behavior, however when I've used it on IOS there is a problem, the game begins to only use the top left corner of the screen, and the rest goes black. It's too bad, because the pinch to zoom behavior I came up with for IOS was working...but in a tiny corner of the screen, due to this strange trouble the Zoom Scene behavior has on IOS. Getting Zoom Scene behavior to work properly on IOS would be much better than the complicated work around that I have been failing to engineer here.


  • Posts: 382
Ok I kind of would like a zoom out feature.  And from reading all this , seems quite complicated.

What if the game is paused, can you zoom out a little to show entire / more of level easier?

I have scenes that are nearly 960 in width.. I want it to zoom out from iphone normal screen landscape width of 480 to around 600, meaning it shows from 0 x to 600 x ....   It can be paused, kind of like a quick zoom out to preview entire scene or majority of it.

Any way via events or behaviors without calling additional outter code? 


  • Posts: 12
After following this conversation, just want to agree that a solid working solution to a zooming behaviour would be an incredible boost to Stencyl. With the limits of iOS screen sizes it really would be a game changer for many projects.
I was very glad to see the posts from MeToo and Hectate and this post is just an encouragement for you to hopefully push forward to reach a stable solution.

Thanks for your efforts guys


  • Posts: 783
Its long time after last post here. Maybe You allready found the solution. If Yes, could You write some details about it? Looks like it is hard to finnish most of the games without this behavior.


  • Posts: 5
I figured out what's going on.  The Scene Zoom is not taking into account the GameEngine scale.  Basically, if it's Scaled to 2x, you're only going to get the top left quarter of the screen, because it's not selecting everything.

If you were to extend the selection by the scale, it works.  I'm not sure what the variable name is that holds this value, but it's there somewhere.  I was able to get it working by hardcoding the following:

I added a scale multiplier to these two lines (the "*2"):
Engine.screenWidth = ( * (1 / __Multiplier)*2));
Engine.screenHeight = ( * (1 / __Multiplier)*2));

So the code ends up being:
Engine.engine.root.scaleX = __Multiplier;
Engine.engine.root.scaleY = __Multiplier;
Engine.screenScaleX = __Multiplier;
Engine.screenScaleY = __Multiplier;
Engine.screenWidth = ( * (1 / __Multiplier)*2));
Engine.screenHeight = ( * (1 / __Multiplier)*2));
Engine.engine.master.getChildAt(0).width = Engine.screenWidth;
Engine.engine.master.getChildAt(0).height = Engine.screenHeight;
Engine.engine.root.scrollRect = new nme.geom.Rectangle(0,0,Engine.screenWidth,Engine.screenHeight);

Also, in the Zoom Scene behavior, you need to add a "Created" Event and add a Zoom To "1" block.

Hope this helps!


  • Posts: 783
Thanks for answer but it unfortunaetlly haven't helped. It not working only for the tiles. The normal actors works with whis behavior well. Also on android it works well even with the tiles (api and not api). So something holding the values for flash tiles only. After I added the *2, only every actors which were possitioned as screenwidth/something gone. So it changed the global screenwidth and screenhigh values but not working with tiles.

Also interesting is that these lines shold be used for android and for flash they should to be deleted :

Engine.screenScaleX = __Multiplier;
Engine.screenScaleY = __Multiplier;

« Last Edit: January 01, 2014, 09:07:21 am by zawrot13 »