Class: UIButton

UIButton(buttonSprite, callback, context, position, size, text, textSize, textColor, clickTextColor) → {UIButton}

new UIButton(buttonSprite, callback, context, position, size, text, textSize, textColor, clickTextColor) → {UIButton}

Creats a button for UI
Parameters:
Name Type Description
buttonSprite Texture The texture to base the button off of
callback function The function to call when the clicked button is released
context object Who the callback function belongs to
position Array.<Array> The base position for the UIButton
size Array.<Array> The size for the UIButton
text String The text for the UIButton
textSize int The text size for the UIButton
textColor Array.<Array> The text color for the UIButton
clickTextColor Array.<Array> The text color when the button is clicked
Source:
Returns:
Type
UIButton

Methods

draw(aCamera)

Draws the UIButton on a camera
Parameters:
Name Type Description
aCamera Camera The camera it will be drawn on
Source:

getText() → {UIText}

Returns the UIText on the UIButton
Source:
Returns:
Type
UIText

setClickTextColor(color)

Sets the color of the text when clicked
Parameters:
Name Type Description
color Array.<Array> the new color of the text when clicked
Source:

setTextColor(color)

Sets the color of the text
Parameters:
Name Type Description
color Array.<Array> the new color of the text
Source:

setTextHeight(height)

Set the height of the text
Parameters:
Name Type Description
height float The new height for the text
Source:

setTextString(text)

Set the text of the UIButton
Parameters:
Name Type Description
text String The new text
Source:

update()

Updates the UIButton
Source: