#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(); if (!transform) { return; } // keeps the drawable aligned with the camera by subtracting the global scroll offset transform->get().x = worldX - context->scrollX; } void ScrollableComponent::Cleanup() {}