Have ideas to improve npm?Join in the discussion! »

    phaser3-vjoy-plugin

    1.0.2 • Public • Published

    Package version Total downloads License

    Phaser 3 VJoy Plugin

    A simple plugin for Phaser 3 to allow you to use a joystick in your computer or mobile game.

    Getting Started

    To install it with npm, run :

    npm i phaser3-vjoy-plugin --save
    

    Usage

    Load the Plugin

    As in the phaser documentation, do something like this :

    import 'phaser';
    import VJoyPlugin from 'phaser3-vjoy-plugin';
    
    ...
    
    this.plugins.installScenePlugin('VJoyPlugin', VJoyPlugin, 'vjoy', this);
    
    // and from within the scene :
    this.sys.VJoyPlugin; // key value
    this.vjoy; // mapping value

    or, if you just use the dist file :

    this.load.scenePlugin('VJoyPlugin', './VJoyPlugin.js', null, 'vjoy');

    Examples

    To test the plugin, check the online demo.

    If you want to see the full implementation, you can find an example in the demo directory, you can run npm run demo to test it.

    Or, if you want to use import statement, you can go to phaser3-vjoy-plugin-demo.

    Development

    Run npm install and then npm run build to build the plugin.

    References

    Install

    npm i phaser3-vjoy-plugin

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    50.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar