Add Virtual Joystick component

A place to request and discuss new engine features / functionality

Add Virtual Joystick component

Postby StuartTresadern » Sat Dec 28, 2013 4:10 pm

Currently I am using to add joystick support.

I just include the library in the ClientConfig add a container div to index.html <div id="container"></div>.

In my client.js I setup the joystick

Code: Select all
self.joystick = new VirtualJoystick({
                        container: document.getElementById('container'),
                        mouseSupport: true,
                        stationaryBase: true,
                        baseX: 200,
                        baseY: 200,
                        limitStickTravel: true,
                        stickRadius: 50

and then I can access it inside my PlayerComponent for example:

Code: Select all
            direction += 'N';
            direction += 'S';
            direction += 'W';
            direction += 'E';

this implementation is not ideal and if I have time I will create a component for it but for now it does the job very well.
User avatar
Posts: 59
Joined: Sun Dec 01, 2013 5:23 pm
Location: Germany

Return to New Feature Discussion

Who is online

Users browsing this forum: No registered users and 1 guest