How to Install
Download the "characters2.zip" file and place the "characters.h" and "characters.cpp" files contained within inside the "engine" folder of the project you wish to implement this in. The remaining two files are external tools that will be explained later. Now simply create an object for the "characters.h" file and initialize it by passing in the graphics object.
Function Usage and Syntax
There are two functions that are added in by the "characters.h" file, those are "scribe()" and "word_scribe()".
The Scribe Function
This function allows you to draw individual characters onto the screen. The syntax is as follows:
[object name].scribe([charCode], x, y, [color], [scalar]);
- charCode: The numerical index of the character (index can be found at the bottom of post).
- color: Kind of self-explanatory, the color of the entire character.
- scalar: The scaling factor for the character (eg. 2, 3, 4) as the original size is a puny 5px x 5px.
This function allows you to draw entire words at a time onto the screen. The syntax is as follows:
[object name].word_scribe([wordCode], x, y, color, scalar, [gap], [length]);
- wordCode: The numerical index of the word (more on this in the "external tools" section).
- gap: The spacing, in pixels, between characters in the word.
- length: The length of the word (eg. hello = 5).
The two other files in the package are external tools that can be used to make your own custom fonts and add words to the word list for usage with "word_scribe()". Double-clicking either will cause them to open in your preferred browser.
charmaker.html
This tool enables you to create your own fonts (albeit limited to a 5x5 grid so I don't see a lot of deviation possible here). You can click on a square in the grid to add a pixel there and right-click to remove it. After you're done creating an image for a character simply click "Add or Edit". The character menu allows you to choose which character you are adding/editing. When you're done with everything, click "Process" and copy the code that appears in the textbox. Paste this code into the "characters.h" file underneath "//Charset Goes Here:", making sure to replace any preexisting charset code.
wordmaker.html
This tool creates a word list (found in "characters.h" underneath the charset) which is necessary if you wish to use the "word_scribe" function. A word may only be added once to the word list. Once you are done with the word list, click "Compile" and the program will automatically output an array ready-for-use. Copy this and paste it underneath "//Word List:", making sure to replace any preexisting code. Now, if you wish to use "word_scribe", keep in mind that each sub-array in the "words" array is an individual word. It's index is the aforementioned "wordCode".
Character Code Index
Spoiler:
I'm not entirely satisfied with the package so I might continue updating it. Moreover, I will listen to any suggestions and will try to respond to them promptly. Thanks.
-NinjaKat_