include "inc/cmdsys.plh"
include "inc/lines.plh"
include "inc/args.plh"
include "inc/fileio.plh"
include "dhgr.tk/inc/dhgrlib.plh"
include "dhgr.tk/inc/dhgrutils.plh"

sysflags resxtxt1|reshgr1|resxhgr1

var arg
var xPen = 60
var yPen = 30
var fontWidth, fontHeight
char hello = "Hello, world"
var msg = @hello

arg = argNext(argFirst)
dhgrMode(DHGR_COLOR_MODE)
screenRead("scroll.dhgr")
while arg and ^arg
    if ^(arg + 1) == '-'
        msg = arg + 1
        ^msg = ^arg - 1
    else
        dcgrFont(fontRead(arg))
        fontWidth, fontHeight = fontGlyphDim('a')
        fontHeight++
        dcgrColor(CLR_BLACK)
        dcgrStr(xPen, yPen + (fontHeight * 7) / 8, msg)
        yPen = yPen + fontHeight
    fin
    arg = argNext(arg)
loop
getc
dhgrMode(DHGR_TEXT_MODE)
done
