15 lines
368 B
C++
15 lines
368 B
C++
#include "components/ScrollComponent.hpp"
|
|
|
|
void ScrollComponent::Setup() {}
|
|
|
|
void ScrollComponent::Update(float dt) {
|
|
speed += accel * dt;
|
|
scrollX += speed * dt * 60.0f;
|
|
if (context) {
|
|
// stores our current scroll speed for components that rely on the camera position
|
|
context->scrollX = scrollX;
|
|
}
|
|
}
|
|
|
|
void ScrollComponent::Cleanup() {}
|