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

Author Topic: Alpha-Blending  (Read 4778 times)

0 Members and 1 Guest are viewing this topic.

Nikko_Bertoa

  • Newbie
  • *
  • Posts: 10
    • MSN Messenger - nikko_bertoa@hotmail.com
    • View Profile
    • https://sites.google.com/site/nicolasbertoa/
Alpha-Blending
« on: February 19, 2010, 04:46:44 am »
Hi community.

How can I use alpha-blending in SFML?

In SDL we have the function:

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

What is the equivalent function in SFML?

Thanks!
My Game Programming Portfolio:

https://sites.google.com/site/nicolasbertoa/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Alpha-Blending
« Reply #1 on: February 19, 2010, 09:23:57 am »
You must change the alpha component of the global color of your sprite
Code: [Select]
sprite.SetColor(sf::Color(255, 255, 255, alpha));
Laurent Gomila - SFML developer

Nikko_Bertoa

  • Newbie
  • *
  • Posts: 10
    • MSN Messenger - nikko_bertoa@hotmail.com
    • View Profile
    • https://sites.google.com/site/nicolasbertoa/
Alpha-Blending
« Reply #2 on: February 19, 2010, 02:37:26 pm »
Thanks!!
My Game Programming Portfolio:

https://sites.google.com/site/nicolasbertoa/