Questions about Loading of in game sprites
- accucore12
- Posts: 14
- Joined: May 18th, 2012, 1:06 pm
Questions about Loading of in game sprites
Images often come in certain dimension (width x height ) ,so my interpretation of it is that it would come in a rectangular form.However In games we do not see any border around any of the sprites, there is no visible border. So how did it manage to make certain parts of the picture transparent and not show. I would want to know the usual way in which they do that.
Code: Select all
Occupation: Reverse Engineer
Re: Questions about Loading of in game sprites
There's just no pixel there, so it wont get drawn...? Or rather if the pixel has a certain value or information it wont be drawn.
ʕ •ᴥ•ʔ
Re: Questions about Loading of in game sprites
There are three main ways to implement sprite transparency. The first is using a colorkey, wherein a certain color is chosen to represent a transparent pixel. The second is adding a separate alpha channel to the pixels (RGBA), wherein the value of the alpha channel determines how opaque its corresponding pixel is. The third is masking, where a separate image is used as a mask to show which pixels will be drawn.
Chili
- accucore12
- Posts: 14
- Joined: May 18th, 2012, 1:06 pm
Re: Questions about Loading of in game sprites
Thanks for the reply ,i have some queries on the details.chili wrote:There are three main ways to implement sprite transparency. The first is using a colorkey, wherein a certain color is chosen to represent a transparent pixel. The second is adding a separate alpha channel to the pixels (RGBA), wherein the value of the alpha channel determines how opaque its corresponding pixel is. The third is masking, where a separate image is used as a mask to show which pixels will be drawn.
For the first way, what if the image has a pixel of that color that is use to represent the transparent pixel, wouldnt that image not be represented correctly?
Regarding the second way, with the Alpha channel method, does this only apply to certain type of images with alpha values.How about images like 24bit ,8 bit, 1 bit?
Is there any instance in which a particular case is prefered?
Code: Select all
Occupation: Reverse Engineer