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

Author Topic: Shape.Rectangle() not working?  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

Elo01

  • Newbie
  • *
  • Posts: 1
    • View Profile
Shape.Rectangle() not working?
« on: August 10, 2009, 07:41:21 pm »
Alright, I guess I'm just using the function the wrong way - Anyway, here's the problem (using SFML 1.5 if that matters):

Code: [Select]
sf::Shape test1 = sf::Shape::Rectangle(200, 200, 400, 400, sf::Color(222, 222, 222));
The above code works just fine and draws a rect as expected, however
Code: [Select]
sf::Shape test2;
test2.Rectangle(200, 200, 400, 400, sf::Color(222, 222, 222));

doesn't seem to work (not drawing anything when calling RenderWindow.Draw()).
The weird thing is, GetPosition() still returns the right coordinates for the 2nd code.


Am i doing something wrong?

Edit: Just realised its a static function and won't work that way, nevermind this thread :/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Shape.Rectangle() not working?
« Reply #1 on: August 10, 2009, 08:02:05 pm »
sf::Shape::Rectangle is a static function that returns a new sf::Shape instance. So your second way of using it is totally wrong ;)
Laurent Gomila - SFML developer

 

anything