Reputation: 3277
I want to build a game which the user can be able to create for him a character and after the game will convert it to PNG file for example.
The user will choose the clothes of the character and will see it online, when he finish - he will click finish and get it as PNG file.
With which language program i can build it? it possible with JS? Can you give me any clue?
Thank you.
Upvotes: 2
Views: 277
Reputation: 2670
It seems that you can do it with HTML5 and JS using the Canvas element:
Canvas2Image : Saving Canvas data to image file
Note that currently this won't work with Internet Explorer until IE9.
If you need to support IE, You should be able to do the interface in JS without much problem, and then use a server side language like PHP for generating the image.
Probably the best approach is using AJAX for getting the images for the character parts (clothes and so on), an then use it for sending the selected parts to the server which would return the composed image.
Upvotes: 3
Reputation: 58577
You could use Adobe Flash to provide a nice interactive GUI for this kind of thing. Then, use the export PNG
plugin to provide a file to download.
This approach has a few drawbacks. For example, you will need to buy the Adobe Flash software, and you're webapp will only work when users have an up to date plugin installed. Due to the proprietary nature of the flash player, your app just won't work on a small minority of platforms.
Nevertheless, depending on your use-case this may be the quickest, easiest way to get what you want to do done.
Upvotes: 0
Reputation: 45568
You could do it client-side with a canvas element - load the clothes images and draw them in the canvas.
If you want it to be old-browser-compatible, use some server-side script to generate an image.
Upvotes: 0