Skip to content

Error when not setting bitmap font #6

@eduardobreno

Description

@eduardobreno

Hi, I'm getting this error when I dont use bitmap font.

Phaser.Cache.getBitmapFont: Key "Arial" not found in Cache.

phaser.min.js:3 Uncaught TypeError: Cannot read property 'font' of null
    at c.BitmapText.updateText (phaser.min.js:3)
    at new c.BitmapText (phaser.min.js:3)
    at c.GameObjectFactory.bitmapText (phaser.min.js:3)
    at enableTypingSpecificMessage (typewriter.js:45)
    at start (typewriter.js:26)
    at Object.start (typewriter.js:111)
    at EJ.Story.create (Story.js:20)
    at c.StateManager.loadComplete (phaser.min.js:3)
    at c.Loader.finishedLoading (phaser.min.js:3)
    at c.Loader.processLoadQueue (phaser.min.js:3)

Here my code, even if I comment fontFamily it return error.

	var typewriter = new Typewriter();
	typewriter.init(game, {
		x: 290,
		y: 40,
		fontFamily: "Arial",
		fontSize: 26,
		maxWidth: 300,
		sound: this.game.add.audio('track'),
		text: "Some text to be typed!"
	});
	typewriter.start();

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions