MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / onCameraMoved

Method onCameraMoved

Source/Platformer/PlatformWorld.cpp:162–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void PlatformWorld::onCameraMoved(float deltaX, float deltaY) {
163 for (auto it : _layers) {
164 if (Layer* layer = it.second) {
165 Vec2 pos = {
166 deltaX * layer->ratio.x + layer->getX(),
167 deltaY * layer->ratio.y + layer->getY()};
168 layer->setPosition(pos);
169 }
170 }
171}
172
173void PlatformWorld::onCameraReset() {
174 for (auto it : _layers) {

Callers

nothing calls this directly

Calls 3

getXMethod · 0.45
getYMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected