2012-06-12 25 views
2

大家好, 任何人都可以幫助我知道,無論如何,從AndEngine創建AnimateSprite表,就像在COCOS2D中一樣。有沒有辦法像在COCOS 2D中一樣從AndEngine創建AnimateSprite表單?

謝謝。

+0

除了看起來尼古拉斯正在添加/它移植到AndEngine我不知道什麼的cocos2d。在這裏查看他的GitHub頁面 - https://github.com/nicolasgramlich - 並查看他正在開發的一些擴展。 – jmroyalty

+0

好的,讓我們來看看..和thx爲你的善良反應 –

回答

0

你在這裏!我相信這是你正在尋找的。

AnimatedSprite runner = new AnimatedSprite(0, 0, mRunner); 
    // Animate with 100 milliseconds each frame, start at frame 0 and go through 
    // frame 3, set to true for looping otherwise false for no looping. 
    runner.animate(new long[] { 100, 100, 100, 100 }, 0, 3, true); 
    scene.attachChild(runner); 

和onLoadResources()

this.mRunnerTexture = new Texture(512, 128, TextureOptions.DEFAULT); 
    this.mRunner = TextureRegionFactory.createTiledFromAsset(this.mRunnerTexture, this, "gfx/runner.png", 0, 0, 4, 1); // 4 columns and 1 row, a 4x1 animated sprite 
    this.mEngine.getTextureManager().loadTextures(this.mRunnerTexture); 
相關問題