public void updateQuads(float dt) { m_nIndex = (m_nIndex + 1) % 4; CCRect rect = new CCRect(m_nIndex * 32, 0, 32, 32); CCParticleSystemQuad system = (CCParticleSystemQuad)m_emitter; system.setTextureWithRect(m_emitter.Texture, rect); }
public override void onEnter() { base.onEnter(); Color = new ccColor3B(0, 0, 0); removeChild(m_background, true); m_background = null; CCParticleSystemQuad system = new CCParticleSystemQuad(); system.initWithFile("Images/SpinningPeasPlist"); system.setTextureWithRect(CCTextureCache.sharedTextureCache().addImage("Images/particles"), new CCRect(0, 0, 32, 32)); addChild(system, 10); m_emitter = system; m_nIndex = 0; schedule(updateQuads, 2.0f); }