SFML community forums
Help => Graphics => Topic started by: Aster on September 22, 2012, 10:35:20 am
-
Hello everyone, first post on these forums for me..
Anyways, I'm developing a game, and I'll be using Box2D in it. My original master plan was to let users add content with a simple configuration file and textures and whatnot. However, to accomplish this, I'll need to shape the Box2D polygons to the shape of the non-transparent part of each texture.. Has anyone ever done this? I'm not sure it would be the most efficient of all things, but it would be really useful to know if it's possible, and to get some tips..
Thanks in advance!
Aster
P.S: I have absolutely no idea where to post this, so I posted it in the place that seemed like the most vague of the all to me.
-
P.S: I have absolutely no idea where to post this
You're requesting Help about the Graphics module... wait... oh my god! There's a Help section with a Graphics sub-forum!
>:(
-
Thanks for moving it! I wasn't too sure that it was really graphics related, thanks for settling that for me. :)
-
I guess it's possible and as a preloading generator function it could also workout quite well.
SFML also supports the direct use of polygons though so you might want to let the users define their own polygon. ;)
It's hard to say how hard such a generator function is to implement, but you could try it. IIRC someone once wrote a tool that lets user construct their own polygons. Maybe you can find it by searching through the project forum.
-
I guess it's possible and as a preloading generator function it could also workout quite well.
My plan exactly.
SFML also supports the direct use of polygons though so you might want to let the users define their own polygon. ;)
I plan on letting the user do that, but for less advanced users, I also wanted to have the game create polygons itself.
It's hard to say how hard such a generator function is to implement, but you could try it. IIRC someone once wrote a tool that lets user construct their own polygons. Maybe you can find it by searching through the project forum.
I'll look around. Thanks for your help!
Aster
-
You would have to write an algorithm to find the vertices of the image. I'm sure it has been done before. From there it's pretty easy to translate that into a Box2D polygon.