mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
be343003fc54817256d4b464a24b1477763578f3
S2DEX Text Engine
How to "Install"
- Clone this repo into a folder in your SM64 decomp or homebrew repo
- Include that folder in your makefile's
SRC_DIRS - Add that folder to the linker script (
sm64.ld) or specfile - You're ready to use S2DEX Text Engine!
Usage (Sample Program)
#include "s2d_engine/init.h"
#include "s2d_engine/s2d_draw.h"
#include "s2d_engine/s2d_print.h"
char myString[] = "This is a " SCALE "2" "test string!\n"
"Supports a bunch of standard " ROTATE "-36" "escape characters!\n"
"\tIncluding " COLOR "255 0 0 0" "Colorful text!";
// ...
void some_func(void) {
uObjMtx *buffer;
// substitute with a different alloc function as neccesary
buffer = alloc_display_list(0x200 * sizeof(uObjMtx));
s2d_print(50, 50, myString, buffer);
}
Command Usage
(All numbers must be in base 10)
SCALE "N"- Scales text N times (Can be negative)ROTATE "N"- Rotates each glyph by N degrees (Can be negative, useful for italics)TRANSLATE "X Y"- Moves the rest of the string to the specified X and Y positionCOLOR "R G B A"- Sets the text color to the specified value
Description
Languages
C
97.2%
C++
2%
Assembly
0.5%
Python
0.2%