on
May 21st 2006 at 6:58 pm in General Bored, rainy weather, so… Thought I’d re-write the GUI stuff that I built NG-BASIC around.
The problem with the current 0.2 versions is, that it is has no screen buffer. Also, the key-handling kinda sucks. This all make it impossible, for instance, to move the cursor around with the cursor keys, or the interpreter in any way really being aware what’s on the screen. There is a slight time penalty now, when setting stuff up, but it’s all worth it.
The newer version, still under heavy development and without any interpreter stuff in it, so far looks pretty promising: I’m able to walk around, it correctly detects edges, and all basic input / output (backspace, enter, delete) stuff works.
This still needs some work, for instance vertical text scrolling hasn’t been implemented yet (horizontal was already implemented for the Delete key to function properly). After that, onto graphics with the Canvas object, and then it’s on to hacking the interpreter stuff back in, hooking that into the new GUI stuff.
Might take a couple of days/weeks — stay tuned…












OK been up late last night, an update:
The implementation of the screen buffer not only slows stuff down, while it is getting set-up, but an additional time-penalty is paid, generally.
The old, 0.2, version has very little latency, as it is able to quickly process the key-press. Because it now has to modify a screen buffer each key-press handling just seems to take too long.
I am using a lot of getElementById( )-calls which I could just as well cache after I’ve retrieved them — this should speed things back up. And that really has to happen, can’t imagine how this would run on an older machine — if it at all runs….
Very, very, very preliminary demo of the buffered screen. (Working: screen buffer, basic cursor movement.)
OK, vertical scrolling is now working as well, and the thing accepts user input as well now.
OMFG — I had a brilliant idea last night….
Lo and behold: mouse support! See demo here.
OK, more progress. I actually interprets code now.