hi all!
yesterday i checked out the tutorial on displaying text and downloaded the corresponding source at the bottom of the page.
http://www.sfml-dev.org/tutorials/1.4/graphics-fonts.phphaving played around a little with it, i started to add some rectangles, and didnt manage to set the color for it. once the rect is created, the setcolor() method doesnt work as it should (imho).
however, if no setcolor() is called, the rect is displayed correctly, so as a workaround one may use a set of rects, one for each color...
code snippet (its pretty much at the end of the tutorial-code)
// Make the second string rotate
Bonjour.Rotate(App.GetFrameTime() * 100.f);
// Clear screen
App.Clear();
sf::Shape r = sf::Shape::Rectangle(100, 100, 200, 200, sf::Color(255, 50, 50)); // bright red
sf::Color col(50, 255, 50); // bright green
r.SetColor(col);
r.SetColor(sf::Color(50, 50, 255)); //bright blue
App.Draw(r);
// Draw our strings
App.Draw(Hello);
App.Draw(Bonjour);
if i comment out the setcolor()-lines, i get different results, none of
them actually predictable (except if i get rid of both the lines).
if i replace the rgb values that are 50 by the value 10 (leaving all the 255 as they are
, i dont get a rectangle at all.
boogie