\brief Class for edit box.
You can use this widget to gather small amounts of text from the user.
#include <Geode/cocos/extensions/GUI/CCEditBox/CCEditBox.h>\brief Class for edit box.
You can use this widget to gather small amounts of text from the user.
create a edit box with size.
Init edit box with specified size. This method should be invoked right after constructor.
size
Gets/Sets the delegate for edit box.
Registers a script function that will be called for EditBox events.
This handler will be removed automatically after onExit() called.
handler
-- lua sample
local function editboxEventHandler(eventType)
if eventType == "began" then
-- triggered when an edit box gains focus after keyboard is shown
elseif eventType == "ended" then
-- triggered when an edit box loses focus after keyboard is hidden.
elseif eventType == "changed" then
-- triggered when the edit box text was changed.
elseif eventType == "return" then
-- triggered when the return button was pressed or the outside area of keyboard was touched.
end
end
local editbox = CCEditBox:create(CCSize(...), CCScale9Sprite:create(...))
editbox = registerScriptEditBoxHandler(editboxEventHandler)Unregisters a script function that will be called for EditBox events.
get a script Handler
Set the text entered in the edit box.
pText
Get the text entered in the edit box.
Set the font.
pFontName
fontSize
Set the font name.
pFontName
Set the font color of the widget’s text.
Set the placeholder’s font.
pFontName
fontSize
Set the placeholder’s font name.
pFontName
Set the placeholder’s font size.
fontSize
Set the font color of the placeholder text when the edit box is empty. Not supported on IOS.
Set a text in the edit box that acts as a placeholder when an edit box is empty.
pText
Get a text in the edit box that acts as a placeholder when an edit box is empty.
Set the input mode of the edit box.
inputMode
Sets the maximum input length of the edit box. Setting this value enables multiline input mode by default. Available on Android, iOS and Windows Phone.
maxLength
Gets the maximum input length of the edit box.
Set the input flags that are to be applied to the edit box.
inputFlag
Set the return type that are to be applied to the edit box.
returnType
callback funtions