Author Topic: how do you zoom?  (Read 1906 times)

bacondounut

  • Wannabe
  • Posts: 8
  • I have no idea what I am doing(^_^)/
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Mozilla compatible Mozilla compatible
    • View Profile
    • https://www.iwannacommunity.com/forum/index.php?action=profile;area=forumprofile;u=577
  • Playstyle: Keyboard
how do you zoom?
« 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.
« Last Edit: April 22, 2014, 07:21:17 PM by bacondounut »

Sephalos

  • Spike Dodger
  • Posts: 228
  • OS:
  • Windows Vista/Server 2008 Windows Vista/Server 2008
  • Browser:
  • Chrome 34.0.1847.116 Chrome 34.0.1847.116
    • View Profile
  • Playstyle: Gamepad
Re: how do you zoom?
« Reply #1 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

bacondounut

  • Wannabe
  • Posts: 8
  • I have no idea what I am doing(^_^)/
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Mozilla compatible Mozilla compatible
    • View Profile
    • https://www.iwannacommunity.com/forum/index.php?action=profile;area=forumprofile;u=577
  • Playstyle: Keyboard
Re: how do you zoom?
« Reply #2 on: April 22, 2014, 09:47:27 PM »
what do I put in it to zoom at the player?

YoSniper

  • Awexome
  • Global Moderator
  • Spike Dodger
  • Posts: 142
  • People regard me as a programming overlord.
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 34.0.1847.114 Chrome 34.0.1847.114
    • View Profile
    • My YouTube
  • Playstyle: Keyboard
Re: how do you zoom?
« Reply #3 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.
I don't traverse the forums as much anymore. Follow me on Twitter if you want to keep tabs on me!

Twitter: @YoSniperGames
Twitch: yosniper

Streams happen whenever I feel like it.

Sephalos

  • Spike Dodger
  • Posts: 228
  • OS:
  • Windows Vista/Server 2008 Windows Vista/Server 2008
  • Browser:
  • Chrome 34.0.1847.116 Chrome 34.0.1847.116
    • View Profile
  • Playstyle: Gamepad
Re: how do you zoom?
« Reply #4 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)

Sephalos

  • Spike Dodger
  • Posts: 228
  • OS:
  • Windows Vista/Server 2008 Windows Vista/Server 2008
  • Browser:
  • Chrome 34.0.1847.116 Chrome 34.0.1847.116
    • View Profile
  • Playstyle: Gamepad
Re: how do you zoom?
« Reply #5 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