View Single Post
Old 05-07-2014, 12:28 PM   #92
Justin's Avatar
Join Date: Jan 2005
Location: NYC
Posts: 12,488

Originally Posted by Banned View Post
- Is gfx_update() perhaps called *automatically* in the @timer section? The documentation mentions: "Once the graphics window is open, gfx_update() should be called periodically." However, the graphics functions seem to work just fine without doing so, and calling gfx_update() in fact results in a syntax/compile error. :-/
Sorry, yes, the docs are wrong (gfx_update() is used by some other EEL/gfx related things, I should remove it from the OSCII-bot docs).
- I can't seem to get gfx_getchar() to work either. Am I missing anything, or is it perhaps bugged / not yet implemented? For example, this code (placed in the @timer section, or anywhere else) seems to do absolutely nothing (regardless of which window has focus):
char = gfx_getchar() ? printf("%c", char);
Try this:
(char = gfx_getchar()) > 0 ? printf("%c", char);
(your code was parsed as: char = (gfx_getchar() ? printf("%c", char)); which is not what you want)

- While this hardly surprising, it isn't quite self-evident that the graphics coordinate system starts at the top of the window with x = 0, and y = 0 at the left. (I pretty much typed all the code I thought I needed for drawing VU meters before testing to see if it actually worked, only to find out that it worked *almost perfectly: it was upside down. ) I figure that deserves to be mentioned somewhere.
This is standard for most Windows and Linux systems, but I guess OS X is the exception...
- The reference for gfx_setfont() mentions: "After calling gfx_setfont(), gfx_texth may be updated to reflect the new average line height." Wouldn't it be more useful to have something like gfx_texth to reflect the *maximum* line height? (Or is there perhaps another easy way to find that out?)
Or it should just be "the line height".

- I managed to crash or hang OSCII-bot a couple of times on loading scripts with invalid syntax. Will email in some sample code and (OS X) crash reports to support later.
I look forward to these!
Justin is offline   Reply With Quote