Jump to content

setPixel32 problem on iOS


enriqueto
 Share

Recommended Posts

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

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 color
grd.addColorStop(1, "#000000"); // sets the second color
bmd.ctx.fillStyle = grd;
bmd.ctx.fillRect(0,0,16,64);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...