2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-13 07:00:41 -04:00
|
|
|
#include <Geode/binding/CCContentLayer.hpp>
|
|
|
|
#include <Geode/binding/CCScrollLayerExt.hpp>
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
namespace geode {
|
|
|
|
/**
|
2022-10-30 14:59:20 -04:00
|
|
|
* CCContentLayer expects all of its children
|
|
|
|
* to be TableViewCells, which is not ideal for
|
2022-08-01 11:18:03 -04:00
|
|
|
* a generic content layer
|
|
|
|
*/
|
|
|
|
class GEODE_DLL GenericContentLayer : public CCContentLayer {
|
|
|
|
public:
|
2022-10-30 14:59:20 -04:00
|
|
|
static GenericContentLayer* create(float width, float height);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
void setPosition(cocos2d::CCPoint const& pos) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class GEODE_DLL ScrollLayer : public CCScrollLayerExt {
|
|
|
|
protected:
|
|
|
|
bool m_scrollWheelEnabled;
|
|
|
|
|
2022-10-30 14:59:20 -04:00
|
|
|
ScrollLayer(cocos2d::CCRect const& rect, bool scrollWheelEnabled, bool vertical);
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-29 17:30:25 -04:00
|
|
|
bool ccTouchBegan(cocos2d::CCTouch*, cocos2d::CCEvent*) override;
|
|
|
|
|
2024-01-23 14:14:21 -05:00
|
|
|
void visit() override;
|
|
|
|
|
2022-08-01 11:18:03 -04:00
|
|
|
public:
|
|
|
|
static ScrollLayer* create(
|
2022-10-30 14:59:20 -04:00
|
|
|
cocos2d::CCRect const& rect, bool scrollWheelEnabled = true, bool vertical = true
|
2022-08-01 11:18:03 -04:00
|
|
|
);
|
|
|
|
static ScrollLayer* create(
|
2022-10-30 14:59:20 -04:00
|
|
|
cocos2d::CCSize const& size, bool scrollWheelEnabled = true, bool vertical = true
|
2022-08-01 11:18:03 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
void scrollWheel(float y, float) override;
|
|
|
|
void enableScrollWheel(bool enable = true);
|
|
|
|
};
|
|
|
|
}
|