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];
var posy = y - view_yview[0];
draw_text(posx, posy, "Your text");

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).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.