22 lines
442 B
C++
22 lines
442 B
C++
#include "components/ScrollableComponent.hpp"
|
|
|
|
#include "Entity.hpp"
|
|
#include "components/TransformComponent.hpp"
|
|
|
|
void ScrollableComponent::Setup() {}
|
|
|
|
void ScrollableComponent::Update(float) {
|
|
if (!context) {
|
|
return;
|
|
}
|
|
|
|
auto transform = entity->GetComponent<TransformComponent>();
|
|
if (!transform) {
|
|
return;
|
|
}
|
|
|
|
transform->get().x = worldX - context->scrollX;
|
|
}
|
|
|
|
void ScrollableComponent::Cleanup() {}
|