Transparency?
Transparency?
Hey there.
I'm trying to do transparency to an image(it's PUTted on the screen), but I don't know how. I saw a tut vic did, but in his case, he did the image from DATA. what if i load it from a .bsv? whatshould the mask and image transparent color be?
Thanks a lot
I'm trying to do transparency to an image(it's PUTted on the screen), but I don't know how. I saw a tut vic did, but in his case, he did the image from DATA. what if i load it from a .bsv? whatshould the mask and image transparent color be?
Thanks a lot
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
you need to use a technique called masking sprites. Although this is not very hard, it takes 2x the amount of memory usually needed, so i recommend you use a quick library such as Rellib.
Anyway, a tutorial on sprite masking is http://petesqbsite.com/sections/tutoria ... etput.html here. I reccomend you read the whole thing (including the stuff about buffers) cuz thats useful stuff.
Anyway, a tutorial on sprite masking is http://petesqbsite.com/sections/tutoria ... etput.html here. I reccomend you read the whole thing (including the stuff about buffers) cuz thats useful stuff.
Code: Select all
'load the image and set up the imagebuffer and all that
PUT(x, y), image, TRANS
This is assuming you use FB..
I have left this dump.
In QB, you must either spend twice the amount of memory using
the original sprite, and its mask, or write your own custom sprite routine.
Usually the custom routine is slower but saves the memory, so its up to the programmer which is more benificial.
In a few days when I dig it up and maybe make a few changes I'll upload a screen 13 library for QB to the d/l section here, and also a few other ones I helped with. All were written in pure QB and include source.
My library called VIDEO13h, contains a sprite routine that includes a transparency routine and other sprite features too. The special thing about my custom sprite routine is the speed optimizations it uses, which is faster than doing the AND + XOR method with a masked sprite, but doesn't need a mask sprite! It's so fast, when compiled my transparent PUT is almost as fast as QB's PSET PUT! (No kidding
Anyways, be on the lookout for these d/l.
Cya,
Nemesis
the original sprite, and its mask, or write your own custom sprite routine.
Usually the custom routine is slower but saves the memory, so its up to the programmer which is more benificial.
In a few days when I dig it up and maybe make a few changes I'll upload a screen 13 library for QB to the d/l section here, and also a few other ones I helped with. All were written in pure QB and include source.
My library called VIDEO13h, contains a sprite routine that includes a transparency routine and other sprite features too. The special thing about my custom sprite routine is the speed optimizations it uses, which is faster than doing the AND + XOR method with a masked sprite, but doesn't need a mask sprite! It's so fast, when compiled my transparent PUT is almost as fast as QB's PSET PUT! (No kidding
Anyways, be on the lookout for these d/l.
Cya,
Nemesis
hmm.. I'll read that tutorial.
Z!RE & Nekrophidus:Since I have both QB & FB, I would be interested to know:
*By color 0, you mean the first color in the palette,right?
*&HFF00FF is 255,0,255 in paint,right?:P
Nemesis:Sounds real interesting(especially since it is written in QB) and it
s so fast. Does your put function do 2 FOR loops? Anyway, I'll be on the lookout for it;)
Z!RE & Nekrophidus:Since I have both QB & FB, I would be interested to know:
*By color 0, you mean the first color in the palette,right?
*&HFF00FF is 255,0,255 in paint,right?:P
Nemesis:Sounds real interesting(especially since it is written in QB) and it
s so fast. Does your put function do 2 FOR loops? Anyway, I'll be on the lookout for it;)
Yup, color 0 is the first in the palette.. just make it color 0 and you'd be fine..Anonymous wrote:hmm.. I'll read that tutorial.
Z!RE & Nekrophidus:Since I have both QB & FB, I would be interested to know:
*By color 0, you mean the first color in the palette,right?
*&HFF00FF is 255,0,255 in paint,right?:P
Nemesis:Sounds real interesting(especially since it is written in QB) and it
s so fast. Does your put function do 2 FOR loops? Anyway, I'll be on the lookout for it;)
As for &HFF00FF it's just what you said, 255, 0, 255
I have left this dump.
Or use Plasma/Rel 's SuperPut
http://www.phatcode.net/downloads.php?id=166
It was very used just before FB sucked our brain
http://www.phatcode.net/downloads.php?id=166
It was very used just before FB sucked our brain