Documentation Topics
Function

PRVirconJoyAdd()

Adds a new virtual joystick to the PRVircon UI.


Declaration

PRVirconJoyAdd(name, nubSprite, outlineSprite, hAlign, vAlign, xOffsetPos, yOffsetPos, scale, rotation)

Parameters

name

The name to assign to the new joystick. Useful for tracking it in the GMS debugger and can be used to lookup the joystick's ID.

nubSprite

The sprite image to use for the joystick's nub.

outlineSprite

The sprite image to use for the joystick's bounds outline.

hAlign

Set to PRVirconHAlignLeft, PRVirconHAlignCenter or PRVirconHAlignRight. Determines if the joystick's X offset should be relative to the left, center or right side of the GUI display.

vAlign

Set to PRVirconVAlignTop, PRVirconVAlignMiddle or PRVirconVAlignBottom. Determines if the joystick's Y offset should be relative to the top, middle or bottom of the GUI display.

xOffsetPos

The x position of the joystick, relative to either the left, center or right of the GUI display, depending on the value given in hAlign.

yOffsetPos

The y position of the joystick, relative to either the top, middle or bottom of the GUI display, depending on the value given in vAlign.

scale

How much to scale the joystick sprites, with 1 being no scaling. Larger values will increase the size of the sprites while values lower than 1 will decrease the size of the sprites.

rotation

The angle at which to rotate the joystick sprites in degrees.

Return Value

The new virtual joystick's ID.