| 39 | } |
| 40 | |
| 41 | IntervalTest::IntervalTest() |
| 42 | { |
| 43 | _time0 = _time1 = _time2 = _time3 = _time4 = 0.0f; |
| 44 | |
| 45 | auto s = Director::getInstance()->getWinSize(); |
| 46 | // sun |
| 47 | auto sun = ParticleSun::create(); |
| 48 | sun->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); |
| 49 | sun->setPosition(VisibleRect::rightTop().x - 32, VisibleRect::rightTop().y - 32); |
| 50 | |
| 51 | sun->setTotalParticles(130); |
| 52 | sun->setLife(0.6f); |
| 53 | this->addChild(sun); |
| 54 | |
| 55 | // timers |
| 56 | _label0 = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "0"); |
| 57 | _label1 = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "0"); |
| 58 | _label2 = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "0"); |
| 59 | _label3 = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "0"); |
| 60 | _label4 = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "0"); |
| 61 | |
| 62 | scheduleUpdate(); |
| 63 | schedule( |
| 64 | [&](float dt) { |
| 65 | _time1 += dt; |
| 66 | |
| 67 | char tmp[10]; |
| 68 | auto str = fmt::format_to_z(tmp, "{:2.1f}", _time1); |
| 69 | _label1->setString(str); |
| 70 | }, |
| 71 | "step_1"); |
| 72 | |
| 73 | schedule( |
| 74 | [&](float dt) { |
| 75 | _time2 += dt; |
| 76 | |
| 77 | char tmp[10]; |
| 78 | auto str = fmt::format_to_z(tmp, "{:2.1f}", _time2); |
| 79 | _label2->setString(str); |
| 80 | }, |
| 81 | 0.5, "step_2"); |
| 82 | |
| 83 | schedule( |
| 84 | [&](float dt) { |
| 85 | _time3 += dt; |
| 86 | |
| 87 | char tmp[10]; |
| 88 | auto str = fmt::format_to_z(tmp, "{:2.1f}", _time3); |
| 89 | _label3->setString(str); |
| 90 | }, |
| 91 | 1, "step_3"); |
| 92 | |
| 93 | schedule( |
| 94 | [&](float dt) { |
| 95 | _time4 += dt; |
| 96 | |
| 97 | char tmp[10]; |
| 98 | auto str = fmt::format_to_z(tmp, "{:2.1f}", _time4); |
nothing calls this directly
no test coverage detected