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

Author Topic: Set the outline color of a shape?  (Read 3990 times)

0 Members and 1 Guest are viewing this topic.

Austech

  • Newbie
  • *
  • Posts: 23
    • View Profile
Set the outline color of a shape?
« on: January 18, 2010, 12:43:58 am »
Hello, sorry if there's an answer on the tutorials, but I couldn't seem to find what I'm looking for. I have a rectangle, and I'm trying to figure out how to change the outline color. There's a "SetColor" function but apparently no "SetOutlineColor" function. Maby it's named differently or something. So my question is if there's a way to set the outline color of a rectangle?

Thanks in advanced.  :wink:

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Set the outline color of a shape?
« Reply #1 on: January 18, 2010, 02:48:49 am »
To change the outline colour of the entire shape you have to change the outline colour of each of it's vertexes.


Have a look on the tutorial:
http://www.sfml-dev.org/tutorials/1.5/graphics-shape.php

Example:

Code: [Select]

// create rectangle with a green outline with width 5
sf::Shape rect1 = sf::Shape::Rectangle(100, 100, 200, 200, sf::Color::Red, 5.f, sf::Color::Green);
(...)
// change second point outline:
rect1.SetPointOutlineColor(1,sf::Color::Yellow);
Pluma - Plug-in Management Framework