Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MichaelPatriot21 on January 30, 2019, 01:57:44 PM

Title: Camera zoom 2d map
Post by: MichaelPatriot21 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.
Title: Re: Camera zoom 2d map
Post by: Athin 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.
Title: Re: Camera zoom 2d map
Post by: jeanfabre 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

(https://i.imgur.com/qRsdSwy.png)

 Bye,

 Jean