Cocos2dx/EditBox
提供: 初心者エンジニアの簡易メモ
EditBoxとは
入力欄のこと
サンプル
HelloworldScene.h
HelloworldScene.cpp
#include "cocos-ext.h" cocos2d::extension::EditBox* _editPassword = ui::EditBox::create(editBoxSize, "extensions/orange_edit.png"); _editPassword->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); _editPassword->setFont("American Typewriter", 80); _editPassword->setFontColor(Color3B::GREEN); _editPassword->setPlaceHolder("Password:"); _editPassword->setMaxLength(6); _editPassword->setInputFlag(ui::EditBox::InputFlag::PASSWORD); _editPassword->setInputMode(ui::EditBox::InputMode::SINGLE_LINE); _editPassword->setDelegate(this); addChild(_editPassword);
Extensionは非推奨
cocos2d-x ui::EditBoxを使う