Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

iOS and MacOS / Sprite Transparency

Author
Message
joachim
12
Years of Service
User Offline
Joined: 21st Feb 2012
Location: Vancouver Canada
Posted: 26th Feb 2013 00:42
Hi all,

how do I make a certain color of a sprite transparent ?

Thanks
jaimetravis
11
Years of Service
User Offline
Joined: 17th Apr 2013
Location: 17500 W Valley Highway Tukwila, WA 98188
Posted: 17th Apr 2013 15:47
Please specify what exactly you are asking as i am not getting it, so please specify and tell as i can give you solution as soon as possible.

Make your special day more special wedding receptions nj.
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 18th Apr 2013 02:55
You need to use the RGB array of the image.
After that you can manage the Alpha channel of indexed pixel.

For example:
we do a for that go from the 0,0 of an image to 100,100
each of those pixels (R,G,B,A) we can change it and reput data into new image.
Those are in the new commands for images.

Long life to Steve!
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 20th Apr 2013 07:55
Simply use SetImageTransparentColor(iImage, r, g, b)

iImage - The ID of the image to change.
r - The red component of the color to set as transparent
g - The red component of the color to set as transparent
b - The red component of the color to set as transparent

So to make all solid red pixels on image 1 transparent, you would call:

SetImageTransparentColor(1, 255, 0, 0)

Then any sprite that uses that image as a texture will have the transparency applied.

Login to post a reply

Server time is: 2024-11-23 09:49:05
Your offset time is: 2024-11-23 09:49:05