Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道我是否可以复制一个精灵
AnimatedSprite X = new AnimatedSprite(200,100, resourceManager.enemyexplode, vbom);
我怎样才能复制它,以便我可以随时使用它而不是使用它scene.attachChild(X)?(或者我只使用一次,只用于主要的 Sprite)
scene.attachChild(X)
如果要复制精灵,则必须深度复制该特定精灵的纹理区域,如下所示:
AnimatedSprite animateSprite = new AnimatedSprite(200,100, animTextureRegion.deepCopy(), vbo);