Is there a way to have an "alpha channel" or to set a color in an ANSI or a BIN as being transparent?
I'd like to be able to make a character that's not perfectly rectangle, and have the background show through, but I'm not sure if that's possible with the existing tools.
Re: Transparency when using frames/sprites
By: Kirkman to All on Sat Jun 14 2014 04:23 pm
Is there a way to have an "alpha channel" or to set a color in an ANSI or BIN as being transparent?
I'd like to be able to make a character that's not perfectly rectangle, a have the background show through, but I'm not sure if that's possible wit the existing tools.
16 colors, dude.
I'd like to be able to make a character that's not perfectly rectangle, a have the background show through, but I'm not sure if that's possible wit the existing tools.
16 colors, dude.
Obviously. But I guess what I'm getting at is, do any of the js libraries provide any way to mask a sprite so that a background character can show through an empty character in the sprite?
Is there a way to have an "alpha channel" or to set a color in an ANSI or
a BIN as being transparent?
Anyone tried something like that with frame.js or sprite.js?
Yes, frame.js can do transparency. I believe sprite.js can also be used for .BINs in order to do what you are asking. Have a look at the documentation within the comments for each of those files for transparency details.
you could rig something up with creativity and ansimation
I see frame.js allows frames to have a transparency property, which can be s to true. The only explanation is "Do not display frame sectors where char == undefined."
Sprite.js by default sets its frames to transparent = true.
I guess what I'm still wondering about is how this actually works. So if I h a small rectangular frame filled with an ANSI or BIN file, nothing will actually be transparent, because none of the characters will be undefined, right? I'm thinking the only way I could make use of the transparency is if render the characters individually in code, leaving some of them empty.
I guess what I'm still wondering about is how this actually works. So if a small rectangular frame filled with an ANSI or BIN file, nothing will actually be transparent, because none of the characters will be undefined right? I'm thinking the only way I could make use of the transparency is render the characters individually in code, leaving some of them empty.
that is correct, but you could apply a filter for a specific color (or speci set of attributes) to your graphic after you load it into a frame by iterati the contents as a 2D array and comparing the .attr property to whatever colo you'd like to filter, and just set it to undefined if it matches.
you could rig something up with creativity and ansimation
Er, yes, I'm aware I am capable of creating my own custom solution. I'm seeking help with using any existing solutions in Synchronet, or with
others who may have already tackled similar siutuations previously.
Re: Transparency when using frames/sprites
By: Mro to Kirkman on Sat Jun 14 2014 10:41 pm
you could rig something up with creativity and ansimation
Er, yes, I'm aware I am capable of creating my own custom solution. I'm
well, fucking escuse me.
you're displaying ansi graphics and i suggest a method of displaying ansigraphics to pull off what you want. how stupid of me. guess i've been doing it wrong for the past 22 years.
whats your bbs url and how long have you ran a bbs?
"Er", what you are searching for is only an answer that you will like, not t right answer or one that is good enough.
you are dealing with text here. you are dealing with ansi graphics here. those are the confines in which you must work with.
whats your bbs url and how long have you ran a bbs?
you're displaying ansi graphics and i suggest a method of displaying ansigraphics to pull off what you want. how stupid of me. guess i've been doing it wrong for the past 22 years.
whats your bbs url and how long have you ran a bbs?
well, fucking escuse me.
you're displaying ansi graphics and i suggest a method of displaying ansigraphics to pull off what you want. how stupid of me. guess i've
been doing it wrong for the past 22 years.
whats your bbs url and how long have you ran a bbs?
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.
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.
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 abov the mask doesn't change when the sprite changes orientation, so basically th 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.
whats your bbs url and how long have you ran a bbs?
solution 2: iterate frame.data (this returns the entire graphic you loaded in) once, outside of the user input loop. you can do this once, immediately after loding the graphic in, so you arent doing it every single time it
runs through your loop.
So, the second solution definitely sounds better, since I only need to do it once. I wrote up some code, but the results I'm getting are the same as before. The sprite looks great in it's initial orientation, but when I move a different direction, the mask doesn't match the new orientation.
Using a little debugger function, I see that the maskFrame function is indee iterating over all the characters in the entire sprite. So I'm not sure why this isn't working.
your code looks fine to me, so I'll have to see if I can get it working on my end. If you don't mind giving me a day or two to do find time to do that I'll get back to you.
your code looks fine to me, so I'll have to see if I can get it working o my end. If you don't mind giving me a day or two to do find time to do th I'll get back to you.
Sure, that would be awesome. Thanks again for all your help.
ok. should be all set now if you update frame.js from cvs.synchro.net
you found a bug. I have squashed it.
should be ok without any code changes.
Wow, how about that. I'll update as soon as I get home tonight. Thanks again for taking a look and helping learn how to do this.
I don't recall helping you much. You figured out a great deal of this on your own, apparently. Good luck with your game, I'd like to see it when it's done.
E-peen comparison in 2014? Sheesh..
Well, fucking excuuuuuuuuuuuuuuuuuuse ME! My BBS dong is bigger than your BBS dong.
Can you type with it?
echicken wrote to Poindexter Fortran <=-
Can you type with it?
Sure, albeit slowly. It's kind of a hunt-and-pecker.
Sure, albeit slowly. It's kind of a hunt-and-pecker.
That man can sling the puns with the best of them...
well, fucking escuse me.
you're displaying ansi graphics and i suggest a method of displaying ansigraphics to pull off what you want. how stupid of me. guess i've been doing it wrong for the past 22 years.
The following line, is hereby deemed to be hilarities:
whats your bbs url and how long have you ran a bbs?
Ahoy, dearest pukes!
Sysop: | Chris Crash |
---|---|
Location: | Huntington Beach, CA. |
Users: | 578 |
Nodes: | 8 (0 / 8) |
Uptime: | 29:20:17 |
Calls: | 10,736 |
Calls today: | 1 |
Files: | 5 |
Messages: | 443,196 |
Posted today: | 1 |