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

How do I change the size of the text boxes in the battle menu?

bitKoder

completely unreasonable
36
Posts
7
Years
    • Seen Feb 28, 2024
    I have been digging through the pokeemerald battle code and have discovered how to edit the colors, font and position of text in the battle menus, but not how to change the size or position of the text boxes they are displayed in. Anyone know where I can find the code that triggers/controls the drawing of the battle menu text boxes?
     
    453
    Posts
    6
    Years
    • Seen May 17, 2024
    I have been digging through the pokeemerald battle code and have discovered how to edit the colors, font and position of text in the battle menus, but not how to change the size or position of the text boxes they are displayed in. Anyone know where I can find the code that triggers/controls the drawing of the battle menu text boxes?

    The text boxes are drawn according to the tilemap stored in graphics/battle_interface/textbox_map.bin
    You can edit it with Tilemap studio. Load graphics/battle_interface/textbox.png as the tileset.
     

    POKéMIKE1

    AKA meejle
    85
    Posts
    15
    Years
  • Hello, I hope nobody will mind me hijacking this thread, as I'm asking almost the same question! 🙈

    I want to be able to add a new "kind" of textbox and change its size... So like, how there's MSGBOX_NPC, I'd like to be able to call up MSGBOX_ALT and give it a different appearance and size.

    Is that doable? 😃
     
    453
    Posts
    6
    Years
    • Seen May 17, 2024
    Hello, I hope nobody will mind me hijacking this thread, as I'm asking almost the same question! 🙈

    I want to be able to add a new "kind" of textbox and change its size... So like, how there's MSGBOX_NPC, I'd like to be able to call up MSGBOX_ALT and give it a different appearance and size.

    Is that doable? 😃

    While your question is similar the answer is completely different.
    First off:
    Is that doable? 😃
    You can make the game do anything a GBA can do and I'm pretty sure that a GBA can display a text box that looks different from the usual text box.

    Then to answer the actual question:
    The msgbox command calls a std script depending on the message type. You can define a new message type in asm/macros/event.inc and add a std script for it in data/event_scripts.s.
    Normally the std scripts use the "message" script command to display the text box. You might instead use the "callnative" command to call a custom C function that draws your custom textbox.

    For reference, you can find the code for the message script command in src/scrcmd.c
     

    bitKoder

    completely unreasonable
    36
    Posts
    7
    Years
    • Seen Feb 28, 2024
    Thanks Anon822!
    I set up the tileset and disabled the loading of the user window so the default battle frame would show, and it works, but when the level up popup appears, it has no frame. Any idea how I can add a custom frame on this to match the battle message box?
    How do I change the size of the text boxes in the battle menu?
     
    453
    Posts
    6
    Years
    • Seen May 17, 2024
    Thanks Anon822!
    I set up the tileset and disabled the loading of the user window so the default battle frame would show, and it works, but when the level up popup appears, it has no frame. Any idea how I can add a custom frame on this to match the battle message box?
    How do I change the size of the text boxes in the battle menu?

    The border for that box is drawn by the HandleBattleWindow function. The values written to "var" are the different tilemap values that get written to vram. You can change those values to change what tiles the border uses (assuming that you already have the tiles for your frame in vram).
     
    Back
    Top