Zooming and Pinch to Zoom Open Source

colburt187

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


colburt187

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

airman4

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

And can we put a progressive zoom in ?

colburt187

  • *
  • Posts: 2375
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: 860
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: 860
Anyway zoom out and zoom in works !!
Congratulations !

squeeb

  • Posts: 1508
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: 2375
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: 1508
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: 2375
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: 1508
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

rature

  • *
  • Posts: 16
ThankYou Squeeb !! ThankYou Colburt187 !
Zoom In/Out works perfect on MacDesktop,
I work with "terrain " and didn't see a problem for now.
Zooming gives a lot of dynamism to my platformer, so thanx again !!
follow me :  https://rature.itch.io/  :)

squeeb

  • Posts: 1508
ThankYou Squeeb !! ThankYou Colburt187 !
Zoom In/Out works perfect on MacDesktop,
I work with "terrain " and didn't see a problem for now.
Zooming gives a lot of dynamism to my platformer, so thanx again !!
You got it working! Cool.  My version or colburts?

rature

  • *
  • Posts: 16
I used the version of colburt,
I tried yours first, but some blocks events were missing (you can see in the attached files) so I installed the missing extensions :
easyMath / colorUtils / Label / tracingMotion . But nothing changed
Maybe it's because your Version < 4.0 ?
follow me :  https://rature.itch.io/  :)