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
| new Focusable({ | |
| width: 100, | |
| height: 100, | |
| backgroundColor: 'rgba(0, 0, 0, .66)', | |
| animationOptions: { | |
| time: .2, | |
| curve: 'ease-out' | |
| }, | |
| focusProperties: { | |
| backgroundColor: '#fff', |
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
| class Grid { | |
| constructor() { | |
| this.columns = 24; | |
| this.columnWidth = 62; | |
| this.columnGutter = 10; | |
| this.rowHeight = 10; | |
| this.safezoneWidth = 1718; | |
| this.safezoneHeight = 970; | |
| } |
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' | |
| myApp = new App | |
| myApp.transitionToView(homeView) |
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 |
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 |
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
| Gamepad.on 'gamepadevent', (e) -> | |
| switch e.keyCode | |
| when 39 | |
| print 'Stick going right' | |
| when 37 | |
| print 'Stick going left' | |
| when 40 | |
| print 'Stick going down' | |
| when 38 | |
| print 'Stick going up' |
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
| {Grid} = require 'joystick' | |
| new Layer | |
| width: Grid.getWidth(2) # We're asking for 2 columns. That will include 1 gutter as well. Result: 135px | |
| height: Grid.getHeight(10) # We're asking for 10 rows. Result: 100px |
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, Focusable, Grid} = require 'joystick' | |
| class CardCarousel extends ScrollComponent | |
| constructor: (properties={}) -> | |
| super properties | |
| @content.clip = properties.clip; | |
| app.on 'change:focusedElement', (focusable) => | |
| if focusable && focusable.parent == @content |
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.on 'change:focusedElement', (focusable) -> | |
| if focusable == focusableIWantToAnimate | |
| focusable.animate | |
| ... |
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
| {Scene, Light, Model} = require 'form' | |
| # Create a scene | |
| scene = new Scene | |
| width: Screen.width | |
| height: Screen.height | |
| # Create a light | |
| new Light | |
| parent: scene |
OlderNewer