A simple C++ program to assist in adding color and moving lines to specific places for Nintendo 3DS homebrew console projects. If you find an issue or have an idea on how to make this better, feel free to contribute or open an issue.
Download color.h from the releases page and drop it into your source directory. Continue reading for instructions for how to use.
The top screen has 30 rows and 50 columns. The bottom screen has 30 rows and 40 columns.
There are eight different colors avaliable.
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
There are also two different modes
- Foreground
- Background
Setting the color is easy.
#include "color.h" // include the header file
// Setup components of the script.
Foreground FORE;
Background BACK;
std::cout << BACK.red << "The background is red." << std::endl;
std::cout << FORE.yellow << "The text color is yellow." << std::endl;
You may want to reset to no colors in the foreground and background.
Reset RESET;
std::cout << "This text is " << FORE.yellow << "yellow. " << RESET.reset << "Goodbye!" << std::endl;
// ^ No style ^ Yellow ^ Style has been reset
You might want to move the text to a specific line
Move MOVE;
std::cout << FORE.blue << MOVE.goTo(30, 0) << "This line is on row 30 and column 0";
// ^ Blue ^ Move to row 30 and column 0
There is a demo included. Run the make command to build it, then open the homebrew launcher, press y and then run the command $DEVKITPRO/tools/bin/3dslink color.3dsx -a ip.address.on.3ds.screen
Alternatively, download the color.3dsx file and put it into the 3ds folder on your 3DS' SD Card, then run it via the homebrew launcher.
Credit to this overpriced restored 3DS on walmart for the image. And thanks to this article for showing me that this was all possible.
