I Wanna Community
Fangames => Game Design => Programming Questions => Topic started by: bacondounut on April 22, 2014, 07:16:44 PM
-
can some one tell me how to make the camera zoom in and out please.
In game maker.
-
view_wview[0] -= number;
view_hview[0] -= number;
view_xview[0] += number;
view_yview[0] += number;
Have fun
-
what do I put in it to zoom at the player?
-
I'm pretty sure the easiest way (assuming you're using Game Maker) is to manipulate view_wview and view_hview, but keep the view ports the same.
A smaller view_w(h)view means greater magnification.
-
As far as I know, there's no easy way to zoom in on a specific object. I don't have too much experience with views my self.
You'll need to do your math with these variables:
the player's x position (player.x)
the player's y position (player.y)
the view's x position (view_xview)
the view's y position (view_yview)
the view's width (view_wview)
the view's height (view_hview)
-
Alright so I was curious to see if I could do it.
Here is a prototype I made in a few minutes, hope this helps.
Prototype: Zoom in & out on objects (https://www.mediafire.com/download/e971per6zfzbbs0/prototype+zoom+objects.zip)