1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

[SOLVED]Text GUI

Discussion in 'Programming' started by Twilight Raven, Feb 13, 2020 at 5:05 AM.

  1. Twilight Raven

    Twilight Raven Member

    Joined:
    Sep 1, 2016
    Posts:
    835
    Hi

    I'm trying to print some text out in DrawGUI event and it isn't show anything.

    Code:
    draw_self();
    draw_set_font(TitleScreenFont);
    draw_text_ext_transformed_color(10,10, "Completed levels: " +
                                                string(global.completed_level1) + "first:" +
                                                string(global.completed_level2) + "second:" +
                                                string(global.completed_level3) + "third:" +
                                                string(global.completed_level4) + "fourth:" +
                                                string(global.completed_level5) + "fifth:" +
                                                string(global.completed_level6) + "sixth:" +
                                                string(global.completed_level7) + "seventh:" +
                                                string(global.completed_level8) + "eighth:" +
                                                string(global.completed_level9) + "ninth:" +
                                                string(global.completed_level0) + "tenth:" +
                                                string(global.completed_level1) + "eleventh:",
                                                30,300,10,10,0,c_red, c_red, c_red, c_red, 1.0);
                        
    Am I doing this right?
     
    SilentxxBunny likes this.
  2. Rob

    Rob Member

    Joined:
    Jul 12, 2016
    Posts:
    768
    To me it looks like you have 13 arguments when it takes 11, which should give you an error, so is the object in the room?

    Code:
    draw_text_transformed_colour(x, y, string, xscale, yscale, angle, c1, c2, c3, c4, alpha);
    
    x: 10
    y: 10
    string:
    "Completed levels: " +
                                               string(global.completed_level1) + "first:" +
                                               string(global.completed_level2) + "second:" +
                                               string(global.completed_level3) + "third:" +
                                               string(global.completed_level4) + "fourth:" +
                                               string(global.completed_level5) + "fifth:" +
                                               string(global.completed_level6) + "sixth:" +
                                               string(global.completed_level7) + "seventh:" +
                                               string(global.completed_level8) + "eighth:" +
                                               string(global.completed_level9) + "ninth:" +
                                               string(global.completed_level0) + "tenth:" +
                                               string(global.completed_level1) + "eleventh:"
    xscale: 30
    yscale: 300
    angle:10
    c1:10
    c2:0
    c3:c_red
    c4:c_red
    alpha: c_red
    
    Here's an example from the manual:

    Code:
    draw_set_halign(fa_center);
    draw_set_valign(fa_middle);
    image_angle += 1;
    draw_text_transformed_colour(room_width / 2, room_height / 2, keyboard_string, 2, 2, image_angle, c_red, c_red, c_yellow, c_yellow, 0.5);
     
  3. Twilight Raven

    Twilight Raven Member

    Joined:
    Sep 1, 2016
    Posts:
    835
    Sorry but the function takes 13 arguments. draw_text_ext_transformed_color. not draw_text_transformed_colour. no dice.

    (edit)

    Yes the object doing the drawing is in a room. I tried it in a blank room and in the room where its going to be used
     
  4. Rob

    Rob Member

    Joined:
    Jul 12, 2016
    Posts:
    768
    You're right - I clicked on the wrong link when I was checking. I don't know what else to suggest apart from copy/paste the code that's in the manual and if that works, go from there.
     
  5. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,951
    Is the instance visible? Is the layer it's on visible?
    Does a normal draw_text show anything?
     
    SilentxxBunny likes this.
  6. Twilight Raven

    Twilight Raven Member

    Joined:
    Sep 1, 2016
    Posts:
    835
    Haha. I forgot to check visible. :)
     

Share This Page