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

Author Topic: Trouble understanding SFML 2 RectangleShape  (Read 2188 times)

0 Members and 1 Guest are viewing this topic.

Zee

  • Newbie
  • *
  • Posts: 12
    • View Profile
Trouble understanding SFML 2 RectangleShape
« on: April 08, 2012, 01:04:00 am »
Hi, I recently switched to sfml 2 and I've been having trouble understanding the rectangle shape. Did a lot of forum searches but not much came up.

Anyways, I'm trying to draw rectangles in an efficient way, one liner, setting the position and color. Originally, this is my code for sfml 1.6 was


App.Draw(sf::Shape::Rectangle(45, 45, 500, 160, sf::Color::Color(0,0,0,100)));


I was just wondering if that's still possible somehow in SFML 2.

Thanks!

EDIT: forgot to mention, yeah I've looked at the documentation and everything. The vector construction part was very confusing and I'm kind of a beginner.
« Last Edit: April 08, 2012, 01:06:40 am by Zee »

Zee

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Trouble understanding SFML 2 RectangleShape
« Reply #1 on: April 08, 2012, 03:54:45 am »
Update: I ended up building a workaround for this, just went ahead and wrote a function that took the necessary variables and built the rectangle that way.