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

Author Topic: Drawing a Image with a RenderWindow  (Read 3108 times)

0 Members and 1 Guest are viewing this topic.

Vbitz

  • Newbie
  • *
  • Posts: 2
    • View Profile
Drawing a Image with a RenderWindow
« on: February 15, 2011, 07:52:11 am »
Is there any way I can draw a image with creating a new sprite?
Something like RenderWindow.Draw(Image img, float x, float y, float scalex, float scaley)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Drawing a Image with a RenderWindow
« Reply #1 on: February 15, 2011, 08:11:39 am »
Sprites are made for this. Why don't you want to use them?
Laurent Gomila - SFML developer

Vbitz

  • Newbie
  • *
  • Posts: 2
    • View Profile
Drawing a Image with a RenderWindow
« Reply #2 on: February 15, 2011, 08:21:14 am »
Quote from: "Laurent"
Sprites are made for this. Why don't you want to use them?


I do not want to use them because the engine I am making is using wrappers to make developing new content faster, a sprite would introduce another dependency to the end developer unless I wrote a wrapper that reimplements most of your functions, I want to keep any engine specific code into one or 2 classes so I can adapt to other renderers with less work.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Drawing a Image with a RenderWindow
« Reply #3 on: February 15, 2011, 08:45:40 am »
Ok I see. You can create a new sprite every time you want to draw an image, it's fine.
Laurent Gomila - SFML developer

  • Guest
Drawing a Image with a RenderWindow
« Reply #4 on: April 01, 2011, 07:05:20 am »
Why not using a single sprite and draw it a lot of times? for example, you can use a single sprite, change his properties an draw... change properties and draw, change and draw, etc. You can use an struct that represent the modificated values and have a list of them, iterate that list and set properties and draw foreach element.

 

anything