Jump to content

V2.3.0 - Phaser error in Safari..


Nikow
 Share

Recommended Posts

Hi, I've to finish a game this week, and i test it today, it's working very well on chrome and firefox, but not in safari, i ve the first screen of the game, but right after clicking 'play' button, i fall on a black screen with this error on my js console :

[Error] TypeMismatchError: DOM Exception 17: The type of an object was incompatible with the expected type of the parameter associated to the object.createPattern (phaser2.3.0.min.js, line 6)_renderCanvas (phaser2.3.0.min.js, line 6)_renderCanvas (phaser2.3.0.min.js, line 3)_renderCanvas (phaser2.3.0.min.js, line 3)renderDisplayObject (phaser2.3.0.min.js, line 5)render (phaser2.3.0.min.js, line 5)updateRender (phaser2.3.0.min.js, line 9)update (phaser2.3.0.min.js, line 9)updateRAF (phaser2.3.0.min.js, line 14)_onLoop (phaser2.3.0.min.js, line 14)
Link to comment
Share on other sites

Thank you Rich,

 

Creations :

bgCity3 = game.add.tileSprite(0,0,3000,640,'decorsBG3');game.physics.arcade.enable(bgCity3);bgCity2 = game.add.tileSprite(0,0,3000,640,'decorsBG2');game.physics.arcade.enable(bgCity2);bgCity1 = game.add.tileSprite(0,0,3000,640,'decorsBG1');game.physics.arcade.enable(bgCity1);

And :

bgCity1.tilePosition.x -=  speed/10;
bgCity2.tilePosition.x -=  speed/20;
bgCity3.tilePosition.x -=  speed/30;

In Render function..

 

It's working perfectly on others browsers...

Link to comment
Share on other sites

The width is huge - that's a width of 3000 pixels, so it will literally try to create a texture that is 3000 pixels wide. You really don't want this, what you need is to create the TileSprite no larger than the game width, and then use tilePosition.x to scroll it.

 

Also what size is the png you're using? (dimensions, not file size).

Link to comment
Share on other sites

 

Perhaps try to apply Math.floor()

bgCity1.tilePosition.x -= Math.floor(speed/10);

bgCity2.tilePosition.x -=  Math.floor(speed/20);
bgCity3.tilePosition.x -=  Math.floor(speed/30);

 

It's not ok :/ 

Link to comment
Share on other sites

The width is huge - that's a width of 3000 pixels, so it will literally try to create a texture that is 3000 pixels wide. You really don't want this, what you need is to create the TileSprite no larger than the game width, and then use tilePosition.x to scroll it.

 

Also what size is the png you're using? (dimensions, not file size).

It's 3000px png, i create tilesprite at the same size than the png.

My scrolling bg width is 3000px ..

Link to comment
Share on other sites

Thank you Rich,

 

Creations :

bgCity3 = game.add.tileSprite(0,0,3000,640,'decorsBG3');game.physics.arcade.enable(bgCity3);bgCity2 = game.add.tileSprite(0,0,3000,640,'decorsBG2');game.physics.arcade.enable(bgCity2);bgCity1 = game.add.tileSprite(0,0,3000,640,'decorsBG1');game.physics.arcade.enable(bgCity1);

And :

bgCity1.tilePosition.x -=  speed/10;
bgCity2.tilePosition.x -=  speed/20;
bgCity3.tilePosition.x -=  speed/30;

In Render function..

 

It's working perfectly on others browsers...

 

If i delete these lines, it's work on safari ( but very poor performance)..

 

Any ideas ?

Link to comment
Share on other sites

I Rich, Same prob on safari with 960x640 images ?

 

Need help please..

 

for everyboy, do never create tilesprites on two differents states with same name....

It's solved all my probs...

 

Thanks all !

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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