Jump to content

easelJS with Jade


artotal
 Share

Recommended Posts

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()

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...