1
我試圖從一本關於使用JS Canvas做動畫的書中看到一個例子。從一個JavaScript動畫對象原型設置變量
其中一個例子從與下面的調用的原型創建一個子畫面:
sprite = new Sprite('runner',
new SpriteSheetPainter(runnerCells),
[ runInPlace, moveLeftToRight ]);
「runnerCells」是將JS陣列,其確定在spritesheet動畫的每個單元的位置的參考。我沒有得到它如何以一種允許我將「runnerCells」更改爲不同陣列來創建不同動畫的方式訪問「sprite」變量。有什麼建議麼?
你可以看到在這裏的行動的完整的例子: http://corehtml5canvas.com/code-live/ch06/example-6.9/example.html
對於相關的JS庫位於: http://corehtml5canvas.com/code-live/ch06/example-6.9/example.js
是的,正好!謝謝! –