Last active
August 1, 2017 08:48
-
-
Save emilwidlund/199f8f2b7a5391558fbce6c4438b3f9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {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: () -> | |
| myApp.transitionToView(anotherView, Transitions.goIn) | |
| } | |
| ] | |
| anotherView = new View | |
| background: | |
| backgroundColor: '#eaeaea' | |
| actions: [ | |
| { | |
| keyCode: 1 | |
| function: () -> | |
| myApp.transitionToView(homeView, Transitions.goOut) | |
| } | |
| ] | |
| new TextLayer | |
| parent: anotherView.safezone | |
| text: 'This is anotherView' | |
| x: Align.center | |
| y: Align.center | |
| textAlign: 'center' | |
| myApp = new App | |
| myApp.transitionToView(homeView) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment