X
xery555
Guest
Hi!
I have a problem with the view function in Game Maker. I want the view to not go outside the room horizontally, but ignore the room height. It should follow the player.
So I have this code:
view_xview[0] = x - (view_wview[0]/2);
view_yview[0] = y - (view_hview[0]/2);
But that makes the view go outside the room freely from all sides.
Then I have his code:
view_hborder[0] = view_wview[0] / 2;
view_vborder[0] = view_hview[0] / 2;
But that makes the view not go outside the room at all.
So I guess the solution is a mix of these two, but I have no idea how to do it.
I have a problem with the view function in Game Maker. I want the view to not go outside the room horizontally, but ignore the room height. It should follow the player.
So I have this code:
view_xview[0] = x - (view_wview[0]/2);
view_yview[0] = y - (view_hview[0]/2);
But that makes the view go outside the room freely from all sides.
Then I have his code:
view_hborder[0] = view_wview[0] / 2;
view_vborder[0] = view_hview[0] / 2;
But that makes the view not go outside the room at all.
So I guess the solution is a mix of these two, but I have no idea how to do it.