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

Author Topic: Inline instead of Outline  (Read 2906 times)

0 Members and 1 Guest are viewing this topic.

globalenemy

  • Newbie
  • *
  • Posts: 10
    • View Profile
Inline instead of Outline
« on: January 30, 2015, 01:43:17 pm »
It's kinda hard to align multiple shapes along the way, when using an OutlineThickness larger than 2px. Using an "Inline" instead of an "Outline" should be able to solve that.

I can think of a way to realize this by myself for now. But only for RectangleShapes. And I also need this for ConvexShapes.

Pls add Inlines! :(
« Last Edit: January 30, 2015, 01:55:02 pm by globalenemy »

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: Inline instead of Outline
« Reply #1 on: January 30, 2015, 02:04:02 pm »
Do you mean you want the outlines to go inside the shape, rather than expand the overall size? If so you can just use a negative thickness:

rectangleShape.setOutlineThickness(-2.f);
 

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Inline instead of Outline
« Reply #2 on: January 31, 2015, 04:35:57 pm »
I have to say that this is even mentioned in the Shapes tutorial under the sub-heading "Outline":
By default, the outline is extruded outwards from the shape (e.g. if you have a circle with a radius of 10 and an outline thickness of 5, the total radius of the circle will be 15). You can make it extrude towards the center of the shape instead, by setting a negative thickness.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything