cdrch Posted August 15, 2016 Share Posted August 15, 2016 I am attempting to develop a method of procedurally generating images for a game that I am making with Ga. The actual generation is not relevant here; my question is how do I turn an image on an HTML5 canvas into a Ga sprite? By default, Ga sprites accept a link to the source name, which is normally loaded in by ga.assets.load(), either at the start of the game or when called. However, I see no easy way to instead pass, say, a dataURL or other format easily obtainable from a (hidden) canvas. Or, alternatively, how can I develop an alternative to ga.sprite that acts exactly the same except for using my created images from a canvas instead of loading a source from disk? Link to Ga: https://github.com/kittykatattack/ga Ga.Sprite: https://github.com/kittykatattack/ga/blob/master/ga.js#L1461 Ga.Assets: https://github.com/kittykatattack/ga/blob/master/ga.js#L2065 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.