CHAR EDIT

From MZXWiki
Revision as of 01:33, 26 January 2011 by Kuroneko (talk | contribs) (Created page with "'''CHAR EDIT [char] to # # # # # # # # # # # # # #''' is a common command in many games that utilize animation, especially before partial character sets were added, as it all...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CHAR EDIT [char] to # # # # # # # # # # # # # # is a common command in many games that utilize animation, especially before partial character sets were added, as it allows the programmer to change a single static or variable character's graphic using static or variable byte values for each row of pixels. Pixels and the byte values correspond as follows:

pixel: 1    2    3    4    5    6    7    8
    -----------------------------------------
    |128 | 64 | 32 | 16 |  8 |  4 |  2 |  1 |  Byte value = sum of the numbers below pixels that are ON
    ----------------------------------------- 

The character editor interface in Exophase's DOS versions of MegaZeux would display the byte values beside each row, but this functionality has since been removed.

Usage

. "changes char 65 to a diagonal line going from the top-right corner to the bottom-left corner"
char edit 'A' to 1 1 2 2 4 8 8 16 16 32 64 64 128 128
. "a basic progress bar that uses bitwise operators"
set "progress" 5
set "progressChar" 128
set "p" "(255<<8>>'progress'a255)"
char edit "progressChar" to 0 0 0 0 255 0 "p" "p" 0 255 0 0 0 0