Skip to content

Instantly share code, notes, and snippets.

@creativ
Created August 21, 2014 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creativ/c4be574088eebabfee17 to your computer and use it in GitHub Desktop.
Save creativ/c4be574088eebabfee17 to your computer and use it in GitHub Desktop.
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