Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
Sphere Development
Sphere Support
Script Support
Replace color in-game
1
Print
Topic: Replace color in-game
(Read 4075 times)
previous topic
-
next topic
0 Members and 1 Guest are viewing this topic.
williammah
Logged
Guest
Replace color in-game
November 16, 2013, 09:41:01 am
Is it possible to change a color of an image in-game? Like, this PNG image which is all green, I want to change the green to white transparent. I cant seem to see any function of that sort in the functions list..
Radnen
Big Chungus
Posts: 1,440
Sphere Studio Developer
Logged
Senior Staff
Wise Warrior
Re: Replace color in-game
Reply #1
–
November 16, 2013, 12:39:35 pm
Cast an image to a surface with image.createSurface(). Then use surface.replaceColors(Col_A, Col_B). And finally cast it back with surface.createImage().
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.
Sphere-sfml
here
Sphere Studio editor
here
1
Print
Sphere Development
Sphere Support
Script Support
Replace color in-game