Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have drawn everything needed to the screen including a HUD for the score, but I have my room set to follow my player: When the camera follows the player, the score HUD stays doesn't scroll with him!

How do I make the score display follow along with the player also?

share|improve this question
add comment

migrated from gaming.stackexchange.com Apr 26 '13 at 1:55

This question came from our site for passionate videogamers on all platforms.

1 Answer

You'll have to set the score position relative to the view position every update event.

Some basic pseudo code from what I remember of GML.

    score.x = view[0].x + 15;
    score.y = view[0].y + 15;

You can do something similar with the drag and drop interface, but I haven't touched GameMaker for years so I can't help you with that.

share|improve this answer
I think there is an option "relative to view" when you inspect the object in the room. Not sure though, been a few years for me as well (even before YoYo took over). –  Kevin Apr 26 '13 at 12:48
There's a new Draw GUI event that would be worth looking into: yoyogames.com/tech_blog/9 It would take care of doing all that relative stuff for you –  Jeff May 21 '13 at 23:33
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.