C
Crysillion
Guest
What I'm trying to figure out is how I can make it so some images do not scale and will be represented 1:1 regardless of room view settings.
In example, my Viewport Properties are 1920x1080, however my Camera Properties are 960x540, thus everything in the game is scaled up by 2x. This is what I want for the majority of my game project.
However, when it comes to things such as UI or hud items, I would not want them to be zoomed in like this, as there are some rooms where the game is scaled differently (using the above method), and I don't want the UI/hud to scale with it as that would seem rather bizarre when actually playing the game.
I'm open to simply approaching camera properties in a different way if that's what is required, but if there's some way to have an image show 1:1 (as if Camera Properties and Viewport Properties are 1:1), then that's really what I'm looking for.
EDIT: I'm trying to accomplish this with instance_create_layer.
__________
Forgot to add. This is the Camera object I'm working with, in case that's relevant:
Create:
End Step:
Room Start:
In example, my Viewport Properties are 1920x1080, however my Camera Properties are 960x540, thus everything in the game is scaled up by 2x. This is what I want for the majority of my game project.
However, when it comes to things such as UI or hud items, I would not want them to be zoomed in like this, as there are some rooms where the game is scaled differently (using the above method), and I don't want the UI/hud to scale with it as that would seem rather bizarre when actually playing the game.
I'm open to simply approaching camera properties in a different way if that's what is required, but if there's some way to have an image show 1:1 (as if Camera Properties and Viewport Properties are 1:1), then that's really what I'm looking for.
EDIT: I'm trying to accomplish this with instance_create_layer.
__________
Forgot to add. This is the Camera object I'm working with, in case that's relevant:
Create:
Code:
c_target = o_player;
c_width = camera_get_view_width(view_camera[0]);
c_height = camera_get_view_height(view_camera[0]);
c_scale = view_wport[0] / c_width;
End Step:
Code:
if not instance_exists(c_target) exit;
x = lerp(x, c_target.x, 0.15);
y = lerp(y, c_target.y-8, 0.15);
x = round_n(x, 1/c_scale);
y = round_n(y, 1/c_scale);
x = clamp(x, c_width/2, room_width-c_width/2);
y = clamp(y, c_height/2, room_height-c_height/2);
camera_set_view_pos(view_camera[0], x-c_width/2, y-c_height/2);
Room Start:
Code:
if !instance_exists(c_target) exit;
x = c_target.x;
y = c_target.y-8;
Last edited by a moderator: