Ejemplo n.º 1
0
        public virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
        {
            CCLog.Log("TextInputTest:keyboardWillShowAt(origin:{0:F3},{1:F3}, size:{2:F3},{3:F3})",
                      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:{0:F3},{1:F3}, size:{2:F3},{3:F3})",
                      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({0:F3})", 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;
            }
        }
Ejemplo n.º 2
0
        public virtual void keyboardWillShow(CCIMEKeyboardNotificationInfo info)
        {
            CCLog.Log("TextInputTest:keyboardWillShowAt(origin:{0:F3},{1:F3}, size:{2:F3},{3:F3})",
        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:{0:F3},{1:F3}, size:{2:F3},{3:F3})",
                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.IntersetsRect(ref rectTracked, ref info.end))
            {
                return;
            }

            // assume keyboard at the bottom of screen, calculate the vertical adjustment.
            float adjustVert = info.end.MaxY - rectTracked.MinY;
            CCLog.Log("TextInputTest:needAdjustVerticalPosition({0:F3})", 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;
            }
        }
Ejemplo n.º 3
0
 public void KeyboardDidHide(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public void KeyboardWillShow(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public void KeyboardDidHide(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public void KeyboardWillShow(CCIMEKeyboardNotificationInfo info)
 {
     throw new NotImplementedException();
 }