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

TypeScript Text Error


VBConst68
 Share

Recommended Posts

I'm new to HTML5 game development and am using Phaser.  I decided to convert the tutorial to TypeScript as practice, but am getting an error.

 

The offending line: this.scoreText = this.game.add.text(16, 16, 'Score: 0', { fontSize: '32px', fill: '#000' });

I commented out the line and the error went away. 

 

The error: JavaScript runtime error: Unable to get property ''x' of undefined or null reference

The error is thrown on Phaser.js line 24853, rect is undefined. 

 

Can anyone see what I'm doing wrong?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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