Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

BitmapText and Firefox


Hsaka
 Share

Recommended Posts

I've been having some issues with using BitmapText with my game, Sky Legend on Firefox. All is fine if I replace BitmapText with normal Text objects, but when rendering some BitmapText objects, Firefox gives this error:

IndexSizeError: Index or size is negative or greater than the allowed amount

 

On line 34124 in Phaser.js:

if(displayObject instanceof PIXI.Sprite){	var frame = displayObject.texture.frame;				if(frame)	{		context.globalAlpha = displayObject.worldAlpha;						if (displayObject.texture.trimmed)		{			context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2] + displayObject.texture.trim.x, transform[5] + displayObject.texture.trim.y);		}		else		{			context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);		}							context.drawImage(displayObject.texture.baseTexture.source, 				frame.x,				frame.y,				frame.width,				frame.height,				(displayObject.anchor.x) * -frame.width, 				(displayObject.anchor.y) * -frame.height,				frame.width,				frame.height);	}					   }

It appears that this error is caused when frame.height is zero. At no time do I set a BitmapText object's height to be zero.

This error only occurs in Firefox.

Link to comment
Share on other sites

This is related to one of two things, either the bug I fixed earlier today (now in dev branch) about the XML data being seen as strings, not integers, OR its because the Bitmap Texts XML file is encoded with something other than UTF8. If it's UTF16 for example then Firefox won't parse it. Check that first as it could be all you need to do.

Link to comment
Share on other sites

Thanks for the quick response Rich. I tried using the latest dev version and making sure the file is UTF8. I still see the same error in Firefox. Some bitmap text objects are being rendered but others are not. Also, with the latest dev version, Firefox no longer freezes up on encountering that error; I can still click on buttons and stuff.

Link to comment
Share on other sites

@Hsaka :

 

try to edit width and height of character 32 in your desyrel.xml file

set width and height of character to "1"

<char id="32" x="305" y="391" width="0" height="0" xoffset="23" yoffset="81" xadvance="23" page="0" chnl="0" letter="space"/>

looks like this is pixi related issue : http://goo.gl/8pgjNs

 

-bubamara

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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