2013-07-03 01:01:58 +00:00
|
|
|
#pragma once
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H
|
|
|
|
#define ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H
|
2013-07-03 01:01:58 +00:00
|
|
|
|
2014-06-20 01:30:09 +00:00
|
|
|
#include "GuiComponent.h"
|
2013-07-03 01:01:58 +00:00
|
|
|
|
|
|
|
class ScrollableContainer : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScrollableContainer(Window* window);
|
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f getScrollPos() const;
|
|
|
|
void setScrollPos(const Vector2f& pos);
|
2014-05-19 01:15:15 +00:00
|
|
|
void setAutoScroll(bool autoScroll);
|
|
|
|
void reset();
|
2013-07-03 01:01:58 +00:00
|
|
|
|
|
|
|
void update(int deltaTime) override;
|
2017-10-28 20:24:35 +00:00
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2013-07-03 01:01:58 +00:00
|
|
|
|
|
|
|
private:
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f getContentSize();
|
2013-07-03 01:01:58 +00:00
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f mScrollPos;
|
|
|
|
Vector2f mScrollDir;
|
2014-05-19 01:15:15 +00:00
|
|
|
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;
|
2013-07-03 01:01:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_CORE_COMPONENTS_SCROLLABLE_CONTAINER_H
|