• Frame that contains all layers?

    From Kirkman@VERT/GUARDIAN to All on Tue Aug 18 15:18:58 2015
    A Frame.js question:ããSay I have a frame called "bgframe" and it has three child frames. The childãframes are each partially transparent and stacked on top of each other, soãthat parts of each of the layers are seen in what's rendered in the terminal.ããI have in the past done this exact thing, and it works great on the BBS. ãã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. ããI can't use getData() on bgframe because it's just an empty holder parentãframe. At least as far as I can tell.ãã--Joshãã////--------------------------------------------------ãBiC -=- http://breakintochat.com -=- bbs wiki and blogãã---ã þ Synchronetã
  • From echicken@VERT/ECBBS to Kirkman on Tue Aug 18 18:21:10 2015
    Re: Frame that contains all layers?ã By: Kirkman to All on Tue Aug 18 2015 15:18:58ãã Ki> My question today: Is there a way in javascript to iterate over the entireã Ki> rendered screen (or a flattened, rendered version of bgframe and itsã Ki> children)? ãã Ki> I can iterate over those individual child frames and getData(), but eachã Ki> frame is separate, so where a character is transparent, I'm not gettingã Ki> any data from the frame below. ããI haven't looked, but based on what you're saying I would assume that eachãFrame just tracks its own data, and none (including the parent) has knowledgeãof what's in the others.ããThere might already be a method for this that I don't know about. If MCMLXXIXãis around, he might have some comments. For now I'll suggest:ããI think that we can probably add a method that will return a flattened versionãof each frame's .data array, with the topmost layers taking precedence overãdata from those below. Here's something that you can try:ãã- 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.ããIf not ... something else can be done.ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From Kirkman@VERT/GUARDIAN to echicken on Fri Aug 21 14:07:15 2015
    Re: Frame that contains all layers?ã By: echicken to Kirkman on Tue Aug 18 2015 06:21 pmãã ec> - Get your layers of frames set up as you've describedã ec> - Call .screenshot(system.text_dir + "blah.bin", false) on the parentã ec> frame - Open text/blah.bin in an ANSI editor; column width is same asã ec> frame width was ãã ec> If blah.bin has the image that you're expecting (all of the contents ofã ec> the frames tht were visible at the time), then that's a good start and weã ec> can move on from there. I'll make a Frame.dump method that will do whatã ec> 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.ãã--Joshãã////--------------------------------------------------ãBiC -=- http://breakintochat.com -=- bbs wiki and blogãã---ã þ Synchronetã
  • From echicken@VERT/ECBBS to Kirkman on Fri Aug 21 15:43:58 2015
    Re: Frame that contains all layers?ã By: Kirkman to echicken on Fri Aug 21 2015 14:07:15ãã Ki> I finally got a minute to try this, and, yes, .screenShot() seems toã Ki> capture only the child frames, which is exactly what I want.ããOkay, if you want to update frame.js and try out Frame.dump(), let me know ifãit does what you 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ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From echicken@VERT/ECBBS to Kirkman on Fri Aug 21 17:42:49 2015
    Re: Frame that contains all layers?ã By: echicken to Kirkman on Fri Aug 21 2015 17:41:01ãã ec> var dump = frame.dump();ã ec> if(typeof dump[y][x] != "undefined")ã ec> // There is a visible character here (see dump[y][x].ch, dump[y][x].attr)ã ec> elseã ec> // 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.ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
  • From echicken@VERT/ECBBS to Kirkman on Fri Aug 21 17:43:36 2015
    Re: Frame that contains all layers?ã By: echicken to Kirkman on Fri Aug 21 2015 17:42:49ãã ec> On my side it looked like the 'else' line went missing after I posted, butã ec> I can see it in the quote above. Anyway, there it is.ããBlah herp derp, it just wasn't on its own line. :|ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã