The_dude8080 Posted October 29, 2016 Share Posted October 29, 2016 Greetings. I am seeking for a way that allows players to draw their own characters and later to be able to play with them in-game. To make the concept very simple lets make the drawn player just a 2d shape or a group of lines and circles or even a mix of both. I think this can be decomposed in these steps: An empty canvas is made for the user to create what he wants: By painting or something of that genre; By using a specific polygon creation interface that allows dragging and molding shapes; Note: I was able to create a way to paint on canvas but I didn't find a way to let user drag and create shapes or something of that kind. I would more likely opt for the second option so some suggestions on how do this would be really appreciated. Somehow, I only get the user drawn / shaped creation from all the canvas. There should be a way to "surround" what the user has created and then save it: By (in the drawing case probably) checking only for the color comparison between the white and the player color; By, somehow, defining different points that all together would countain the user creation (either drawn or shaped); Note: In this case I am kind of lost. I have almost no clue of how this could be made. However, I have heard of box2d but I think it was more focused in C or something of that kind? Would it work and how could I do it? I would finally have the user creation stored and ready to load it in game as an image of a sprite. I hope I could explain it all correctly. Can someone give me some orientation on this? Link to comment Share on other sites More sharing options...
lihis Posted October 31, 2016 Share Posted October 31, 2016 Hello. Have you considered using something like http://literallycanvas.com/ or some other javascript paint-thingamathing in your project? It seems to have pretty nice features and apparently has a way to save / export the images created. Might be worth looking into, i don't know how hard it would be to get it working with phaser. I'd guess it can't be that difficult? Maybe it is, but just an idea. The_dude8080 1 Link to comment Share on other sites More sharing options...
The_dude8080 Posted October 31, 2016 Author Share Posted October 31, 2016 1 hour ago, lihis said: Hello. Have you considered using something like http://literallycanvas.com/ or some other javascript paint-thingamathing in your project? It seems to have pretty nice features and apparently has a way to save / export the images created. Might be worth looking into, i don't know how hard it would be to get it working with phaser. I'd guess it can't be that difficult? Maybe it is, but just an idea. Not a bad idea at all Thank you very much Link to comment Share on other sites More sharing options...
samme Posted October 31, 2016 Share Posted October 31, 2016 You can create a BitmapData object for "painting" and a Graphics object for polygons. Call `generateTexture()` to save an image. The_dude8080 1 Link to comment Share on other sites More sharing options...
The_dude8080 Posted October 31, 2016 Author Share Posted October 31, 2016 @samme very nice! will try it samme Link to comment Share on other sites More sharing options...
Recommended Posts