#include <TextInputTest.h>
◆ KeyboardNotificationLayer()
| KeyboardNotificationLayer::KeyboardNotificationLayer |
( |
| ) |
|
在文件 TextInputTest.cpp 第 59 行定义.
63 auto listener = EventListenerTouchOneByOne::create();
66 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event)
void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event)
cocos2d::Node * _trackNode
引用了 onTouchBegan() , 以及 onTouchEnded().
◆ keyboardWillShow()
| void KeyboardNotificationLayer::keyboardWillShow |
( |
cocos2d::IMEKeyboardNotificationInfo & |
info | ) |
|
|
overridevirtual |
在文件 TextInputTest.cpp 第 69 行定义.
71 CCLOG(
"TextInputTest:keyboardWillShowAt(origin:%f,%f, size:%f,%f)",
72 info.end.origin.x, info.end.origin.y, info.end.size.width, info.end.size.height);
80 CCLOG(
"TextInputTest:trackingNodeAt(origin:%f,%f, size:%f,%f)",
81 rectTracked.origin.x, rectTracked.origin.y, rectTracked.size.width, rectTracked.size.height);
84 if (! rectTracked.intersectsRect(info.end))
90 float adjustVert = info.end.getMaxY() - rectTracked.getMinY();
91 CCLOG(
"TextInputTest:needAdjustVerticalPosition(%f)", adjustVert);
94 auto& children = getChildren();
96 ssize_t count = children.size();
98 for (
int i = 0; i < count; ++i)
100 node = children.at(i);
101 pos = node->getPosition();
103 node->setPosition(pos);
static Rect getRect(Node *node)
引用了 _trackNode , 以及 getRect().
◆ onClickTrackNode()
| virtual void KeyboardNotificationLayer::onClickTrackNode |
( |
bool |
bClicked, |
|
|
const cocos2d::Vec2 & |
touchPos |
|
) |
| |
|
pure virtual |
◆ onTouchBegan()
| bool KeyboardNotificationLayer::onTouchBegan |
( |
cocos2d::Touch * |
touch, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ onTouchEnded()
| void KeyboardNotificationLayer::onTouchEnded |
( |
cocos2d::Touch * |
touch, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ title()
| std::string KeyboardNotificationLayer::title |
( |
| ) |
const |
|
overridevirtual |
◆ _beginPos
| cocos2d::Vec2 KeyboardNotificationLayer::_beginPos |
|
protected |
◆ _trackNode
| cocos2d::Node* KeyboardNotificationLayer::_trackNode |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp