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

How to find or create sprites, graphics, sounds and music.

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

Postby GEuser » Thu Mar 27, 2014 1:42 am

DEMO SCREENSHOT
Image

DEMO DOWNLOAD (.ged zip file) - Game Editor version 1.4.0
dotMatrixDemo.zip
(62.64 KiB) Downloaded 210 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 :(
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score

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

Postby digiot » Thu Apr 03, 2014 4:49 pm

But where is the global code ?
Are you willing to provide it ?

Cheers !
User avatar
digiot
 
Posts: 211
Joined: Sat Mar 17, 2012 2:29 pm
Score: 7 Give a positive score

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

Postby Hares » Thu Apr 03, 2014 8:10 pm

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:
User avatar
Hares
 
Posts: 105
Joined: Fri Dec 20, 2013 8:39 pm
Location: Belgium
Score: 14 Give a positive score

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

Postby digiot » Fri Apr 04, 2014 11:04 am

Ah, yes, there really is some source code, but isn't that just the demo ?
User avatar
digiot
 
Posts: 211
Joined: Sat Mar 17, 2012 2:29 pm
Score: 7 Give a positive score

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

Postby digiot » Fri Apr 04, 2014 2:54 pm

Seems, there was meant the global code generated from the program,
and not the source code from dotMatrix itself !

Very impressive, nice work !
User avatar
digiot
 
Posts: 211
Joined: Sat Mar 17, 2012 2:29 pm
Score: 7 Give a positive score

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

Postby GEuser » Mon Apr 07, 2014 3:07 am

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.
GEuser
 
Posts: 204
Joined: Thu Jan 05, 2012 3:08 pm
Score: 19 Give a positive score


Return to Game Resources

Who is online

Users browsing this forum: No registered users and 1 guest

cron