• 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.

Battle Box Font?!

korjamer

Pixel Artist
19
Posts
13
Years
    • Seen Jun 3, 2016
    Does anyone know how to change the font of just the battle boxes in essentials? I'm planning on making them outlined Like in Black and White. (It helps make them more readable if you have a small or transparent box.) There has gotta be a line of code some where in PokeBattle_ActualScene that could be changed. I have a font that would work very nicely I just don't know how to change ONLY the name, level, and HP. A little help? I'm stuck. :(
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen yesterday
    In PokeBattle_ActualScene, before the second line 'pbDrawTextPositions(self.bitmap,textpos)' add:

    Code:
    self.bitmap.font.name="Power Red and Green"
    self.bitmap.font.size=29
    An example with FrLg font.
     

    korjamer

    Pixel Artist
    19
    Posts
    13
    Years
    • Seen Jun 3, 2016
    Thank you so much! It worked! :D
    I have one question though...
    there is a command (<outln>...</outln>)
    that causes the text in a message to have an outline rather than a shadow. How would I apply that to the battle box font?
    Also, how would I change the color of the outline/text?
    Thanks again!
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen yesterday
    Thank you so much! It worked! :D
    I have one question though...
    there is a command (<outln>...</outln>)
    that causes the text in a message to have an outline rather than a shadow. How would I apply that to the battle box font?
    Also, how would I change the color of the outline/text?
    Thanks again!
    Search for BOXTEXTBASECOLOR and BOXTEXTSHADOWCOLOR.

    The outline is a little complex to explain, but the effect is done by:
    Code:
           bitmap.draw_text(ch[1],ch[2],ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1],ch[2]+1,ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1],ch[2]+2,ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1]+1,ch[2],ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1]+1,ch[2]+2,ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1]+2,ch[2],ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1]+2,ch[2]+1,ch[3]+2,ch[4],ch[0])
           bitmap.draw_text(ch[1]+2,ch[2]+2,ch[3]+2,ch[4],ch[0])
    Where:
    ch[0]=graphic ? graphic : textchars[position],
    ch[1]=x+xStart
    ch[2]=texty
    ch[3]=width+extraspace
    ch[4]=lineheight

    Take a look in DrawText script to see where each variable comes.
    The ch[1] gets +1 before the actual text is draw.
     

    korjamer

    Pixel Artist
    19
    Posts
    13
    Years
    • Seen Jun 3, 2016
    Okay... Yeah I probably should learn ruby before I dive any deeper into this...
    I'm pretty confused lol.

    Should I just paste the code into the same place I put the code that allowed me to change the font...? Because that doesn't seem to work as it gives me an error.

    Is there an easier way to apply the code? I really do appreciate your help.
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen yesterday
    No.
    You need to see DrawText script to see where each of this five variable 'ch' comes, then use equivalent on script. This require some script knowledge.
    Picks ch[2] as example, in the script it comes from texty that is the y-distance and in this script the equivalent is '@spritebaseY+6' ('@spritebaseY+40' in HP case).
    Now I going to make some otimizations that beginners scripters can't follow, and all that you need to do is to change the second line 'pbDrawTextPositions(self.bitmap,textpos)' in PokeBattle_ActualScene to:
    Code:
      oldfontcolor=self.bitmap.font.color
      for position in textpos 
        textsize=self.bitmap.text_size(position[0])
        ch=[position[0],position[3] ? position[1]-textsize.width : position[1],
            position[2],textsize.width,textsize.height]
        self.bitmap.font.color=shadow
        self.bitmap.draw_text(ch[1],ch[2],ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1],ch[2]+1,ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1],ch[2]+2,ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1]+1,ch[2],ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1]+1,ch[2]+2,ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1]+2,ch[2],ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1]+2,ch[2]+1,ch[3]+2,ch[4],ch[0])
        self.bitmap.draw_text(ch[1]+2,ch[2]+2,ch[3]+2,ch[4],ch[0])
        self.bitmap.font.color=base
        self.bitmap.draw_text(ch[1]+1,ch[2],ch[3],ch[4],ch[0])
      end
      self.bitmap.font.color=oldfontcolor
     
    66
    Posts
    11
    Years
    • Seen Oct 30, 2023
    I tried the same with pbDrawTextPositions in UI-Party, but it wont work. Anyone know what the problem could be?
     
    Back
    Top