class FunkinButton
package funkin.mobile.ui
extends FunkinSprite
implements IFlxInput
extended by FunkinBackButton, FunkinHint
Available on all platforms
A simple button class that calls a function when touched.
Static variables
staticbuttonsTouchID:Map<Int, FunkinButton> = new Map()
A map that's storing every active touch's ID that's pressing a button.
Constructor
new(x:Float = 0, y:Float = 0)
Creates a new FunkinButton object.
Parameters:
x | The x position of the button. |
|---|---|
y | The y position of the button. |
Variables
ignoreDownHandler:Bool = false
Whether the button should skip calling onDownHandler() on touch.pressed.
read onlyonDown:FlxSignal = new FlxSignal()
The callback function to call when the button is pressed down.
read onlyonOut:FlxSignal = new FlxSignal()
The callback function to call when the button is no longer hovered over.
polygon:Null<Array<Float>> = null
The vertices of the polygon defining the button's hitbox. The array should contain points in the format: [x1, y1, x2, y2, ...]. If the array is empty, the polygon is ignored, and the default hitbox is used.
radius:Float = 0
A radius for circular buttons. If this radius is larger than 0 then the overlap check will look if the touch point is inside this raius.
status:FunkinButtonStatus
The current state of the button, either FunkinButtonStatus.NORMAL or FunkinButtonStatus.PRESSED.