Skip to content

Instantly share code, notes, and snippets.

@emilwidlund
Last active August 1, 2017 07:52
Show Gist options
  • Select an option

  • Save emilwidlund/bf83becc26e6059ea03913ce614e6aef to your computer and use it in GitHub Desktop.

Select an option

Save emilwidlund/bf83becc26e6059ea03913ce614e6aef to your computer and use it in GitHub Desktop.
{App, View, Gamepad, Focusable, Transitions, Grid} = require 'joystick'
homeView = new View
background:
backgroundColor: '#eaeaea'
for index in [0..2]
new Focusable
parent: homeView.safezone
x: 300 * index
y: 200
width: 200
height: 200
focusProperties:
scale: 1.2
backgroundColor: '#00eeaa'
animationOptions:
time: .2
animationOptions:
time: .2
actions: [
{
keyCode: 0,
function: () ->
print 'Press!'
}
]
myApp = new App
myApp.transitionToView(homeView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment