Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Question about SFML like entity's
Print
Pages: [
1
]
Author
Topic: Question about SFML like entity's (Read 1955 times)
0 Members and 1 Guest are viewing this topic.
Mr_Blame
Full Member
Posts: 192
Question about SFML like entity's
«
on:
April 16, 2015, 11:29:51 am »
Hello
After viewing some sfml tutorials about vertex arrays I have made class called "Canvas"( it is a smaller and simpler replacement of sprite when you don't need full transform stuff). So the question is how to make a function that changes the texture of this "Canvas"?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Question about SFML like entity's
«
Reply #1 on:
April 16, 2015, 12:36:09 pm »
What's your problem exactly? Don't hesitate to have a look at the source code of sf::Sprite is something is not clear, it's not complicated.
Logged
Laurent Gomila - SFML developer
Mr_Blame
Full Member
Posts: 192
Re: Question about SFML like entity's
«
Reply #2 on:
April 16, 2015, 02:05:29 pm »
How to make a function that changes the texture of myself-made sfml entity that was made with vertex array
Logged
eXpl0it3r
SFML Team
Hero Member
Posts: 11034
AW: Question about SFML like entity's
«
Reply #3 on:
April 16, 2015, 02:23:30 pm »
Pass a different texture through render states when drawing your vertexarray. How you do it in your code, is your job to figure out.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: Question about SFML like entity's
«
Reply #4 on:
April 16, 2015, 02:25:09 pm »
Ehm... just draw the vertex array with another texture? Where's the problem? I assume you know how to write a C++ function, and how to read the documentation about
sf::VertexArray
...
And please read
this post
carefully, it will help you get better answers.
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Mr_Blame
Full Member
Posts: 192
Re: Question about SFML like entity's
«
Reply #5 on:
April 16, 2015, 03:25:26 pm »
I know that i must change texture in render states. but the most strange thing is that: when I change the texture - nothing changes. The entity still appears with old texture.
«
Last Edit: April 16, 2015, 03:34:57 pm by Mr_Blame
»
Logged
Nexus
SFML Team
Hero Member
Posts: 6287
Thor Developer
Re: Question about SFML like entity's
«
Reply #6 on:
April 16, 2015, 04:06:27 pm »
Seriously, read the post I linked to, and then post again.
Logged
Zloxx II
: action platformer
Thor Library
: particle systems, animations, dot products, ...
SFML Game Development
:
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Question about SFML like entity's
anything