• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GML Objects corresponding to camera coordinates move slowly

uni00

Member
Good evening. I keep the location by making the inventory below track the position of the camera. However, when the character moves, it will move slightly because it will be slightly delayed. I filled in each of step, endstep, and beginstep, but it is still late. How can the inventory be delayed?

GML:
//obj_button --step--
var cx = camera_get_view_x(view_camera[0]);
var cy = camera_get_view_y(view_camera[0]);

x = cx + 70 + (var_slot * 31);
y = cy + 200;
 

Nidoking

Member
Have you considered drawing it in the Draw GUI event so it will draw relative to the screen, and on top of everything else?
 

uni00

Member
Have you considered drawing it in the Draw GUI event so it will draw relative to the screen, and on top of everything else?
Even if you create an instance with draw_gui and move it, it will shift. I've experienced that sprites stretch when you move them with draw_gui.
 

Nidoking

Member
Sounds like you're doing something wrong with your aspect ratio, then. That might also explain the problems you've had with your original method.
 
Top