MCPcopy Create free account
hub / github.com/axmolengine/axmol / onTouchesEnded

Method onTouchesEnded

tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp:2298–2314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2296}
2297
2298void 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
2316void ParticleDemo::update(float dt)
2317{

Callers

nothing calls this directly

Calls 3

convertToWorldSpaceMethod · 0.80
getLocationMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected