mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 07:05:39 +00:00
30 lines
613 B
C
30 lines
613 B
C
|
#pragma once
|
||
|
|
||
|
#include "../GuiComponent.h"
|
||
|
|
||
|
class ScrollableContainer : public GuiComponent
|
||
|
{
|
||
|
public:
|
||
|
ScrollableContainer(Window* window);
|
||
|
|
||
|
void setSize(Vector2u size);
|
||
|
|
||
|
Vector2d getScrollPos() const;
|
||
|
void setScrollPos(const Vector2d& pos);
|
||
|
void setAutoScroll(int delay, double speed); //Use 0 for speed to disable.
|
||
|
void resetAutoScrollTimer();
|
||
|
|
||
|
void update(int deltaTime) override;
|
||
|
void render() override;
|
||
|
|
||
|
//Vector2i getGlobalOffset() override;
|
||
|
private:
|
||
|
Vector2i getContentSize();
|
||
|
|
||
|
Vector2d mScrollPos;
|
||
|
Vector2d mScrollDir;
|
||
|
int mAutoScrollDelay;
|
||
|
double mAutoScrollSpeed;
|
||
|
int mAutoScrollTimer;
|
||
|
};
|