SFML community forums

Help => Graphics => Topic started by: solver on July 23, 2012, 08:42:54 pm

Title: Drawing sprites on screen issue [SOLVED]
Post by: solver on July 23, 2012, 08:42:54 pm
Hello. I have a question: what method i must use to put sprites on screen? I know 3:
I have not found the answer on the forum and other websites. Sorry for my english. Thanks.
Title: Re: Drawing sprites on screen issue
Post by: eXpl0it3r on July 23, 2012, 08:47:13 pm
What exactly is your problem?
You draw a sprite by calling window.draw(sprite); as it is documented in every graphical example (e.g. here (http://www.sfml-dev.org/documentation/2.0/)).
Title: Re: Drawing sprites on screen issue
Post by: solver on July 23, 2012, 09:59:51 pm
Ok. For example, I want to draw grid and I want to use function to do this job. At the first time I use this:
void draw_grid (sf::RenderWindow &App)
{
    /*Some code*/
        App.Draw (line);
    /*...*/
}
 
Another 2 methods I descibed in my first post.
Title: Re: Drawing sprites on screen issue
Post by: eXpl0it3r on July 23, 2012, 11:56:27 pm
I advice you not use SFML 1.6 anymore but to switch to SFML 2rc. ;)

What is your issue with that code?
I don't understand what your problem is. Are you asking for the 'best' solution? Or is there an actual problem?
Title: Re: Drawing sprites on screen issue
Post by: solver on July 24, 2012, 09:02:29 am
>Are you asking for the 'best' solution?
Yes. This is exactly what I was looking for.
Title: Re: Drawing sprites on screen issue
Post by: eXpl0it3r on July 24, 2012, 11:09:11 am
There's no such thing as a 'best' solution. This highly depens on your code design and needs. If the current method works then go with it. ;)
Title: Re: Drawing sprites on screen issue
Post by: solver on July 24, 2012, 12:05:50 pm
Thanks. Now I can start refactoring.
</tread>