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

Author Topic: Why sprites?  (Read 2343 times)

0 Members and 1 Guest are viewing this topic.

kekie

  • Newbie
  • *
  • Posts: 5
    • View Profile
Why sprites?
« on: October 13, 2016, 04:22:15 am »
Why would one use a
sf::Sprite
instead of a
sf::RectangleShape
Reading the graphics module tutorial doesn't reveal any obvious difference between the two?

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: Why sprites?
« Reply #1 on: October 13, 2016, 05:33:17 am »
RectangleShape have few more methods.

But i think sf::Sprite its more intuitive.
I would like a spanish/latin community...
Problems building for Android? Look here

kekie

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Why sprites?
« Reply #2 on: October 13, 2016, 06:21:49 am »
Yeah, RectangleShapes can do just straight colors with borders, and sprites have to be textured it seems. Are there any other differences?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Why sprites?
« Reply #3 on: October 13, 2016, 07:20:26 am »
sf::Sprite is more focused on displaying a textured quad, so it is a little more efficient than sf::RectangleShape at doing it.
Laurent Gomila - SFML developer

kekie

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Why sprites?
« Reply #4 on: October 14, 2016, 05:39:10 am »
Ahh - that makes sense. Thanks!

 

anything