phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

interface BMFontChar wrong texture type defined #589

Open mcofko opened 6 years ago

mcofko commented 6 years ago

This Issue is about (pick one, ✏️ delete others)

fontData.chars[5000] = { x: f.x, y: f.y, width: f.width, height: f.height, xOffset: 1, yOffset: charA.yOffset + Math.floor((charA.height - f.height) / 2), xAdvance: f.width + 2, kerning: [], texture: new PIXI.Texture(font.base, new PIXI.Rectangle(f.x, f.y, f.width, f.height)) };

Changing texture type property in BMFontChar interface from PIXI.BaseTexture to PIXI.Texture solves the issue.

samme commented 6 years ago

So the TypeScript definition is wrong?

mcofko commented 6 years ago

I would guess so. But I did not make a thorough test. I'm not sure if changing the type breaks anything else.

samme commented 6 years ago

Did you get an error in the browser? What's the error message?

mcofko commented 6 years ago

I got this error: