2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-13 05:56:23 -04:00
|
|
|
#include <cocos2d.h>
|
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();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|