Skip to content

Instantly share code, notes, and snippets.

@awt2542
Created September 15, 2016 20:05
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 awt2542/6dec023837f4feacfa4c5a132bf33441 to your computer and use it in GitHub Desktop.
Save awt2542/6dec023837f4feacfa4c5a132bf33441 to your computer and use it in GitHub Desktop.
# Shortcut to bring a layer into view. Nice for tweaking properties.
# Usage: btn.centerStage()
Layer::centerStage = (opacity = 1) ->
bg = new Layer size: Screen.size, backgroundColor: 'black', opacity: opacity
@parent = null
@bringToFront()
@midX = Screen.midX
@midY = Screen.midY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment