rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.22k stars 263 forks source link

Property 'rexUI' does not exist on type [Scene] #256

Closed xpluscal closed 2 years ago

xpluscal commented 2 years ago

I have the following code in

//game.ts
import 'phaser'
import RexUIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';

const config = {
...
  plugins: {
      scene: [{
          key: 'rexUI',
          plugin: RexUIPlugin,
          mapping: 'rexUI'
      },
    ]
  }
...
//MyScene.ts
import RexUIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';
...
export default class MyScene extends Phaser.Scene {
  constructor() {
    super(sceneConfig)
  }

  preload(){
    this.load.plugin('rexUI', RexUIPlugin, true);
  }

And I'm getting the error Property 'rexUI' does not exist on type 'MyScene'

What am I doing wrong here? Thx!

rexrainbow commented 2 years ago

Try this line, in MyScene