Documentation Topics
Function

PRVirconBtnAdd()

Adds a new virtual button to the PRVircon UI.


Declaration

PRVirconBtnAdd(name, sprite, spriteSel, hAlign, vAlign, xOffsetPos, yOffsetPos, scale, scaleSel, rotation)

Parameters

name

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

sprite

The sprite image to use for the button.

spriteSel

The sprite image to use for the button when it is pressed. Set to noone to use the same sprite given in sprite.

hAlign

Set to PRVirconHAlignLeft, PRVirconHAlignCenter or PRVirconHAlignRight. Determines if the button'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 button's Y offset should be relative to the top, middle or bottom of the GUI display.

xOffsetPos

The x position of the button, 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 button, 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 button's sprite, with 1 being no scaling. Larger values will increase the size of the sprite while values lower than 1 will decrease the size.

scaleSel

How much to scale the button's sprite when it is pressed, with 1 being no scaling. Larger values will increase the size of the sprite while values lower than 1 will decrease the size. Set to a smaller scale value than scale to make the button appear to animate when it's pressed.

rotation

The angle at which to rotate the button sprite in degrees.

Return Value

The new virtual button's ID.