enriqueto Posted August 22, 2014 Share Posted August 22, 2014 this works for Android but not for iOS: bmd = this.game.add.bitmapData( 16 , 64, 'dark_gradient', true); for(var i= 0; i <16;i++){ for(var j= 0; j < 64; j++){ bmd.setPixel32(i,j, 40 * (64 -j) / 64, 57 * (64 -j) / 64, 57 * (64 -j) / 64, 255); }} any clue? Link to comment Share on other sites More sharing options...
enriqueto Posted August 27, 2014 Author Share Posted August 27, 2014 setPixel doesn't work on safari I'll tried this phaser example using safari and it didn't work: http://examples.phaser.io/_site/view_full.html?d=display&f=bitmapdata+set+pixel.js&t=bitmapdata%20set%20pixel however I could generate a gradient bitmap using the context of the bitmapdata: bmd = this.game.add.bitmapData( 16 , 64, 'dark_gradient', true);var grd = bmd.ctx.createLinearGradient(0,0,0,64);grd.addColorStop(0, "#283939"); // sets the first colorgrd.addColorStop(1, "#000000"); // sets the second colorbmd.ctx.fillStyle = grd;bmd.ctx.fillRect(0,0,16,64); Link to comment Share on other sites More sharing options...
Recommended Posts