Page 1 of 1

GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Thu Mar 27, 2014 1:42 am
by GEuser
DEMO SCREENSHOT
Image

DEMO DOWNLOAD (.ged zip file) - Game Editor version 1.4.0
dotMatrixDemo.zip
(62.64 KiB) Downloaded 209 times

BASIC INFORMATION

Draws dot matrix style fonts on canvas. You can change width, height, dot spacing, colors, letter spacing(kerning), positioning on canvas with posX / posY, etc... Lots of permutations to create custom dotMatrix Fonts.

Image
Image
Image

CODE USE
1. Create a CANVAS ACTOR
2. Access game editor's script editor.
3. Copy/Paste Global Code from below into script editor (ALTERNATIVE METHOD: Copy/paste code into a simple text editor and save as a .txt file than use Script Editors FILE=>LOAD option to import this text file into gE).
4. Add this imported code as: dotMatrixMod

CALL dotMatrix() function from your CANVAS ACTOR EVENTS (usually Create Actor or Draw Actor) like this:

Code: Select all
dotMatrix(0, "My text goes here.", 1, "FFFFFF0000000000", 10, 10, 1, 1, 0, 0);


NOTE: The getCharCode() function in Global Code is used by the dotMatrix() to extract the character codes from your text message (dotText part).

The modeASCII allows you to display individual ASCII code characters when set between 32 to 126. A value of 0 ignores modeASCII entry and displays your message in dotText part (max of 255 characters).. The dotColors part stores 2 colors (16 characters) for off/on bits of the font using hexadecimal notation (including alpha setting). Off color is effectively the background so can use as highlighting with various alpha settings. Experiment to get different effects.

The purpose for allowing individual ASCII characters is so that you can create your own functions to create curved / wavy texts or to use gE's built in getKeyState() function to type keyboard presses directly to canvas actor. You can also create animated effects by changing spacing (Xgap / Ygap), Kerning and Stretching (wide / high) in Draw Actor and Timer events. There's lots to play around with. As per usual I'm releasing this code for free, so experiment away :)

GLOBAL CODE too large for post. Use from zip file. Sorry for the inconvenience :(

Re: GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Thu Apr 03, 2014 4:49 pm
by digiot
But where is the global code ?
Are you willing to provide it ?

Cheers !

Re: GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Thu Apr 03, 2014 8:10 pm
by Hares
digiot wrote:But where is the global code ?

It seems that the global code is in the zip file that is just under the first image.
There are 1330 lines in the code though ... :shock:

Re: GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Fri Apr 04, 2014 11:04 am
by digiot
Ah, yes, there really is some source code, but isn't that just the demo ?

Re: GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Fri Apr 04, 2014 2:54 pm
by digiot
Seems, there was meant the global code generated from the program,
and not the source code from dotMatrix itself !

Very impressive, nice work !

Re: GEuser's CGUI Lib: dotMatrix() - dotMatrix Canvas Fonts

PostPosted: Mon Apr 07, 2014 3:07 am
by GEuser
digiot wrote:Seems, there was meant the global code generated from the program,
and not the source code from dotMatrix itself !

Very impressive, nice work !

Thanks!

Yep, in essence the global code saved in the Font Creator program is same as source code for dotMatrix Function. The only difference is that the getCharCode() function is removed from the auto-code generation process because it would cause duplicate definition errors in the gE script editor when multiple fonts global code is imported into gE (that's why I requested that you add the getCharCode() bit as a separate global code).

Feel free to tinker with the global code. There's plenty of room for improvements.