new UIButton(callback, context, position, size, text, textSize) → {UIButton}
Creates a button for UI
Parameters:
Name | Type | Description |
---|---|---|
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 |
- Source:
Returns:
- Type
- UIButton
Methods
_setBG()
Private function that sets the button background based on current button state
- Source:
_setTextColor()
Private function that sets the text color based on current button state
- Source:
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
setBGClickColor(color)
Sets the background's click color
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<float> | The desired Color for when the background is clicked |
- Source:
setBGColor(color)
Sets the background's color
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<float> | The desired Color for the background |
- Source:
setBGHoverColor(color)
Sets the background's hover color
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<float> | The desired Color for when the background is hovered over |
- Source:
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:
setHoverTextColor(color)
Sets the color of the text when button is hovered
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<Array> | the new color of the text when button is hovered over |
- Source:
setStencil(stencilSprite)
Sets the sprite to be used for the Stencil
Parameters:
Name | Type | Description |
---|---|---|
stencilSprite |
String | Location of the Sprite to be used for Stenciling |
- 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: