Class: UISpriteButton

UISpriteButton(buttonSprite, callback, context, position, size, text, textSize) → {UISpriteButton}

new UISpriteButton(buttonSprite, callback, context, position, size, text, textSize) → {UISpriteButton}

Creates a button for UI that can use a sprite
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
Source:
Returns:
Type
UISpriteButton

Methods

_setBG()

Private function that sets the button background based on current button state
Source:

draw(aCamera)

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

setBGClickUVs(left, right, bottom, top)

Sets the UVs for when Button is being clicked
Parameters:
Name Type Description
left type
right type
bottom type
top type
Source:

setBGHoverUVs(left, right, bottom, top)

Sets the UVs for when Button is being hovered over
Parameters:
Name Type Description
left type
right type
bottom type
top type
Source:

setBGNormalUVs(left, right, bottom, top)

Sets the UVs for when Button is not being interacted with
Parameters:
Name Type Description
left type
right type
bottom type
top type
Source: