2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-08-02 06:17:26 -04:00
|
|
|
#include <Geode/Bindings.hpp>
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
namespace geode {
|
2022-09-12 17:37:25 -04:00
|
|
|
class GEODE_DLL InputNode : public cocos2d::CCMenuItem {
|
2022-09-14 12:21:35 -04:00
|
|
|
protected:
|
2022-08-01 11:18:03 -04:00
|
|
|
cocos2d::extension::CCScale9Sprite* m_bgSprite;
|
|
|
|
CCTextInputNode* m_input;
|
|
|
|
|
|
|
|
bool init(float, float, const char*, const char*, std::string const&, int);
|
|
|
|
bool init(float, const char*, const char*, std::string const&, int);
|
|
|
|
|
2022-09-14 12:21:35 -04:00
|
|
|
public:
|
2022-08-01 11:18:03 -04:00
|
|
|
static InputNode* create(
|
|
|
|
float width,
|
|
|
|
const char* placeholder,
|
|
|
|
const char* fontFile,
|
|
|
|
std::string const& filter,
|
|
|
|
int limit
|
|
|
|
);
|
|
|
|
static InputNode* create(
|
|
|
|
float width,
|
|
|
|
const char* placeholder,
|
|
|
|
std::string const& filter,
|
|
|
|
int limit
|
|
|
|
);
|
|
|
|
static InputNode* create(
|
|
|
|
float width,
|
|
|
|
const char* placeholder,
|
|
|
|
std::string const& filter
|
|
|
|
);
|
|
|
|
static InputNode* create(
|
|
|
|
float width,
|
|
|
|
const char* placeholder,
|
|
|
|
const char* fontFile
|
|
|
|
);
|
|
|
|
static InputNode* create(
|
|
|
|
float width,
|
|
|
|
const char* placeholder
|
|
|
|
);
|
|
|
|
|
2022-09-12 17:37:25 -04:00
|
|
|
void activate() override;
|
|
|
|
|
|
|
|
CCTextInputNode* getInput() const;
|
|
|
|
cocos2d::extension::CCScale9Sprite* getBG() const;
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-28 09:21:05 -04:00
|
|
|
void setEnabled(bool enabled) override;
|
2022-08-01 11:18:03 -04:00
|
|
|
|
2022-09-12 17:37:25 -04:00
|
|
|
void setString(std::string const&);
|
2022-08-01 11:18:03 -04:00
|
|
|
const char* getString();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|