Zooming and Pinch to Zoom Open Source

colburt187

  • *
  • Posts: 2346
are you making a mobile game?


colburt187

  • *
  • Posts: 2346
ok thats good, elements that are anchored to the screen like Buttons are not affected by the zoom.

airman4

  • Posts: 859
Its works !! thanx !!
How the number works ?
Can we put negative numbers ?

And can we put a progressive zoom in ?

colburt187

  • *
  • Posts: 2346
I think 1 is normal zoom, a lower number is zoom out and a higher is zoom in. I don’t really know what the limits are, 0.5 seemed like a big zoom out but sure try -0.1 or something, see what happens then let us know.

airman4

  • Posts: 859
i tried and its crazy weird (negative number ) lol
its kinda push the screen a part to the left ? we see a quick movement of the screen and i get a reload
When my character falls in the screen its reload
so i guess its a bad idea

airman4

  • Posts: 859
Anyway zoom out and zoom in works !!
Congratulations !

squeeb

  • Posts: 1488
one major flaw at the moment is it doesn't work well with tiles, have you noticed that Squeeb? Maybe Justin can look at that. Currently its working in my game, i'm using actors for the ground.

i agree tiles are an issue with zooming for some reason.. and any other graphics scale other than 1x.. all others make the view of the scene in the top left corner of the device.. and you only see a small portion of what you should be able to see of the game...  i made fixes for joysticks and text issues with mine.. ill try yours out soon!!

colburt187

  • *
  • Posts: 2346
Mine is just the very basics, the engine zoom set to an attribute, I need to have a look to see what fixes you did for text, I noticed that was scaling with the zoom.

squeeb

  • Posts: 1488
Mine is just the very basics, the engine zoom set to an attribute, I need to have a look to see what fixes you did for text, I noticed that was scaling with the zoom.
for the text fix use a code block in your drawing event like this
engine.g.graphics = engine.hudLayer.graphics;

and then this as well afterwards
engine.g.graphics.clear();

colburt187

  • *
  • Posts: 2346
Squeeb, Im having a bit of a weird issue on iOS, if i draw test one one scene it continues to draw on all scenes, even if the actor im drawing from does not exist on that scene.

squeeb

  • Posts: 1488
Squeeb, Im having a bit of a weird issue on iOS, if i draw test one one scene it continues to draw on all scenes, even if the actor im drawing from does not exist on that scene.
Weird.  I dont have a mac yet.. i havent tried ios yet.

Its in a drawing event?  I wonder if we have to use the

engine.g.graphics = engine.hudLayer.graphics;

and then this as well afterwards
engine.g.graphics.clear();

Or if thats just for text