My question today: Is there a way in javascript to iterate over the entire rendered screen (or a flattened, rendered version of bgframe and its children)?
I can iterate over those individual child frames and getData(), but each frame is separate, so where a character is transparent, I'm not getting any data from the frame below.
- Get your layers of frames set up as you've described
- Call .screenshot(system.text_dir + "blah.bin", false) on the parent frame - Open text/blah.bin in an ANSI editor; column width is same as frame width was
If blah.bin has the image that you're expecting (all of the contents of the frames tht were visible at the time), then that's a good start and we can move on from there. I'll make a Frame.dump method that will do what you're looking for.
I finally got a minute to try this, and, yes, .screenShot() seems to capture only the child frames, which is exactly what I want.
var dump = frame.dump();
if(typeof dump[y][x] != "undefined")
// There is a visible character here (see dump[y][x].ch, dump[y][x].attr) else
// This is an empty cell showing only whatever background color applies
On my side it looked like the 'else' line went missing after I posted, but I can see it in the quote above. Anyway, there it is.
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,067 |
Nodes: | 17 (1 / 16) |
Uptime: | 07:11:52 |
Calls: | 501,266 |
Calls today: | 13 |
Files: | 109,409 |
D/L today: |
12,935 files (9,086M bytes) |
Messages: | 302,254 |
Posted today: | 10 |