使用TiledTextureAtlas为粒子制作动画?

时间:2014-02-09 23:34:36

标签: android andengine

我正在使用PointParticleEmitter来制作从特定点开始的粒子。但是,我希望这些粒子能够被动画化。

我从平铺地图集创建了一个BitmapTextureAtlas:

/*
 * Create the bitmap texture atlas for the sprite's texture region
 */
BuildableBitmapTextureAtlas mBitmapTextureAtlas = new BuildableBitmapTextureAtlas(
        mEngine.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

/*
 * Create the sprite's texture region via the
 * BitmapTextureAtlasTextureRegionFactory
 */

mTextureRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
        mBitmapTextureAtlas, c, getSpriteFileName(), 8 , 8);

/* Build the bitmap texture atlas */
try
{
    mBitmapTextureAtlas
            .build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
                    0, 0, 0));
}
catch (TextureAtlasBuilderException e)
{
    e.printStackTrace();
}
/*
 * Load the bitmap texture atlas into the device's gpu memory
 */
mBitmapTextureAtlas.load();

但是当我将textureRegion附加到particleSystem时,它没有动画:

BatchedSpriteParticleSystem particleSystem = new BatchedSpriteParticleSystem(
        particleEmitter, minSpawnRate, maxSpawnRate, maxParticleCount, mTextureRegion,
        engine.getVertexBufferObjectManager());

0 个答案:

没有答案