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

Author Topic: Drawing Shapes on Images  (Read 2915 times)

0 Members and 1 Guest are viewing this topic.

Uzaku

  • Newbie
  • *
  • Posts: 8
    • View Profile
Drawing Shapes on Images
« on: October 25, 2011, 01:57:22 pm »
Hey,
I want to create an Image, with lines, Basically a very simple Chessboard.
So i created 2 sf::Shape:Line objects one vertical and one horizontal.
But then i noticed I cant copy them to the image.
And now my question is, is there any way to copy it, that i didn't see, or will i have to generate them myself by changing the certain pixel?

greetings Uzaku

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Drawing Shapes on Images
« Reply #1 on: October 25, 2011, 02:01:07 pm »
With SFML 2, you can use sf::RenderTexture.

In SFML 1, the only way I know is a workaround via sf::RenderWindow's screenshot capabilities. But maybe it's easier to calculate the pixels. I think you can even use only a small image with as many pixels as fields, and scale the sprite accordingly.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Uzaku

  • Newbie
  • *
  • Posts: 8
    • View Profile
Drawing Shapes on Images
« Reply #2 on: October 25, 2011, 04:49:46 pm »
Thats a really good idea, thx ^^