GameMaker: Cycling random funky text

This example pictures something that I wanted to make for few days - awesome funky random text script.

The idea behind this effect is simple - for every string character that should be randomized, replace it with any other renderable character that has same width (so that output string would not shift in directions, and you could somewhat guess the words if you know letter widths well).

To keep lookup speeds optimal, system generates a hashtable (ds_map) for each font when it's first used with it. This allows high processing speeds even for GameMaker: Studio with it's 65K character limit per font.

Program interface consists of 3 functions, one of which is initialization (required to be called before you try to use system), one is font hashtable generation (just in case you want to push these manually at game start), and actual text_rand(string, font) function, which will return a string with randomized character for given font.

This sort of rendering may come particularly useful for different experimental games, along as an interesting way to censor text.

Download GMK Live demo

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *