is there a way to reverse string_copy?

Discussion in 'Programming' started by itameio, Sep 11, 2016.

  1. itameio

    itameio Member

    Joined:
    Jun 21, 2016
    Posts:
    57
    I used a program to make game maker studio render Arabic by reversing the letters and other stuff (it only uses fonts in the project) and i still wanted to draw the text letter by letter by using string_copy function, problem is, now the text renders from last word to first word as in This example.

    This is because, I presume, the text is reversed, but I need a way to make it render letter by letter from first to last, is there anyway to reverse the direction of this function or another function to do this at all?.
     
  2. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,432
    1 string_length();
    2 string_char_at();
    3 string_insert();

    Too lazy to work up an example for you but you can use those functions to find out how long the string is to build a for loop. Cycle through the string at get the character at each position starting at 1. Then do another loop to insert the characters in reverse order.

    Just figure it out one step at a time.
     
    itameio likes this.
  3. itameio

    itameio Member

    Joined:
    Jun 21, 2016
    Posts:
    57
    already found a solution for it which was to wrap the function directly around the string, anyway, i had to remove my code from the draw event because it slowed the game down and realized the String_copy() function cannot work if called from a variable.

    more details in my second post here
     

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