- 49
- Posts
- 8
- Years
- Seen Jan 17, 2017
I need help on my trainer card, I want my card to have 24 bagdes of 3 region, 8 of each. I have an example of how I want it. I do not understand script. thank you
Attachments
Last edited by a moderator:
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
x=72 # change to x coordinate of left most badge slot
y=250 # change to y coordinate of top most badge slot
imagePositions=[]
for i in 0...3 #change 3 to total number of regions
for j in 0...8
if $Trainer.badges[j+i*8]
imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32])
end
x+=48 # Change to the distance between the top left corners of two badge slots beside each other
end
x=72
y+=40 # Change to the distance between the top left corners of two badge slots on top of each other
end
It won't look perfect because you don't have a perfect 2x size, and the space between rows is different. (39 px for the top two and 37 px for the bottom two.)Vendily, you were right, my image was great, I slowed down, it's almost perfect.View attachment 80664
x=72 # x coordinate of left most badge slot
y=243 # y coordinate of top most badge slot
imagePositions=[]
for i in 0...3 #change 3 to total number of regions
for j in 0...8
if $Trainer.badges[j+i*8]
imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32])
end
x+=48 # distance between the top left corners of two badge slots beside each other
end
x=72
y+=38 # distance between the top left corners of two badge slots on top of each other
end
textPositions=[
[_INTL("Name"),34,64,0,baseColor,shadowColor],
[_INTL("{1}",$Trainer.name),302,64,1,baseColor,shadowColor],
[_INTL("ID No."),332,64,0,baseColor,shadowColor],
[_INTL("{1}",pubid),468,64,1,baseColor,shadowColor],
[_INTL("Money"),34,112,0,baseColor,shadowColor],
[_INTL("${1}",$Trainer.money),302,112,1,baseColor,shadowColor],
[_INTL("Pokédex"),34,160,0,baseColor,shadowColor],
[_ISPRINTF("{1:d}/{2:d}",$Trainer.pokedexOwned,$Trainer.pokedexSeen),302,160,1,baseColor,shadowColor],
[_INTL("Time"),34,208,0,baseColor,shadowColor],
[time,302,208,1,baseColor,shadowColor],
[_INTL("Started"),34,256,0,baseColor,shadowColor],
[starttime,302,256,1,baseColor,shadowColor]
]
textPositions=[
[_INTL("Name"),34,51,0,baseColor,shadowColor],
[_INTL("{1}",$Trainer.name),302,51,1,baseColor,shadowColor],
[_INTL("ID No."),332,51,0,baseColor,shadowColor],
[_INTL("{1}",pubid),468,51,1,baseColor,shadowColor],
[_INTL("Money"),34,98,0,baseColor,shadowColor],
[_INTL("${1}",$Trainer.money),302,98,1,baseColor,shadowColor],
[_INTL("Pokédex"),34,148,0,baseColor,shadowColor],
[_ISPRINTF("{1:d}/{2:d}",$Trainer.pokedexOwned,$Trainer.pokedexSeen),302,148,1,baseColor,shadowColor],
[_INTL("Time"),34,194,0,baseColor,shadowColor],
[time,302,194,1,baseColor,shadowColor],
]
@sprites["trainer"]=IconSprite.new(336,112,@viewport)
@sprites["trainer"]=IconSprite.new(336,98,@viewport)
baseColor=Color.new(72,72,72)
shadowColor=Color.new(160,160,160)
baseColor=Color.new(248,248,248)
shadowColor=Color.new(72,80,88)
View attachment 80685Vendily, When I put the 24 bagdes, it was like this.
x=72 # x coordinate of left most badge slot
y=243 # y coordinate of top most badge slot
imagePositions=[]
for i in 0...3 #change 3 to total number of regions
for j in 0...8
if $Trainer.badges[j+i*8]
imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32])
end
x+=48 # distance between the top left corners of two badge slots beside each other
end
x=72
y+=38 # distance between the top left corners of two badge slots on top of each other
end
x=72 # x coordinate of left most badge slot
y=243 # y coordinate of top most badge slot
imagePositions=[]
for i in 0...3 #change 3 to total number of regions
for j in 0...8 #change 8 number of badges in a row
if $Trainer.badges[j+i*8] #change 8 to number of badges in a row
imagePositions.push(["Graphics/Pictures/badges",x,y,j*32,i*32,32,32]) # These 32's are the dimensions of each badge (not sure if you changed that)
end
x+=48 # distance between the top left corners of two badge slots beside each other
end
x=72
y+=38 # distance between the top left corners of two badge slots on top of each other
end
Hi! This post is absolutely gold, but I have this dilemma: I want to have 20 medals on the Trainer Card, but with this order per row ... 8, 4 and 8. Why is this order so strange? Because my fangame aims to adapt the anime of pokémon, first from Kanto to Johto, and well, the Orange Islands that are in between have only 4 medals. Vandily, could you help me please? Thanks in advance