Virtual Joystick and Tap Button for Citrus Engine

Virtual Joystick and Tap Button for Citrus Engine

I’ve been working with Citrus Engine for a while. It is a well rounded framework and it allows fast prototyping.

Last year I created a Virtual Joystick to use with it and I’ve decided to re-take the project and make it useful in real life scenarios.

I’ve open a repository in Github and will be adding some cool stuff in the near future.

https://github.com/alesys/Citrus-Virtual-Controllers

Usage

joystick = new VJoystick('joystick',{
            container:this,
            viewknob: new Image(assets.getTexture('knob')),
            viewback: new Image(assets.getTexture('knobback')),
            radius: 64
        });

// Allways destroy it before changing states
joystick.destroy();

touchControl = new TapButton('touchControl',{trigger:'jump'});

// Allways destroy it before changing state
touchControl.destroy();

Here some tests: