2
我有一個html5遊戲我正在努力。它使用Crafty遊戲引擎,並使用用於骨幹,jquery和需要js的遊戲引擎的鍋爐板。我編寫了一個我爲遊戲編碼的新主幹接口,但它不響應任何事件處理程序。有什麼我做錯了嗎?這裏是我的代碼:我使用狡猾的鍋爐板爲我的html5遊戲,但骨幹或jQuery是衝突?
Info = BaseEntity.extend({
defaults: {
'text_begin' : "<span id='info_begin' style='text-shadow:2px 2px #000;cursor:pointer; '>bEGIN gAME</span>",
},
initialize: function(){
var model = this;
var entity = Crafty.e("2D, HTML, DOM, Text, Mouse")
entity
.attr({x: 20, y: 50, z: 1, w: 200})
.text(model.get('text_begin'))
.textColor('#FF0000')
.textFont({'size' : '30px', 'family': 'Arial', 'weight': 'bold'})
.setName('Begin Info')
.bind("Click", function(){console.log('hi tere')})
model.set({'entity' : entity });
}
});
好的...我明白你的意思了。讓我嘗試一下。 – 2013-02-18 16:14:52
是這樣做的 – 2013-02-18 17:17:50