Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Give an Object a graphic
Print
Pages: [
1
]
Author
Topic: Give an Object a graphic (Read 1487 times)
0 Members and 1 Guest are viewing this topic.
Ranzini
Newbie
Posts: 2
Give an Object a graphic
«
on:
September 28, 2022, 08:50:55 am »
So im new to SFML and im curious if there is a way to give an object, like a rectangle a graphic and make it move by moving the rectangle
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11032
Re: Give an Object a graphic
«
Reply #1 on:
September 28, 2022, 09:43:05 am »
If by graphic you mean a texture, then yes, you can set a texture on a RectangleShape or you can also use a Sprite if you just want the shape properties.
See the tutorial section for more information:
https://www.sfml-dev.org/tutorials/2.5/graphics-sprite.php
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
»
Give an Object a graphic