1
Graphics / Gradient Rectangle
« on: August 20, 2014, 09:26:04 pm »
I was searching for how to use gradient, then I found this: http://en.sfml-dev.org/forums/index.php?topic=6750.0
I tried the code that laurent provided but it doesn't work. No errors, just a black screen.
Pieces of code in question:
I tried the code that laurent provided but it doesn't work. No errors, just a black screen.
Pieces of code in question:
sf::Vertex backgroundgr[] =
{
sf::Vertex(sf::Vector2f(0, 0), sf::Color::Blue),
sf::Vertex(sf::Vector2f(0, 1280), sf::Color::Blue),
sf::Vertex(sf::Vector2f(720, 0), sf::Color::Cyan),
sf::Vertex(sf::Vector2f(720, 1280), sf::Color::Cyan)
};
{
sf::Vertex(sf::Vector2f(0, 0), sf::Color::Blue),
sf::Vertex(sf::Vector2f(0, 1280), sf::Color::Blue),
sf::Vertex(sf::Vector2f(720, 0), sf::Color::Cyan),
sf::Vertex(sf::Vector2f(720, 1280), sf::Color::Cyan)
};
m_window.draw(backgroundgr, 4, sf::Quads);
Now, I don't know if I'm using it wrong, or if it just doesn't work.