| 2296 | } |
| 2297 | |
| 2298 | void ParticleDemo::onTouchesEnded(const std::vector<Touch*>& touches, Event* event) |
| 2299 | { |
| 2300 | auto touch = touches[0]; |
| 2301 | |
| 2302 | auto location = touch->getLocation(); |
| 2303 | |
| 2304 | auto pos = Vec2::ZERO; |
| 2305 | if (_background) |
| 2306 | { |
| 2307 | pos = _background->convertToWorldSpace(Vec2::ZERO); |
| 2308 | } |
| 2309 | |
| 2310 | if (_emitter != nullptr) |
| 2311 | { |
| 2312 | _emitter->setPosition(location - pos); |
| 2313 | } |
| 2314 | } |
| 2315 | |
| 2316 | void ParticleDemo::update(float dt) |
| 2317 | { |
nothing calls this directly
no test coverage detected