• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Cameras: Advantages to New Camera vs. Modifying Default Camera Views?

What are the advantages of creating a camera instead of simply finding what camera the view is using then modifying it's size or position or other properties? What could I do with the 1st method, but not the 2nd method?

What does creating a new camera like this allow...

Create Event:
view_camera[0] = camera_create_view
(0, 0, _w / 2, _h, 0, obj_player_1, -1, -1, _w, _h)

Step Event:

var cam = view_camera[0]
camera_set_view_pos(cam,camera_get_view_x(cam),camera_get_view_y(cam))

That only modifying the default views like this does not?

Create Event:

view = view_get_camera(i)
view_w = 640
view_h = 360
view_x=400
view_y=200

camera_set_view_size
(view, view_w,view_h)

Step Event:

camera_set_view_pos
(view,view_x, view_y)
 

samspade

Member
Primary advantage of the room editor camera is that it is easy to set up. Pretty much everything else is a disadvantage. Setting up your own camera is also pretty easy and much more flexible. This tutorial is a great short summary:


Basically, if you are just getting started, or your game/project is small, your just testing things, etc. you can get by with the room editor's camera. Otherwise, probably don't use it.
 
Top