- 8x8 (50 row mode in DOS)
- 8x16 (80x25 standard VGA font)
- 9x16 DOS 9px font width - see: https://16colo.rs/ansiflags.php#letterspacing
- Greatly expanded the exported parameters
- Added scale factor
- Added support for ANSIFlags - see: https://www.acid.org/info/sauce/sauce.htm#ANSiFlags
- Changing screen mode and scale in Editor updates in real time
- Can now load ANSIs!
- Supports iCE colors (16 background colors no blinking)
- Supports blinking :)
- Cursors
- Input
- Baud Rate Emulation
- Scrolling / Scrollback
- PIPEPRINT! port from my QB64 library
- Lightbar Menus :D
- ANSI Music?
- Legacy DOS Aspect Ratio / Square Aspect Ratio support (maybe!)
- Possibly making this an @tool so it can load an ANSI into the editor in 2D mode GUI
Web export version here (I will update this as needed)
Regular old blinking Cat blinking :D Supports blinking and non-blinking at the same time because tiles
SCREEN
= TextConsole nodeBG
= TileMapLayer named BG, which uses the solid color tile mapFG
= TileMapLayer named FG, which uses the font tile map and alternative tiles for each color in the palette.
- Load
main.tscn
- Adjust properties of the SCREEN node to suit in the property inspector
- In
scripts/main.gd
make sure it is TextScreen and extendsAnsiParser
that's it.
The trick here is that there are 2 tilemap layers. A background one (BG) for background colors under the foreground one (FG).
- Since CGA has 16 background colors we have 16 background tiles in the BG tilemap.
- Since CGA has 16 foreground colors, we have 1 DOS Font 8x16 that has alternative tiles for every tile to match every color in the CGA palette. (Thanks to SelinaDev for the help and idea to use alternative tiles instead of duplicate tilemap atlasses!)
Then we just use
set_cell
and some little translation funcs to do stuff. This gets us a x, y grid just likeSCREEN 0
in basic, etc. It's not REAL console mode, it's a graphical version. Godot doesn't have the ability to do CLI stuff AFAIK.
echo
=print
cecho
=print
in colors (specify fg/bg)locate
=locate
:Dcls
=cls
load_ansi_file(pathname)
= load and display an ANSI file- etc.
See: scripts/text_console.gd for basics, consts
, enums
, etc.
extends TextConsole
func _ready() -> void:
color(CGA.BRIGHT_WHITE, CGA.BLUE)
cls()
print_ruler()
locate(10, 2)
cecho(" Hello, World! ", 14, 4)
# will load ansi file from disk at current cursor position
load_ansi_file("res://your_ansi.ans")
# print a little ruler
func print_ruler() -> void:
for y in range(height):
for x in range(width):
if y == 0:
if x % 10 == 0:
locate(x, y)
echo(str(x))
locate(0, y)
echo(str(y))
Thanks again to Axel for the mentoring/peer reviews, Hueson for the idea to use TileMaps in general, and Selina for the guidance on best way to do it! ❤️