Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
difference between a Sprite and a Shape.
Print
Pages: [
1
]
Author
Topic: difference between a Sprite and a Shape. (Read 4567 times)
0 Members and 1 Guest are viewing this topic.
vams
Newbie
Posts: 8
difference between a Sprite and a Shape.
«
on:
May 16, 2013, 05:57:08 pm »
I everyone,
another noob question from vams :
What's the difference between a Sprite and a Shape with an attached texture?
More precisely, what are Sprite needed for if I can just put the same texture on a rectangular shape?
Logged
zsbzsb
Hero Member
Posts: 1409
Active Maintainer of CSFML/SFML.NET
Re: difference between a Sprite and a Shape.
«
Reply #1 on:
May 16, 2013, 06:02:07 pm »
Sprites is directly for defining how a texture gets displayed. A shape can be used to display a texture in the shape you want it, a sprite can not do this. A sprite is needed because making a rectangle shape for every texture is more cumbersome and has slightly more overhead and at the same time just over complicates your code.
Logged
Motion / MotionNET
- Complete video / audio playback for SFML / SFML.NET
NetEXT
- An SFML.NET Extension Library based on
Thor
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
Re: difference between a Sprite and a Shape.
«
Reply #2 on:
May 16, 2013, 06:05:01 pm »
Both classes are higher class abstraction of a textured quad and thus both come with different helper functions. So in the end it doesn't really matter what you use as long as it does work.
If you want to go a step down from the abstraction, you'll want to take a look at the
sf::VertexArray
, since that will be able to use a textured quad directly.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
difference between a Sprite and a Shape.
anything