Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Question on setColor  (Read 1596 times)

0 Members and 1 Guest are viewing this topic.

dk123

  • Newbie
  • *
  • Posts: 49
    • View Profile
Question on setColor
« on: October 01, 2015, 02:42:15 am »
Hi, it currently seems that setColor on a sprite works so that the colour argument is multiplied against the original colour of the sprite texture.

Would it somehow be possible to make this additive instead?
(In which case setColour would need to take in rgb arguments of the range -255~255 to cover all colours possible)

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: Question on setColor
« Reply #1 on: October 01, 2015, 05:46:29 am »
Is because you tint the image instead of changing the color.

There is no way, yet, but i believe if you use external libraries for modify the texture, or use shaders you can get a sort of that you want.
I would like a spanish/latin community...
Problems building for Android? Look here

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Question on setColor
« Reply #2 on: October 01, 2015, 07:44:13 am »
You can simply draw a sf::RectangleShape with the desired color and one of the several blend modes available (add / subtract in your case) on top of your sprite.
Laurent Gomila - SFML developer

 

anything