diff options
author | SonikkuA-DatH <58025603+SonikkuA-DatH@users.noreply.github.com> | 2021-12-13 22:01:46 -0800 |
---|---|---|
committer | SonikkuA-DatH <58025603+SonikkuA-DatH@users.noreply.github.com> | 2021-12-13 22:01:46 -0800 |
commit | cabee9e4042f2bef939e2316e12b585f7e401f6b (patch) | |
tree | 93ef938988949dcc20712104b372a4b02bda187d | |
parent | 58359cf0d78e1f51ae5ba27512cc5773921f6dac (diff) |
Adding tutorial for text window themes
-rw-r--r-- | New-Custom-Menu-Border-Themes-(Basic).md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/New-Custom-Menu-Border-Themes-(Basic).md b/New-Custom-Menu-Border-Themes-(Basic).md new file mode 100644 index 0000000..a234185 --- /dev/null +++ b/New-Custom-Menu-Border-Themes-(Basic).md @@ -0,0 +1,69 @@ +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 + + + +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 + + + +Example of how edges can be repeated + + + +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 + + + +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 + + + +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
\ No newline at end of file |