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

Author Topic: Drawing a Sprite or other Image onto an Image  (Read 3242 times)

0 Members and 1 Guest are viewing this topic.

TheBoff

  • Newbie
  • *
  • Posts: 10
    • View Profile
Drawing a Sprite or other Image onto an Image
« on: May 03, 2010, 09:15:07 pm »
Is it possibly, basically!

I'm doing a simple gui, and an image button will have three parts: a border, a background and an image.

Is it possible to "pre render" one on top of the other, to stop me having to draw all three parts every time, or is there simply no point?

Thanks!

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Drawing a Sprite or other Image onto an Image
« Reply #1 on: May 03, 2010, 09:22:03 pm »
Possible with SFML2, harder with SFML 1.x ;)
Mindiell
----

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Drawing a Sprite or other Image onto an Image
« Reply #2 on: May 03, 2010, 09:23:15 pm »
In SFML 2, the sf::RenderImage class can be used as rendering target, similar to sf::RenderWindow.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Drawing a Sprite or other Image onto an Image
« Reply #3 on: May 03, 2010, 10:36:46 pm »
You also have sf::Image::Copy.
Laurent Gomila - SFML developer

TheBoff

  • Newbie
  • *
  • Posts: 10
    • View Profile
Drawing a Sprite or other Image onto an Image
« Reply #4 on: May 03, 2010, 10:38:35 pm »
Awesome, thanks guys.

How stable is SFML2 seems to the logical next question: when will it be released?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Drawing a Sprite or other Image onto an Image
« Reply #5 on: May 04, 2010, 12:37:52 am »
Nobody knows ;)
Laurent Gomila - SFML developer

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Drawing a Sprite or other Image onto an Image
« Reply #6 on: May 04, 2010, 01:20:19 am »
But IMHO it is pretty stable, as I always use the latest svn release, and had no problem so far with it :)

 

anything