[Tip] Display Launching Texts in ASCII Art
-
Hello fellas,
I want to share a little enhancement that I'm using for nearly a year now, but failed to share it here ever since. However, better late than never. 😉
Although RetroPie allows launching images to display when launching a game, because the launching process pauses while displaying the image, there will always be a black screen before and after them, or all the time without an image. But actually, the black screen is an empty text console which you can write something on.
Meet figlet, a handy little tool that creates ASCII art from text strings.
_ ____ _____ _____ _ _ _____ | | / __ \ /\ | __ \_ _| \ | |/ ____| | | | | | | / \ | | | || | | \| | | __ | | | | | |/ /\ \ | | | || | | . ` | | |_ | | |___| |__| / ____ \| |__| || |_| |\ | |__| | _ _ _ |______\____/_/ \_\_____/_____|_| \_|\_____| (_|_|_)
This text was created by the command
figlet -f big -t -c "LOADING ..."
. The options used here mean as follows:-f big
– Use the font "big", see here for many font examples.-t
– Set figlet's outputwidth to the terminal width. This is needed for correctly centering the text (see the next option), and prevents a premature break of long lines.-c
– Center the text horizontally.- After the options, write the text to convert in quotation marks.
You can experiment with figlet in RetroPie's command shell which you can get to by pressing
F4
in Emulation Station, or in an SSH session. You can exit the shell by enteringexit
or pressingCtrl+d
.But first, you'll have to install the tool:
sudo apt install figlet
Play with its fonts and options as much as you want. If you're happy with the result, put the figlet command into the file
/opt/retropie/configs/all/runcommand-onstart.sh
. This can be done easily from the command shell by the following command.nano /opt/retropie/configs/all/runcommand-onstart.sh
This will start the text editor
nano
. When you're finished with editing the file, pressCtrl+x
followed byy
for "yes" andEnter
to confirm the file name to save to. Et voilà , the pimped text should now be displayed every time when a game is launched.Bonus: Center the text vertically and/or colour it
The option
-c
only centers the text horizontally. To position it vertically, you'll have to use another command right before figlet in theruncommand-onstart.sh
: printfprintf "\e[32m\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
This will colour the text green (
\e[32m
) and print 32 invisible line feeds (\n
) in the text console, which will vertically center the figlet text on my 1600x1200 pixel monitor. You'll have to experiment with the number of line feeds on your own system. See here for many colour and formatting codes (bold, underlined, blinking etc.)This is my own
runcommand-onstart.sh
:printf "\e[32m\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" figlet -f big -t -c "LOADING ..."
Any questions, corrections, or enhancement suggestions are very welcome. 🙂
-
@clyde
Nice find, I have to try that. Does figlet allow you to change text colors? -
@luddo183 AFAIK not directly, but only via printf like I described above.
Here's another link with an example for multicoloured text via alternating printf and figlet commands.
-
@clyde
Thanks, now I must get to that later.
For now, I'm going for some Street Fighter.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.