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

Checking how many characters a string has?

Discussion in 'Programming' started by Gasil, Apr 22, 2018.

  1. Gasil

    Gasil Member

    Joined:
    Mar 18, 2018
    Posts:
    58
    Hello, I am using the following snippet:

    Code:
    if (time < text_length)
    {
        time += velocity;
        print = string_copy(text, 0, time);
     
    }
    
    To draw the letters of a string one by one on a text box. However, I'd like to give the option to make the text appear in a single frame by pressing the letter E, and then, destroy the obj_text with another E press once every character of the current string has been drawn.

    Have you any idea how could I achieve that?

    Thanks.
     
    Last edited: Apr 22, 2018
  2. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,496
    Using string_length function.
     
  3. Gasil

    Gasil Member

    Joined:
    Mar 18, 2018
    Posts:
    58
    Thanks, I checked and it seems I already hadthe string_length function in the text_length variable; I guess I just need to do another check with time, if it's equals or greater; I will try and mess with it.
     

Share This Page