You ever felt bored with the same 20 themes? Look no further, we'll add new ones easily!* First, let's look at how the game splits the base sprite into 8x8 chunks ![Base theme](https://i.imgur.com/PRMcJ4d.png) The way the base window tileset works is that the corners are independent, with the rest of the edges repeated to fill the window dimension Edges defined in yellow ![](https://i.imgur.com/iG5czo4.png) Example of how edges can be repeated ![](https://i.imgur.com/N5r0ZYJ.png) The center is always white despite the game simply filling it in code regardless. Potentially a leftover? But regardless, with those specifications, when making textbox tiles (without editing tilemap, see end notes*); -Avoid gradients on the tangent, unless you purposefully want it to repeat -Have the center white -Have it 16bit for palette in a 24 by 24 frame With that, let's try to add a new border! Here's a test one ![](https://i.imgur.com/GrpsKzj.png) Name it the number (in this case 21), and place it in [graphics/text_window](https://github.com/pret/pokeemerald/tree/master/graphics/text_window) with the others Now for code, in [include/text_window.h](https://github.com/pret/pokeemerald/blob/master/include/text_window.h), edit the define count for the newly added theme ```diff code -#define WINDOW_FRAMES_COUNT 20 +#define WINDOW_FRAMES_COUNT 21 ``` See end note for limit* In [src/text_window.c](https://github.com/pret/pokeemerald/blob/master/src/text_window.c), add the graphic constants for image, palette, and pair ```diff code static const u8 sTextWindowFrame18_Gfx[] = INCBIN_U8("graphics/text_window/18.4bpp"); static const u8 sTextWindowFrame19_Gfx[] = INCBIN_U8("graphics/text_window/19.4bpp"); static const u8 sTextWindowFrame20_Gfx[] = INCBIN_U8("graphics/text_window/20.4bpp"); +static const u8 sTextWindowFrame21_Gfx[] = INCBIN_U8("graphics/text_window/21.4bpp"); ``` ```diff code static const u16 sTextWindowFrame18_Pal[] = INCBIN_U16("graphics/text_window/18.gbapal"); static const u16 sTextWindowFrame19_Pal[] = INCBIN_U16("graphics/text_window/19.gbapal"); static const u16 sTextWindowFrame20_Pal[] = INCBIN_U16("graphics/text_window/20.gbapal"); +static const u8 sTextWindowFrame21_Pal[] = INCBIN_U8("graphics/text_window/21.gbapal"); ``` ```diff code {sTextWindowFrame18_Gfx, sTextWindowFrame18_Pal}, {sTextWindowFrame19_Gfx, sTextWindowFrame19_Pal}, -{sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal} +{sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal}, +{sTextWindowFrame21_Gfx, sTextWindowFrame21_Pal} ``` And you're done! Test in game (the file menu makes it easy to access), and it should look like this ![](https://i.imgur.com/Dc51lgt.png) Notes; -The theoretical limit is 255 themes given this is a u8, so 235 at max can be added. I don't expect anyone to reach this limit -Tilemap editing can potentially allow more complex shapes, though that's far outside the scope of the tutorial