public void step(float dt) { CCLabelAtlas atlas = (CCLabelAtlas)getChildByTag(PerformanceParticleTest.kTagLabelAtlas); CCParticleSystem emitter = (CCParticleSystem)getChildByTag(PerformanceParticleTest.kTagParticleSystem); //char str[10] = {0}; string str; //sprintf(str, "%4d", emitter->getParticleCount()); str = string.Format("{0:D4}", emitter.ParticleCount); atlas.setString(str); }
public void step(float dt) { if (m_emitter != null) { CCLabelAtlas atlas = (CCLabelAtlas)getChildByTag(ParticleTestScene.kTagLabelAtlas); //char str[5] = {0}; //sprintf(str, "%04d", m_emitter.getParticleCount()); //atlas.setString(str); string str = string.Format("{0}", m_emitter.ParticleCount); atlas.setString(str); } }
public void updateStrings(float dt) { CCLabelBMFont label1 = (CCLabelBMFont)getChildByTag((int)TagSprite.kTagBitmapAtlas1); CCLabelTTF label2 = (CCLabelTTF)getChildByTag((int)TagSprite.kTagBitmapAtlas2); CCLabelAtlas label3 = (CCLabelAtlas)getChildByTag((int)TagSprite.kTagBitmapAtlas3); if (!setEmpty) { label1.setString("not empty"); label2.setString("not empty"); label3.setString("hi"); setEmpty = true; } else { label1.setString(""); label2.setString(""); label3.setString(""); setEmpty = false; } }
public virtual void step(float dt) { m_time += dt; //char string[12] = {0}; string stepstring; //sprintf(string, "%2.2f Test", m_time); stepstring = string.Format("{0,2:f2} Test", m_time); //std::string string = std::string::stringWithFormat("%2.2f Test", m_time); CCLabelAtlas label1 = (CCLabelAtlas)getChildByTag((int)TagSprite.kTagSprite1); label1.setString(stepstring); CCLabelAtlas label2 = (CCLabelAtlas)getChildByTag((int)TagSprite.kTagSprite2); //sprintf(string, "%d", (int)m_time); stepstring = string.Format("{0:D1}", (int)m_time); label2.setString(stepstring); }