MCPcopy Create free account
hub / github.com/axmolengine/axmol / create

Method create

core/ui/UITextFieldEx.cpp:258–276  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// static constructor /////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

256// static constructor
257//////////////////////////////////////////////////////////////////////////
258TextFieldEx* TextFieldEx::create(std::string_view placeholder,
259 std::string_view fontName,
260 float fontSize,
261 float cursorWidth,
262 const Color4B& cursorColor)
263{
264 TextFieldEx* ret = new TextFieldEx();
265 if (ret && ret->initWithPlaceHolder("", fontName, fontSize, cursorWidth, cursorColor))
266 {
267 ret->autorelease();
268 if (placeholder.size() > 0)
269 {
270 ret->setPlaceholderText(placeholder);
271 }
272 return ret;
273 }
274 AX_SAFE_DELETE(ret);
275 return nullptr;
276}
277
278//////////////////////////////////////////////////////////////////////////
279// initialize

Callers

nothing calls this directly

Calls 4

autoreleaseMethod · 0.80
setPlaceholderTextMethod · 0.80
initWithPlaceHolderMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected