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.

AppGameKit Classic Chat / SetSpriteTranparency() and alpha

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 17th Sep 2015 16:08
Hi

I would like to know if there is a way to decrease the alpha of a sprite which have : SetSpriteTransparency(sprite, 2) (= additive blendmode)

I have tried SetSpriteColorAlpha(sprite, alpha)
But it doesn't work with setSpriteTransparency() set to 2 .

Do you know how I can do that ?

Thanks

http://www.dracaena-studio.com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Sep 2015 11:07 Edited at: 18th Sep 2015 11:08
You have to lower the rgb values. I created a shader for additive blending that can use transparent sprites though:


EDIT: With mine just edit alpha as with normal sprites.

Using AppGameKit V2 Tier 1
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 18th Sep 2015 14:17
Hi backslash

thank you for you answer.

I have tried to use your shader, but it doesn't work in my example.
Do you have a little example to see how to use it ?

Thank you.

http://www.dracaena-studio.com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Sep 2015 16:43
If you copy the code into a text file called "additive.ps" then you can apply it to a sprite using


Using AppGameKit V2 Tier 1
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 18th Sep 2015 17:12
I have use the same code (as yours), but it doesn't work.
The sprite is just normal.

I have tried with setSpriteTransparecy(sprite, 2), and the sprite is additive, but I can't change the alpha of this sprite (it's like the normal use, with any shader).

http://www.dracaena-studio.com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Sep 2015 10:47
Maybe I copied the wrong shader then, sorry. I'll take a look when on my dev machine...

Using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-09-29 05:20:09
Your offset time is: 2024-09-29 05:20:09