# Moving a UI element with an object on-screen [Gamemaker]

I have an oPlayerobject, and an oTutorial object which has a DrawGUI event for displaying text on-screen.

Currently I have the text appearing at the top-left of the screen, but I would like the text to follow the oPlayer object around the room.

I have tried to set the x & y values in the DrawGUI event to the player's , but this does not have the desired effect; I imagine because the DrawGUI event doesn't occur every step.

Can anybody help?

If you want draw text in Draw GUI event, just add Draw GUI event to the player and place code like this:
var posx = x - view_xview[0];

Draw GUI occur every step, like any other Draw's event. And GUI layer has independent resolution and coords (see functions display_set_gui_size and display_set_gui_maximise).