• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

About pbDrawTextPositions...

  • 60
    Posts
    11
    Years
    • Seen Jul 9, 2015
    I'm using pbDrawTextPositions to display a .txt file, the problem is that I have no idea how to change to a second line, that's what I tried:

    Code:
        textPositions=
        [
           [_INTL(file.readlines.to_s),34,20,0,baseColor,shadowColor]
        ]
        
        for i in file.readlines
          textPositions.push i.sub(/\n/) {}
        end

    I did type \n in the .txt file but it didn't really work, any help would be appreciated!

    -edit-
    Of course I know I could just use a "for i" each line and it would still be good enough, what I'm asking is having
    a single line but with "\n" each time I want to break it and a way to recognize that \n must be read as a break line and not just as text.

    The reason I won't simply do a simple "for i" with i being the number of lines, is just for learning purposes =P that's if what i'm asking is even possible.
     
    Last edited:
    Wait! What are you doing? Reading from txt files or creating txt files or what?
     
    Reading from a txt file to display the text on screen.
    Instead of having a txt with multiple lines, something like:

    textPositions= [
    [_INTL(file.readlines.to_s),34,20,0,baseColor,shadowColor]
    [_INTL(file.readlines.to_s),34,40,0,baseColor,shadowColor]
    [_INTL(file.readlines.to_s),34,60,0,baseColor,shadowColor]
    ...
    ]

    what I'm asking is, instead, having a single long line in the txt file separated by "\n" and a way to recognize "\n" as a way to break a line and make a new one.
     
    pbDrawTextPositions doesn't do multi-line text. Use drawTextEx or drawFormattedTextEx instead (as seen in the summary screens). I don't know if you'd need to do anything fancy to the \n to make them work, though.
     
    Back
    Top