Advanced Joystick is a class that creates a virtual joystick for Starling. Every frame it calculates the position of the stick and translate those values to velocityX and velocityY, both as normalized values, meaning they are between -1 and 1.

It has a default skin for the stick and its holder, but it’s possible to replace them with custom graphics at runtime.


import starling.extensions.advancedjoystick.JoyStick;

var myJoystick:Joystick = new Joystick();
myJoystick.setPosition(myJoystick.minOffsetX, clientHeight - myJoystick.minOffsetY);
player.x += myJoystick.velocityX * maxSpeed;
player.y += myJoystick.velocityY * maxSpeed;
Input. URL.