Comments (6)
Thanks, I've added the plugin link on wikipedia phaser 3 page
from phaser3-rex-notes.
Yes, you can use that virtual joystick plugin without using import
. Here is an example about how to install phaser plugin.
In preload stage, call
var url = 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/plugins/dist/rexvirtualjoystickplugin.min.js';
this.load.plugin('rexvirtualjoystickplugin', url, true);
to download and install virtual joystick plugin from an external file, then create a new virtual joystick instance via
var joyStick = this.plugins.get('rexvirtualjoystickplugin').add(this, config);
from phaser3-rex-notes.
Yes, you can use that virtual joystick plugin without using
import
. Here is an example about how to install phaser plugin.
In preload stage, callvar url = 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/plugins/dist/rexvirtualjoystickplugin.min.js'; this.load.plugin('rexvirtualjoystickplugin', url, true);to download and install virtual joystick plugin from an external file, then create a new virtual joystick instance via
var joyStick = this.plugins.get('rexvirtualjoystickplugin').add(this, config);
Thanks it works now
from phaser3-rex-notes.
Hi,
I am using this same plugin and method, but I am getting an error in my console:
Uncaught TypeError: n.onDown is not a function
class MyScene extends Phaser.Scene{
preload() {
this.load.plugin('rexvirtualjoystickplugin', 'https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/dist/rexvirtualjoystickplugin.min.js', true);
}
create() {
this.joyStick = this.plugins.get('rexvirtualjoystickplugin').add(this, {
x: this.game.config.width * 0.5,
y: 680,
radius: 60,
base: this.add.circle(0, 0, 100, 0x888888),
thumb: this.add.circle(0, 0, 50, 0xcccccc),
// dir: '8dir', // 'up&down'|0|'left&right'|1|'4dir'|2|'8dir'|3
// forceMin: 16,
// enable: true
}).on('update', this.dumpJoyStickState, this);
this.text = this.add.text(0, 0);
this.dumpJoyStickState();
}
dumpJoyStickState() {
var cursorKeys = this.joyStick.createCursorKeys();
var s = 'Key down: ';
for (var name in cursorKeys) {
if (cursorKeys[name].isDown) {
s += name + ' ';
}
}
s += '\n';
s += ('Force: ' + Math.floor(this.joyStick.force * 100) / 100 + '\n');
s += ('Angle: ' + Math.floor(this.joyStick.angle * 100) / 100 + '\n');
this.text.setText(s);
}
}
Is there something I am missing?
from phaser3-rex-notes.
Please use latest phaser3.
from phaser3-rex-notes.
Please use latest phaser3.
Thank you this worked for me.
from phaser3-rex-notes.
Related Issues (20)
- The plugins are not working in my lit/TS Project HOT 5
- Rex Dialog cover gets proportionally smaller as camera zoom level is increased. HOT 18
- Rex Dialog cannot be set to be ignored by a camera HOT 1
- Overflow not working with scrollablePanel HOT 3
- Type Scene Parameter with typescript HOT 1
- Gestures: target specific game objects HOT 4
- How can I completely remove scrollablepanel HOT 3
- RexCutJigsawImage is not working on iPad HOT 2
- Does UI component support on-demand introduction? HOT 8
- BBCodeTextPlugin erroring on import HOT 8
- Does the text in this component support scrolling beyond the height of the container instead of pagination HOT 12
- rex-ui HOT 25
- organizing imports HOT 9
- 求助大佬一个问题,我想写一个聊天框,但发现每次快速添加消息,会导致整个游戏卡顿 HOT 1
- Can I add scrollablePanel to a containerLite HOT 1
- Add child with dynamic height for scrollablePanel
- BBCodeText background corner radius becomes square on editing HOT 2
- How to only interact with child of sizer in scrollable panel? HOT 4
- Add game objects from outside rexUI dialog HOT 1
- How to interact with buttons in gridButtons HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phaser3-rex-notes.