Skip to content

Instantly share code, notes, and snippets.

@benediktvaldez
Created February 28, 2015 21:15
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 benediktvaldez/e787d4fb0b5e03fe14ce to your computer and use it in GitHub Desktop.
Save benediktvaldez/e787d4fb0b5e03fe14ce to your computer and use it in GitHub Desktop.
Testing framerjs
layerA = new Layer({
width: 750
height: 200
})
layerA.html = "Hello world"
layerA.style = {
fontSize: "80px"
lineHeight: "1"
}
layerA.states.add({
"red": {
backgroundColor: "#f00"
style: {
fontSize: "20px"
}
}
})
layerA.bringToFront()
layerA.on Events.Click, (event, layer) ->
print "Clicking layerA - current state is " + layerA.states.current
if layerA.states.current is "red"
layerA.states.switch("default")
else
layerA.states.switch("red")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment