Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
General
»
Feature requests
»
sf::color change individual values
Print
Pages: [
1
]
Author
Topic: sf::color change individual values (Read 2912 times)
0 Members and 1 Guest are viewing this topic.
mvl
Newbie
Posts: 35
sf::color change individual values
«
on:
February 18, 2014, 01:26:44 pm »
I would like to request a feature for sf::color
that you can set and get individual attributes like r,g,b and alpha
it is very annoying to set them al together because you need to create
a seprete r,g,b variables to store at wich they are now
Logged
zsbzsb
Hero Member
Posts: 1409
Active Maintainer of CSFML/SFML.NET
Re: sf::color change individual values
«
Reply #1 on:
February 18, 2014, 01:31:17 pm »
What are you talking about? What stops you from writing the following code?
sf
::
Color
color
;
color.
r
=
45
;
Logged
Motion / MotionNET
- Complete video / audio playback for SFML / SFML.NET
NetEXT
- An SFML.NET Extension Library based on
Thor
Lo-X
Hero Member
Posts: 618
Re: sf::color change individual values
«
Reply #2 on:
February 18, 2014, 01:32:51 pm »
http://www.sfml-dev.org/documentation/2.1/classsf_1_1Color.php
sf
::
Color
myColor
(
0
,
1
,
2
)
;
// Later ...
color.
r
=
255
,
color.
g
=
45
;
color.
b
=
42
;
// Later ...
Uint8 red
=
color.
r
;
You can set and get individual color very well
Edit: zsbzsb was faster :p
Logged
My GitHub Repositories
Loïc Boutter
mvl
Newbie
Posts: 35
Re: sf::color change individual values
«
Reply #3 on:
February 18, 2014, 02:32:18 pm »
sorry i thought you could not acces them directly
so i tried using getters and setters wich didn't work so sorry
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: sf::color change individual values
«
Reply #4 on:
February 18, 2014, 02:52:55 pm »
Don't try random things. Just read the documentation.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
General
»
Feature requests
»
sf::color change individual values
anything