michaelcalkins Posted June 3, 2016 Share Posted June 3, 2016 The black boxes happen in Firefox but not in Chrome! The black box is supposed to be pants. Any ideas what this is? Link to comment Share on other sites More sharing options...
drhayes Posted June 3, 2016 Share Posted June 3, 2016 Are these in a sprite atlas? Any chance the atlas JSON is getting loaded differently in Firefox for some reason, like server config? (total guess!) michaelcalkins 1 Link to comment Share on other sites More sharing options...
michaelcalkins Posted June 3, 2016 Author Share Posted June 3, 2016 1 minute ago, drhayes said: Are these in a sprite atlas? Any chance the atlas JSON is getting loaded differently in Firefox for some reason, like server config? (total guess!) No sprite atlas just a spritesheet. Preload this.load.spritesheet('commando', '/images/commando.png', 300, 315) Create this.player = this.add.sprite(spawnPoint.x, spawnPoint.y, 'commando') this.player.scale.setTo(GameConsts.PLAYER_SCALE) this.player.anchor.setTo(GameConsts.PLAYER_ANCHOR) this.player.height = 91 this.player.width = 94 this.player.debug = true // We need to enable physics on the player this.physics.arcade.enable(this.player) // Enable physics on the player this.game.physics.enable(this.player, Phaser.Physics.ARCADE) // Make player collide with world boundaries so he doesn't leave the stage this.player.body.collideWorldBounds = true // Set player minimum and maximum movement speed this.player.body.maxVelocity.setTo(GameConsts.MAX_SPEED, GameConsts.MAX_SPEED * 10) // x, y // Add drag to the player that slows them down when they are not accelerating this.player.body.drag.setTo(GameConsts.DRAG, 0) // x, y this.player.body.setSize(145, 295, 0, -3) // Our two animations, walking left and right. this.player.animations.add('left', GameConsts.ANIMATION_LEFT, GameConsts.ANIMATION_FRAMERATE, true) this.player.animations.add('right', GameConsts.ANIMATION_RIGHT, GameConsts.ANIMATION_FRAMERATE, true) this.player.animations.add('death', GameConsts.ANIMATION_DEATH, 20, false) Link to comment Share on other sites More sharing options...
drhayes Posted June 3, 2016 Share Posted June 3, 2016 Now I have no idea. Sorry! Link to comment Share on other sites More sharing options...
michaelcalkins Posted September 14, 2016 Author Share Posted September 14, 2016 Hmmm still getting this in Firefox only... @rich Possible phaser bug? Link to comment Share on other sites More sharing options...
samme Posted September 15, 2016 Share Posted September 15, 2016 My Firefox says "Error: WebGL: texImage2D: Requested size at this level is unsupported." michaelcalkins 1 Link to comment Share on other sites More sharing options...
yahiko Posted September 15, 2016 Share Posted September 15, 2016 Maybe a stupiid advice, but have you tried to manually clear the cache of Firefox? Link to comment Share on other sites More sharing options...
lewster32 Posted September 15, 2016 Share Posted September 15, 2016 Is your spritesheet a power of two size? I.e. are both the width and the height a power of two (they don't necessarily need to be the same)? It seems like this may be what the error is referring to. Link to comment Share on other sites More sharing options...
michaelcalkins Posted September 15, 2016 Author Share Posted September 15, 2016 13 hours ago, samme said: My Firefox says "Error: WebGL: texImage2D: Requested size at this level is unsupported." I just saw that in when I found where the console was in Firefox. At least I know what the error is now. 10 hours ago, yahiko said: Maybe a stupiid advice, but have you tried to manually clear the cache of Firefox? hahah not stupid extremely valid and I did many times just in case. 7 hours ago, lewster32 said: Is your spritesheet a power of two size? I.e. are both the width and the height a power of two (they don't necessarily need to be the same)? It seems like this may be what the error is referring to. The image in question is 10,800x329. I can reduce this in size because I think I scale down atm. Link to comment Share on other sites More sharing options...
lewster32 Posted September 15, 2016 Share Posted September 15, 2016 I would rearrange your spritesheet to fit in a 2048x2048 image and try again. Pretty much all sprite packing tools have the ability to do this, and it'll ensure that your image can be loaded on pretty much any device/browser correctly. I'd further recommend you switch to a sprite atlas, as you'd be able to pack a lot more of your graphics into a single image (which could vastly improve the performance of your game on GPU-powered devices) by using something such as TexturePacker: https://www.codeandweb.com/texturepacker michaelcalkins 1 Link to comment Share on other sites More sharing options...
rgk Posted September 17, 2016 Share Posted September 17, 2016 Just so you know, I see this in Chrome (the black box for pants). Here are the errors: WebGL: INVALID_VALUE: texImage2D: width or height out of range 153/game?roomId=chilly-zebra-75:1 [.Offscreen-For-WebGL-0x110520a73000]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. 102game:1 [.Offscreen-For-WebGL-0x110520a73000]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. Link to comment Share on other sites More sharing options...
michaelcalkins Posted September 22, 2016 Author Share Posted September 22, 2016 On 9/15/2016 at 8:36 AM, lewster32 said: I would rearrange your spritesheet to fit in a 2048x2048 image and try again. Pretty much all sprite packing tools have the ability to do this, and it'll ensure that your image can be loaded on pretty much any device/browser correctly. I'd further recommend you switch to a sprite atlas, as you'd be able to pack a lot more of your graphics into a single image (which could vastly improve the performance of your game on GPU-powered devices) by using something such as TexturePacker: https://www.codeandweb.com/texturepacker I can't believe I wasn't using that before. It's fixed now lewster32 1 Link to comment Share on other sites More sharing options...
michaelcalkins Posted September 22, 2016 Author Share Posted September 22, 2016 On 6/3/2016 at 7:41 AM, drhayes said: Are these in a sprite atlas? Any chance the atlas JSON is getting loaded differently in Firefox for some reason, like server config? (total guess!) They were not before but I just learned how to use atlas JSON in phaser and it worked! Link to comment Share on other sites More sharing options...
Recommended Posts