Using the iphone framework I was able to modify the pixels of a sprite but with the HTML5 framework I cannot figure out how to do it. Can anyone help please ?
Thank you
Claudio
Hi Claudio,
CanvasRenderingContext2D has three functions to modify the pixels of a canvas:
- CanvasRenderingContext2D.prototype.getImageData = function(sx,sy,sw,sh) {};
- CanvasRenderingContext2D.prototype.putImageData = function(image_data,dx,dy,dirtyX,dirtyY,dirtyWidth,dirtyHeight) {};
- CanvasRenderingContext2D.prototype.createImageData = function(imagedata_or_sw,sh) {};
Best regards
David
Sounds good. Thank you. But sorry. How to use it with a cc.Sprite object ?