Subj : Re: Transparency when using frames/sprites To : MCMLXXIX From : Kirkman Date : Wed Jun 18 2014 04:04 pm > that is correct, but you could apply a filter for a specific color (or > specific set of attributes) to your graphic after you load it into a frame > by iterating the contents as a 2D array and comparing the .attr property to > whatever color you'd like to filter, and just set it to undefined if it > matches. Okay, so I've written some code doing what you suggested, and it works: function maskFrame(theFrame) { var w = theFrame.width; var h = theFrame.height; for (var y = 0; y < h; y++) { for (var x = 0; x < w; x++) { var theChar = theFrame.getData(x,y); // If theChar is empty black space, clear attributes // to make it act as transparent. if (theChar.ch == ' ' && theChar.attr == 7) { theFrame.clearData(x,y); } } } } function gamePlay() { player.sprite = new Sprite.Profile("boy", mapFrame, 1, 1, 'e', 'normal'); maskFrame(player.sprite.frame); player.sprite.frame.draw(); var userInput = ''; while( ascii(userInput) != 13 ) { userInput = console.getkey(K_UPPER | K_NOCRLF); player.sprite.getcmd(userInput); maskFrame(player.sprite.frame); Sprite.cycle(); mapFrame.cycle(); } } But I did run into a roadblock with sprites. I have a profile sprite that changes depending on whether it is facing left or right. Using the code above, the mask doesn't change when the sprite changes orientation, so basically the wrong characters are being masked. What should I do differently to make sure each orientation has its own mask? Also, on a related note, where can I find what the numeric values in .attr correspond to? it seems that 7 is black, but some other numbers also seemed like they might be black as well. --Josh ////-------------------------------------------------- BiC -=- http://breakintochat.com -=- bbs wiki and blog --- þ Synchronet .