Last active
April 14, 2019 17:21
-
-
Save fabiobiondi/3a275b98396f9a091c82 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 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); |
hey ,
i'm getting these errors - "Unexpected identifier" about import keyword and "Unexpected token export".
what im doing wrong ? i'm using 64 chrome version. tnx!
It looks like you need to modify your HTML to get this to work.
I am currently in Chrome 73.0.3683.103
In the script tag, add a type of module.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result: