Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class App.Button extends createjs.Container
constructor: (buttonOptions={}) ->
defaultButtonOptions =
text: null
outlineText: null
@buttonOptions = Psycho.merge defaultButtonOptions, buttonOptions
@initialize()
@drawButton()
drawButton: ->
@addChild @buttonOptions.icon
if @buttonOptions.text?
@buttonOptions.text.textAlign = 'center'
@buttonOptions.text.textBaseline = 'middle'
@addChild @buttonOptions.text
if @buttonOptions.outlineText?
@buttonOptions.outlineText.textAlign = 'center'
@buttonOptions.outlineText.textBaseline = 'middle'
@addChild @buttonOptions.outlineText
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.