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

Author Topic: Shape with alpha effect  (Read 1824 times)

0 Members and 1 Guest are viewing this topic.

prchakal

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Shape with alpha effect
« on: May 21, 2013, 11:47:23 pm »
Hi,

Im drying use shapes to debug box2d physics. But the problem is that shape dont have a method to make it alpha.

I see some examples that you can use opengl direct to do it.

SFML has a native method to make shapes with alpha?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Shape with alpha effect
« Reply #1 on: May 21, 2013, 11:50:48 pm »
But the problem is that shape dont have a method to make it alpha.
They do, setColor().
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

prchakal

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Shape with alpha effect
« Reply #2 on: May 21, 2013, 11:54:36 pm »
Hi Nexus.

It works.

The code for reference:
Quote
rectangle.setFillColor(sf::Color(255,0,0,100));  // reg, green, blue, alpha

Very thanks man.

 

anything