geode/loader/include/Geode/ui/MenuInputNode.hpp
HJfod cdaa8ad6dc add all UI-related stuff from API, including index, nodes, actual ui,
resources, md4c; and fix up some minor formatting issues
2022-08-01 18:18:03 +03:00

39 lines
967 B
C++

#pragma once
#include <Geode/Geode.hpp>
namespace geode {
/**
* Simple wrapper around CCTextInputNode that
* turns it into a CCMenuItem that can be used
* in a CCMenu. Can help with touch dispatcher
* issues. Also comes with a background sprite
*/
class GEODE_DLL MenuInputNode : public cocos2d::CCMenuItem {
protected:
cocos2d::extension::CCScale9Sprite* m_bgSprite = nullptr;
CCTextInputNode* m_input;
bool init(
float width,
float height,
const char* placeholder,
const char* font,
bool bg
);
public:
static MenuInputNode* create(
float width,
float height,
const char* placeholder,
const char* font,
bool bg = false
);
void selected() override;
CCTextInputNode* getInput() const;
};
}