diceFigure = new Figure("/res/dice.mbac");
六个不同动画可以全被合并到一个文件而不必使用六个不同的动画文件
action[0] = new ActionTable("/res/one.mtra");
action[1] = new ActionTable("/res/two.mtra");
action[2] = new ActionTable("/res/three.mtra");
action[3] = new ActionTable("/res/four.mtra");
action[4] = new ActionTable("/res/five.mtra");
action[5] = new ActionTable("/res/six.mtra");
在游戏循环中要保持动画帧的不断更新。
if(diceOneFrame < action[diceOneIndex].getNumFrames(0)){
diceOneFrame += action[diceOneIndex].getNumFrames(0)/frameLength[diceOneIndex];
}
diceFigure.setPosture(action[diceOneIndex], 0, diceOneFrame);
下载范例程序和源代码:
http://developer.sonyericsson.com/getDocument.do?docId=73634
原文地址:点击这里