• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Coffee Scriptでenchant.js
 

Coffee Scriptでenchant.js

on

  • 18,632 views

enchant.js meetup!大阪での発表資料

enchant.js meetup!大阪での発表資料

Statistics

Views

Total Views
18,632
Views on SlideShare
1,559
Embed Views
17,073

Actions

Likes
1
Downloads
5
Comments
0

12 Embeds 17,073

http://blog.enchantjs.com 17015
http://webcache.googleusercontent.com 27
http://a0.twimg.com 9
http://translate.googleusercontent.com 6
http://paper.li 6
http://new-blog.enchantjs.com 4
http://webcache-exp-test.googleusercontent.com 1
http://us-w1.rockmelt.com 1
http://quidecco.com 1
http://131.253.14.66 1
http://reader.aol.com 1
http://cache.yahoofs.jp 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Coffee Scriptでenchant.js Coffee Scriptでenchant.js Presentation Transcript

  • var bitlist, kids, singers, song;song = ["do", "re", "mi", "fa", "so"] song = ["do", "re", "mi", "fa", "so"];singers = {Jagger: "Rock", Elvis: "Roll"} singers = { Jagger: "Rock",bitlist = [ Elvis: "Roll" 1, 0, 1 }; 0, 0, 1 1, 1, 0 bitlist = [1, 0, 1, 0, 0, 1, 1, 1, 0];] kids = {kids = brother: { brother: name: "Max", name: "Max" age: 11 age: 11 }, sister: sister: { name: "Ida" name: "Ida", age: 9 age: 9 } };
  • var cube, square; square = function(x) { return x * x;square = (x) -> x * x };cube = (x) -> square(x) * x cube = function(x) { return square(x) * x; };
  • var Animal, Horse, Snake, sam, tom; // js Animal = (function() { function Animal(name) { this.name = name; } Animal.prototype.move = function(meters) { return alert(this.name + (" moved " + meters + "m."));class Animal }; constructor: (@name) -> return Animal; })(); move: (meters) -> alert @name + " moved #{meters}m." Snake = (function() { __extends(Snake, Animal);class Snake extends Animal function Snake() { move: -> alert "Slithering..." Snake.__super__.constructor.apply(this, super 5 arguments); } Snake.prototype.move = function() { alert("Slithering..."); return Snake.__super__.move.call(this, 5); }; return Snake; })();
  • enchant.Class.create(enchant.Scene, {class SceneMain extends enchant.Scene initialize: function() { constructor: () -> enchant.Scene.call(this); super() } });
  • var constructor = function() { __extends = function(child, parent) { if (this instanceof constructor) { for (var key in parent) { constructor.prototype.initialize.apply(this if (__hasProp.call(parent, key)) } else { child[key] = parent[key]; return new constructor(); } } function ctor() { }; this.constructor = child; constructor.prototype = Object.create(superclas } constructor.prototype.constructor = constructor ctor.prototype = parent.prototype; if (constructor.prototype.initialize == null) { child.prototype = new ctor; constructor.prototype.initialize = function() child.__super__ = parent.prototype; superclass.apply(this, arguments); return child; };}; } return constructor;
  • var Hoge = enchant.Class.create({ name: {class Hoge get: function() { name: return "tom"; get: () -> } "tom" } });hoge = new Hogehoge.name // Object var hoge = new Hoge(); hoge.name; // “tom”
  • !