Code Monkey home page Code Monkey logo

phaser3-vjoy-plugin's Introduction

Phaser 3 VJoy Plugin

Package version Libraries.io dependency status for latest release npm bundle size Total downloads License

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

The output javascript package is a classic script that could be loaded in a <script> tag in the browser, or loaded by Node.js or another bundler.

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

Good plugin examples:

phaser3-vjoy-plugin's People

Contributors

florianvazelle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

phaser3-vjoy-plugin's Issues

Device not defined

I'm getting this error on my android chrome
Uncaught ReferenceError: device is not defined LINE: 110
Also the joystick doesn't show up

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.