-
-
Save cef62/c9d0b491bc3d3854e3e4 to your computer and use it in GitHub Desktop.
EaselJS and HTML5 Canvas - ES6 Custom Display Objects (based on ES5 version: http://www.createjs.com/tutorials/Inheritance/)
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
import CircleButton from './CircleButton'; | |
// Init stage | |
const stage = new createjs.Stage("demo"); | |
// Button black | |
const btn = new CircleButton('Hi'); | |
btn.x = 50; btn.y = 50; | |
stage.addChild(btn); | |
// Button purple | |
const btn2 = new CircleButton('hello', 'purple', 50); | |
btn2.x = 100; btn2.y = 100; | |
stage.addChild(btn2); | |
btn2.addEventListener('animationEnd', function() { | |
console.log ('fadeIn animation completed') | |
}) | |
// Ticker | |
createjs.Ticker.addEventListener("tick", stage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment