playMaker

Author Topic: Camera zoom 2d map  (Read 1244 times)

MichaelPatriot21

  • Playmaker Newbie
  • *
  • Posts: 23
Camera zoom 2d map
« on: January 30, 2019, 01:57:44 PM »
I'm making a new game using a 2d map (like a board game) and I need to camera to zoom in where the player scrolls up and zoom out when they scroll out. I don't need the camera to follow the player as the game is played on a static 2d map.

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Camera zoom 2d map
« Reply #1 on: January 30, 2019, 07:40:05 PM »
Hey there

I think its the Get Axis action you're looking for if I remember correctly.  That will put out a .1 or -.1 depending on which way the wheel spins.

At that point just need some simple compare actions to tell if the user is still scrolling and if so, continue moving the camera.

Hope that helps.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Camera zoom 2d map
« Reply #2 on: February 06, 2019, 05:05:53 AM »
Hi,

 yes, the axis name is "Mouse ScrollWheel"

the easiest way I know is the following:

1: use a variable acting as the zoom value ( which equates the camera position)
2: add to that variable the axis value,
3: clamp the value against the min and max limit using the action clamp
4: set the position of the camera



 Bye,

 Jean