GameMaker Legend of Zelda like camera.

D

Dylaniza

Guest
Does any one know why this might not work? This is my code.
  1. target_xview = (Player.x div 1000) * 1000;
  2. target_yview = (Player.y div 560) * 560;
  3. view_xview[0] = target_xview;
  4. view_yview[0] = target_yview;
I got this from a tutorial on youtube but edited it to fit my camera. People say it works on GM and GM2 but I can't get it to work on GM2. edit: it might be because the size is too large, I recently changed my size down to 640x360 and i'll try this again when I start work on my top down game again.
 
Last edited:

csanyk

Member
I have an asset in the marketplace called scroll_snap, which might be able to be modified to work like this.

It "snaps" (ie, jumps) when you reach a view border, but if you wanted to modify it you could probably achieve the scrolling effect by lerping the view rather than snapping it.

Edit: Sorry, I just noticed this was posted in the GMS2 forum. I implemented scroll_snap in 1.x, and it uses Views. I have not updated it to work with Cameras yet. So I would not recommend using it with 2.x unless you already own it and want to try it out.
 
D

Dylaniza

Guest
I have an asset in the marketplace called scroll_snap, which might be able to be modified to work like this.

It "snaps" (ie, jumps) when you reach a view border, but if you wanted to modify it you could probably achieve the scrolling effect by lerping the view rather than snapping it.

Edit: Sorry, I just noticed this was posted in the GMS2 forum. I implemented scroll_snap in 1.x, and it uses Views. I have not updated it to work with Cameras yet. So I would not recommend using it with 2.x unless you already own it and want to try it out.
If you update it for gms2 I will definitely buy it!
 
Top