mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-27 16:45:38 +00:00
29 lines
700 B
C++
29 lines
700 B
C++
#pragma once
|
|
|
|
#include "GuiComponent.h"
|
|
|
|
class ScrollableContainer : public GuiComponent
|
|
{
|
|
public:
|
|
ScrollableContainer(Window* window);
|
|
|
|
Eigen::Vector2f getScrollPos() const;
|
|
void setScrollPos(const Eigen::Vector2f& pos);
|
|
void setAutoScroll(bool autoScroll);
|
|
void reset();
|
|
|
|
void update(int deltaTime) override;
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
|
|
|
private:
|
|
Eigen::Vector2f getContentSize();
|
|
|
|
Eigen::Vector2f mScrollPos;
|
|
Eigen::Vector2f mScrollDir;
|
|
int mAutoScrollDelay; // ms to wait before starting to autoscroll
|
|
int mAutoScrollSpeed; // ms to wait before scrolling down by mScrollDir
|
|
int mAutoScrollAccumulator;
|
|
bool mAtEnd;
|
|
int mAutoScrollResetAccumulator;
|
|
};
|