SFML community forums
Help => Graphics => Topic started by: dsdevil on February 14, 2011, 09:21:45 pm
-
Hello guys!
Yesterday i made my first little demo with sfml i was incredebly happy!
Now i have some problems.
1. How to make some color transparent?
2. How can i make so that some sprites are behind and in front of other. For example, if i add bacground, i would like it to be behind all other objects. Can i do that?
-
1. How to make some color transparent?
The alpha (fourth) component of colors is the transparency.
2. How can i make so that some sprites are behind and in front of other. For example, if i add bacground, i would like it to be behind all other objects. Can i do that?
Draw first your background, and then the rest. Simple ;)
-
1. How to make some color transparent?
The alpha (fourth) component of colors is the transparency.
2. How can i make so that some sprites are behind and in front of other. For example, if i add bacground, i would like it to be behind all other objects. Can i do that?
Draw first your background, and then the rest. Simple ;)
Wow, the second i really simple :)
But with this alpha thing in first, do i have to do it in my picture editor or in code somehow?
-
You can do it either way or even both if you want too. Check out Sprite::SetColor function.
-
I did it in my image editor. Works awsomly. Thanx a lot guys.