GMS2 Cameras: As Simple as Possible

preview_player
Показать описание
Hey GameMakers!

Confused by GMS2 cameras? My previous tutorial didn't help much, but this one should set you straight. Let me know what you think of this type of tutorial, especially the white board feature!

--------------------------------------------
Links!
--------------------------------------------
Credits!

BGM: The Origin by Legna Zeg

♫-Legna tracks and songs:

Рекомендации по теме
Комментарии
Автор

Here's the code I use in my create event when using the aspect ratio management stuff.

/// @description
#macro cam view_camera[0]
#macro view_w
#macro view_h
aspect_ratio =

view_height= 250;


if(view_width & 1) view_width++;
if(view_height & 1) view_height++;

max_window_scale = min(floor(display_get_width()/view_width), floor(display_get_height()/view_height));
if(view_height * max_window_scale == display_get_height())
max_window_scale--;

window_scale = max_window_scale;

window_set_size(view_width*window_scale, view_height*window_scale);
alarm[0]=1;

surface_resize(application_surface, view_width*window_scale, view_height*window_scale);

PixelatedPope
Автор

Finally, a GMS video that isn't 2 years old.

bambzld
Автор

It’s so nice to see how fast you help people on discord

nathan
Автор

Great video for beginners, especially with you using the whiteboard to visually show what's happening behind the scenes.

thimblebirb
Автор

I'm about to binge watch everything you put out. Thank you for this stuff, it is so helpful, can't say it enough! You rock man.

rockerhelgeson
Автор

Thank you for posting this!
The simplified and persistent camera object really helps. I was having trouble letting the user adjust the window size and was led here. I used your simple camera setup and added a 'surface_resize(application_surface, camera_view_width, camera_view_height)' whenever the window changes size, or when the room changes, and it seems to work well so far.

megabytegames
Автор

At the time when I start thinking of all of this stuff this video is a best thing I could ever find. Thank you, it would have taken me unthinkable amount of time to figure all this out on my own.

jarirepo
Автор

I have watched this video 15 times, every time I start a new project. You are a savior.

rcrrcr
Автор

Hey, I just wanted to thank you for all your videos. It helps immensely in learning game maker :)

megasupernewbie
Автор

The scaling problem has been causing a headache for me and this video solved it. Thank you very much!

nathanag
Автор

Following the tutorial I had pixel distortion but because I was working with a very small resolution, 240x135 (1920/8 x 1080/8) since my characters are 16x16.
When setting up for the camera to follow the player we have "var _y = obj_player.y - view_height/2" at 8:55.
Since in my case the view_height==135, my camera "y" coordinate was always in a fraction position.
So I just used floor() there("var _y = obj_player.y - floor(view_height/2)"), and whenever I used "view_height/2"and everything is ok :).
Also my app surface was the size of the view(very small, 240x135), if I set it to be the size of the game window(6x bigger) it would hide this bug.


tl:dr
I had pixel distortion because I was accidentally setting up my camera to be in a fractional position, make sure you don't do that =)

magnomaol
Автор

Thank you so much!! I have watch several other videos on views and non of them explained it well and I was getting frustrated until I found your video, You explain it so well I will be watching more of your videos from now on

ironworksentertainmentstud
Автор

THANK YOU! The camera function in gms2 is such a mess to understand for someone like me and I didn't know how to simplify it.
It's good to know what I should avoid doing to avoid bad habits. That's a very informative video, you're awesome!

kwishy
Автор

Thanks so much, this was really helpful. Especially with the stuff about how the camera always follows the top left of the player. It was really confusing before, but it was understandable the way you showed it.

moosemeep
Автор

Yoyo Games should be paying you for your content. Top notch as usual

steviegillen
Автор

thank you so much for this!! clear, concise, easy to understand, definitely the best tutorial on basic gamemaker cameras

chegmj
Автор

Thanks a lot, man! That little extra explanation there about the view compared to the "room" was very helpful knowledge! Thanks! Subbed!

NoLootStudios
Автор

Awesome! Fixed all the jittery pixels for me, as well as answered a couple of other questions. Thank you so much!

paullishchynskyi
Автор

God fucking bless you, PixelatedPope. Your tutorials are an absolute LIFESAVER. Cannot thank you enough for this!

chet_awesomelad
Автор

Great tutorial! Thanks for helping! Whiteboard was nice touch

patriciaduffy