GML Keep text inside viewport help!

Discussion in 'Programming' started by BBTP, Sep 13, 2019.

  1. BBTP

    BBTP Member

    Joined:
    Sep 5, 2019
    Posts:
    5
    Currently I have drawn text one scree via this code:
    {
    draw_text(45,y, "Level: "+string(global.level));
    draw_text(45,y+16 ,"HP: "+string(global.hp)+"/"+string(global.maxhp));
    draw_text(45,y+32 ,"EXP: "+string(global.expr)+"/"+string(global.maxexpr));
    if global.hp > global.maxhp {global.hp=global.maxhp}
    x= view_xview[0]
    y= view_yview[0] + 250;
    }



    When I go off to the side it no longer appears on the screen, how can I 'lock' it into the viewport so It's always on screen?
     
  2. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    298
    It seems a case of "draw in the "draw GUI" event".
     
    ParodyKnaveBob likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice