I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: bacondounut on April 22, 2014, 07:16:44 PM

Title: how do you zoom?
Post 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.
Title: Re: how do you zoom?
Post by: Sephalos on April 22, 2014, 08:22:20 PM
view_wview[0] -= number;
view_hview[0] -= number;

view_xview[0] += number;
view_yview[0] += number;

Have fun
Title: Re: how do you zoom?
Post by: bacondounut on April 22, 2014, 09:47:27 PM
what do I put in it to zoom at the player?
Title: Re: how do you zoom?
Post by: YoSniper on April 22, 2014, 10:56:02 PM
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.
Title: Re: how do you zoom?
Post by: Sephalos on April 23, 2014, 12:32:27 AM
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)
Title: Re: how do you zoom?
Post by: Sephalos on April 23, 2014, 04:45:37 PM
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)