我已經通過文檔和樣本只丟失在過時的文檔。顯然沒有最新版本的createjs的樣本。創建一個水平spritesheet的js動畫
我需要平滑滾動水平spritesheet。這樣在新圖像完全處於「窗口」之前顯示圖像的中間部分。因此,頁面中的位置不會只移動單列中顯示的內容。水平spritesheet是不同的。而且我們不會在我們上下滾動的圖像之間切換。
我在我的智慧結束與此。
this.sprite = new createjs.BitmapAnimation(spriteSheet);
該行給出了一個錯誤
不是構造
this.sprite = createjs.BitmapAnimation(spriteSheet);
給出錯誤
不是函數
這裏是精靈表
https://github.com/nydehi/asp.net-mvc-example-invoicing-app/blob/master/screenshots/1.png
我現在是這樣做的,沒有錯誤,但不顯示任何內容。
<script type="text/javascript" src="createjs-2014.12.12.min.js"></script>
<script>
function init() {
var data = {
images: ["1.png"],
frames: {width:15, height:20},
animations: {
stand:0,
run:[1,5],
jump:[6,8,"run"]
}
};
var spriteSheet = new createjs.SpriteSheet(data);
var animation = new createjs.Sprite(spriteSheet, "run");
var stage = new createjs.Stage("demoCanvas");
stage.addChild(animation);
animation.gotoAndPlay("run"); //walking from left to right
stage.update();
}
</script>
您正在使用哪個版本的CreateJS? – Soviut
- > 試過 – Joe