• 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!

Legacy GM HELP Putting GUI in the bottom right of the View/Screen

D

dawson2223

Guest
Hey,

I'm trying to put a GUI on the bottom right of my screen, that will stay at the bottom right even when the camera moves. I cannot get it to work. It either hovers somewhere around the center of the screen, or doesn't show up at all. HELP PLEASE!!!!

Here is the code for the camera following the player. I have it so it follows the player and mouse.
Code:
var xTo,yTo;
move_towards_point(mouse_x,mouse_y,0);
xTo = obj_player.x + lengthdir_x(min(96,distance_to_point(mouse_x,mouse_y)),direction)
yTo = obj_player.y + lengthdir_y(min(96,distance_to_point(mouse_x,mouse_y)),direction)


x += (xTo-x)/25;
y += (yTo-y)/25;

view_xview = -(view_wview/2) + x;
view_yview = -(view_hview/2) + y;
/*
Want to keep the camera CENTERED on the x and y
position of the camera object. Take negative half x coordinate
and adding by x.
*/


view_xview = clamp(view_xview,0,room_width-view_wview);
view_yview = clamp(view_yview,0,room_height-view_yview); //Doesn't allow the view to go past room.
 
Top