问题所在的第11和12行跟随
Crafty.e
行,并以.text
和.css
开头。这些属性属于哪个对象?//the loading screen that will display while our assets load
Crafty.scene("loading", function () {
//load takes an array of assets and a callback when complete
Crafty.load(["sprite.png"], function () {
Crafty.scene("main"); //when everything is loaded, run the main scene
});
//black background with some loading text
Crafty.background("#000");
Crafty.e("2D, DOM, Text").attr({ w: 100, h: 20, x: 150, y: 120 })
.text("Loading")
.css({ "text-align": "center" });
});
//automatically play the loading scene
Crafty.scene("loading");
这个应该在规范的哪个部分?