geode/loader/include/Geode/ui/InputNode.hpp
2024-01-26 16:29:14 +03:00

47 lines
1.7 KiB
C++

#pragma once
#include <Geode/DefaultInclude.hpp>
#include <Geode/binding/CCTextInputNode.hpp>
#include <cocos2d.h>
namespace geode {
class GEODE_DLL TextInputNodeFix : public CCTextInputNode {
public:
static TextInputNodeFix* create(
float width, float height, char const* placeholder, char const* fallbackFont, int size, char const* fontFile
);
bool ccTouchBegan(cocos2d::CCTouch* touch, cocos2d::CCEvent* event) override;
};
class GEODE_DLL InputNode : public cocos2d::CCMenuItem {
protected:
cocos2d::extension::CCScale9Sprite* m_bgSprite;
CCTextInputNode* m_input;
bool init(float, float, char const*, char const*, std::string const&, int);
bool init(float, char const*, char const*, std::string const&, int);
public:
static InputNode* create(
float width, char const* placeholder, char const* fontFile, std::string const& filter,
int limit
);
static InputNode* create(
float width, char const* placeholder, std::string const& filter, int limit
);
static InputNode* create(float width, char const* placeholder, std::string const& filter);
static InputNode* create(float width, char const* placeholder, char const* fontFile);
static InputNode* create(float width, char const* placeholder);
void activate() override;
CCTextInputNode* getInput() const;
cocos2d::extension::CCScale9Sprite* getBG() const;
void setEnabled(bool enabled) override;
void setString(std::string const&);
std::string getString();
};
}