rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 262 forks source link

Type Scene Parameter with typescript #416

Closed ngodinhdai286 closed 6 months ago

ngodinhdai286 commented 6 months ago

I make a scrollablePanel and I create function createGrid to create child for scrollablePanel with Typescript But I don't know exactly what the type for the scene parameter, I tried Phaser.Scene but I warned me Could you help me declear type for scene parameter code

rexrainbow commented 6 months ago

Might add define of rexUI member like that :

import 'phaser';
import RexUIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';
declare module 'phaser' {
  interface Scene {
    rexUI: RexUIPlugin;
  }
}