GMS 2 Map is Limiting to a Small Size

S

Spencer S

Guest
I'm having an issue with my game. I can create a map as large as I want, which is fine, but my camera is only following my player until about 14k pixels down. After that, it stops following the player and stays at around that mark. Is this a bug, is this my system limits, or is this GMS2's limits?
 
S

Spencer S

Guest
Camera object. I actually have a camera object with a viewport connected to it.
This is the Creation Code inside my room that's set up:

Code:
//Enable the use of views
view_enabled = true;

//Make view 0 visible
view_set_visible(0, true);

//Set the port bounds of view 0 to 2736x1834
view_set_wport(0, 2736);
view_set_hport(0, 1834);

//Resize application to match application size
window_set_rectangle((display_get_width() - view_wport[0]) * 0.5, (display_get_height() - view_hport[0]) * 0.5, view_wport[0], view_hport[0]);
surface_resize(application_surface,view_wport[0],view_hport[0]);

//Build a camera at (0,0), with size 2736x1834, 0 degrees of angle, no target instance, instant-jupming hspeed and vspeed, with a 32 pixel border
camera = camera_create_view(0, 0, 2736, 1834, 0, obj_view, -1, -1, 32, 32);

//Set view0 to use the camera "camera"
view_set_camera(0, camera);

//Set camera target
camera_set_view_target(view_camera[0], obj_view);
camera_set_view_border(view_camera[0], view_hport[0] * 4, view_wport[0] * 2);
 
S

Spencer S

Guest
Yeah, I have looked there. I guess I'm wondering if something in my code is causing this problem, or if its a limit of GM2?
 

Bingdom

Googledom
Yeah, I have looked there. I guess I'm wondering if something in my code is causing this problem, or if its a limit of GM2?
I just told you the problem...

Using the function camera_set_view_target will only move the camera within room bounds - The camera cannot leave the room. (what the manual said, that I explicitly put in bold)

I then pointed you to a list of camera functions in the manual in hopes you'll go searching and find an alternative way to move the camera (since there is).

Anyways, the function you'll want to use instead is camera_set_view_pos
 
Top