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

Author Topic: Alpha value of font for chat box  (Read 2324 times)

0 Members and 1 Guest are viewing this topic.

P@u1

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Alpha value of font for chat box
« on: July 26, 2011, 06:46:01 pm »
Hi everyone,

I'm planning to develop a chat box, which should be partially transparent.
I thought that this is a perfect job for alpha-values.
But how can I set the alpha-value which is used to draw the text?
Or is there any other good solution?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Alpha value of font for chat box
« Reply #1 on: July 26, 2011, 06:51:14 pm »
You can set the alpha component of the color with sf::Text::SetColor(). Or do you want to make the whole window transparent? This is not possible with SFML.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

P@u1

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Alpha value of font for chat box
« Reply #2 on: July 26, 2011, 07:12:33 pm »
Thx.
I didn't know, what it does.

1.6
Quote

Set the color of the object.

The default color is white.


2.0
Quote

Set the global color of the object.

This global color affects the entire object, and modulates (multiplies) its original pixels. The default color is white.


What do I need to do if I want to change alpha to 50% and let everything else untouched?

is it
Code: [Select]

SetColor(Color (255, 255, 255, 128));
?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Alpha value of font for chat box
« Reply #3 on: July 26, 2011, 07:17:19 pm »
Yes it is ;)
Laurent Gomila - SFML developer

 

anything