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

Author Topic: Fill shape with pattern  (Read 2567 times)

0 Members and 1 Guest are viewing this topic.

hippocat

  • Newbie
  • *
  • Posts: 17
    • View Profile
Fill shape with pattern
« on: March 03, 2010, 04:09:33 am »
Is there any way to fill shape not just color but specific pattern or bitmap ?
Thanks
Aleksey

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Fill shape with pattern
« Reply #1 on: March 03, 2010, 08:34:09 am »
No.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Fill shape with pattern
« Reply #2 on: March 03, 2010, 09:00:41 pm »
Not directly. You could render the shape to an image (SFML 2) and then modify all colored pixels (e.g. copy the texture to them). Eventually, you work with a sf::Sprite instead of sf::Shape.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

bluelink

  • Sr. Member
  • ****
  • Posts: 293
    • MSN Messenger - bluelink@live.fr
    • View Profile
    • http://www.bluelink-studio.net
    • Email
Fill shape with pattern
« Reply #3 on: March 04, 2010, 01:40:55 am »
There's no need to modify the pixels manually, you can adapt the blend mode of the sf::Shape and the sf::Sprite to get the effect you want.  :wink:

hippocat

  • Newbie
  • *
  • Posts: 17
    • View Profile
Fill shape with pattern
« Reply #4 on: March 04, 2010, 04:06:26 pm »
Interesting, so I can fill shape with color I like and employ blender somehow to make pattern ? Could anyone give me short sample for this color blending  ?
Thanks
Aleksey