Pop up

Introduction

Scale up (i.e. ease scaleX, scaleY from 0 to 1) game object.

  • Author: Rex
  • Method only

Usage

Sample code

Install plugin

Load minify file

  • Load plugin (minify file) in preload stage
    scene.load.plugin('rexscaleplugin', 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rexscaleplugin.min.js', true);
    
  • Pop-up object
    scene.plugins.get('rexscaleplugin').popup(gameObject, duration);
    

Import plugin

  • Install rex plugins from npm
    npm i phaser3-rex-plugins
    
  • Install plugin in configuration of game
    import ScalePlugin from 'phaser3-rex-plugins/plugins/scale-plugin.js';
    var config = {
        // ...
        plugins: {
            global: [{
                key: 'rexScale',
                plugin: ScalePlugin,
                start: true
            },
            // ...
            ]
        }
        // ...
    };
    var game = new Phaser.Game(config);
    
  • Pop-up object
    scene.plugins.get('rexScale').popup(gameObject, duration);
    

Import class

  • Install rex plugins from npm
    npm i phaser3-rex-plugins
    
  • Import class
    import PopUp from 'phaser3-rex-plugins/plugins/popup.js';
    
  • Pop-up object
    PopUp(gameObject, duration);
    

Pop up

  • Pop up width and height
    scene.plugins.get('rexScale').popup(gameObject, duration);
    // popUp(gameObject, duration, undefined, ease);
    
  • Pop up width only
    scene.plugins.get('rexScale').popup(gameObject, duration, 'x');
    // popUp(gameObject, duration, 'x', ease);
    
  • Pop up height only
    scene.plugins.get('rexScale').popup(gameObject, duration, 'y');
    // popUp(gameObject, duration, 'y', ease);