• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Trainer Card/Badges

17
Posts
11
Years
    • Seen Oct 13, 2013
    I'm trying to figure out how to get more than 8 badges on the card. I'm only going to have 1 region.

    I'm in the PokemonTrainerCard script looking at this area:
    Code:
        pbDrawTextPositions(overlay,textPositions)
        x=72
        region=pbGetCurrentRegion(0) # Get the current region
        imagePositions=[]
        for i in 0...8
          if $Trainer.badges[i+region*8]
            imagePositions.push(["Graphics/Pictures/badges",x,310,i*32,region*32,32,32])
          end
          x+=48
        end
        pbDrawImagePositions(overlay,imagePositions)
      end
    I know, I will most likely have to edit the lines above that to to move the text around to be able to fit 2 rows of badges on the trainer card. But how would I go about getting 2 rows of badges on the card? I looked all over the wiki and didn't see it (possibly overlooked it.)
     

    FL

    Pokémon Island Creator
    2,454
    Posts
    13
    Years
    • Seen yesterday
    Change this script to (untested):
    Code:
        pbDrawTextPositions(overlay,textPositions)
        imagePositions=[]
        for region in 0...2
          x=72
          for i in 0...8
            if $Trainer.badges[i+region*8]
              imagePositions.push(["Graphics/Pictures/badges",x,278+32*region,i*32,region*32,32,32])
            end
            x+=48
          end
        end
        pbDrawImagePositions(overlay,imagePositions)
      end
     
    17
    Posts
    11
    Years
    • Seen Oct 13, 2013
    -edit-
    Woo, finally found the problem! :D

    Thanks, worked great. Now I have 2 rows but I can't figure out how to move the rows around on the y (or separate the distance between the 2 rows.)

    I've tried putting y in a bunch of places and changing the number with no luck. I'm guessing I haven't found the right spot or I'm doing something wrong. Any ideas? Not touching ruby in over 4 years is killer >_>
     
    Last edited:
    189
    Posts
    14
    Years
    • Seen Nov 23, 2023
    The part in the above code that says "278+region*32" is the Y coordinate of the respective graphic. So, if you want to move both rows, change the 278 value, or if you want to move the relative distance of the rows, change the 32. You may need to offset the 278 to offset any changes you make for the latter; trial and error is your friend here.
     
    17
    Posts
    11
    Years
    • Seen Oct 13, 2013
    Yeah, I just changed it to y, then defined y and y+, it's all good now! :D
     
    Back
    Top