Quantcast
Channel: 2D Latest Topics
Viewing all articles
Browse latest Browse all 623

easelJS with Jade

$
0
0

Hi,

I'm trying to create a game with Easeljs and jade (preprocesseur HTML), but the exemple in getting started:

http://www.createjs.com/getting-started/easeljs

with the onload attribute method doesn't work in Jade with the parentheses?

body(onload='init()') return init is not define

my html:

Quote

doctype html
html(lang='en')
  head
    meta(charset='UTF-8')
    meta(name='viewport', content='width=device-width, initial-scale=1')
    +style('style.css')
    title Xavier 
  body
    canvas#myCanvas(height=200, width=500)
      | fallback

 

script file

Quote

  function init() {
    var stage = new createjs.Stage("myCanvas");
    var circle = new createjs.Shape();
    circle.graphics.beginFill("red").drawCircle(0, 0, 50);
    circle.x = 100;
    circle.y = 100;
    stage.addChild(circle);
    stage.update();
  }
  init()

 

 


Viewing all articles
Browse latest Browse all 623

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>