SFML community forums

Bindings - other languages => DotNet => Topic started by: Vbitz on February 15, 2011, 07:52:11 am

Title: Drawing a Image with a RenderWindow
Post by: Vbitz 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)
Title: Drawing a Image with a RenderWindow
Post by: Laurent on February 15, 2011, 08:11:39 am
Sprites are made for this. Why don't you want to use them?
Title: Drawing a Image with a RenderWindow
Post by: Vbitz 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.
Title: Drawing a Image with a RenderWindow
Post by: Laurent 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.
Title: Drawing a Image with a RenderWindow
Post by: 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.