Esempio n. 1
0
        public virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
        {
            Debug.WriteLine("TextInputTest:keyboardWillShowAt(origin:%f,%f, size:%f,%f)",
                            info.end.origin.x, info.end.origin.y, info.end.size.width, info.end.size.height);

            if (m_pTrackNode != null)
            {
                return;
            }

            CCRect rectTracked = TextInputTestScene.getRect(m_pTrackNode);

            Debug.WriteLine("TextInputTest:trackingNodeAt(origin:%f,%f, size:%f,%f)",
                            rectTracked.origin.x, rectTracked.origin.y, rectTracked.size.width, rectTracked.size.height);

            // if the keyboard area doesn't intersect with the tracking node area, nothing need to do.
            if (!CCRect.CCRectIntersetsRect(rectTracked, info.end))
            {
                return;
            }

            // assume keyboard at the bottom of screen, calculate the vertical adjustment.
            float adjustVert = CCRect.CCRectGetMaxY(info.end) - CCRect.CCRectGetMinY(rectTracked);

            Debug.WriteLine("TextInputTest:needAdjustVerticalPosition(%f)", adjustVert);

            // move all the children node of KeyboardNotificationLayer
            CCNode ccnoed = new CCNode();

            List <CCNode> children = ccnoed.children;
            CCNode        node;
            int           count = children.Count;
            CCPoint       pos;

            for (int i = 0; i < count; ++i)
            {
                node          = (CCNode)children[i];
                pos           = node.position;
                pos.y        += adjustVert;
                node.position = pos;
            }
        }
Esempio n. 2
0
        public virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
        {
            CCLog.Log("TextInputTest:keyboardWillShowAt(origin:%f,%f, size:%f,%f)",
            info.end.Origin.X, info.end.Origin.Y, info.end.Size.Width, info.end.Size.Height);

            if (m_pTrackNode != null)
            {
                return;
            }

            CCRect rectTracked = TextInputTestScene.getRect(m_pTrackNode);
            CCLog.Log("TextInputTest:trackingNodeAt(origin:%f,%f, size:%f,%f)",
                rectTracked.Origin.X, rectTracked.Origin.Y, rectTracked.Size.Width, rectTracked.Size.Height);

            // if the keyboard area doesn't intersect with the tracking node area, nothing need to do.
            if (!CCRect.CCRectIntersetsRect(rectTracked, info.end))
            {
                return;
            }

            // assume keyboard at the bottom of screen, calculate the vertical adjustment.
            float adjustVert = CCRect.CCRectGetMaxY(info.end) - CCRect.CCRectGetMinY(rectTracked);
            CCLog.Log("TextInputTest:needAdjustVerticalPosition(%f)", adjustVert);

            // move all the children node of KeyboardNotificationLayer
            CCNode ccnoed = new CCNode();

            var children = ccnoed.Children;
            CCNode node;
            int count = children.Count;
            CCPoint pos;
            for (int i = 0; i < count; ++i)
            {
                node = (CCNode)children[i];
                pos = node.Position;
                pos.Y += adjustVert;
                node.Position = pos;
            }
        }
Esempio n. 3
0
 public void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }
 public void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
0
 public void KeyboardDidHide(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }