示例#1
0
        /// <summary>
        /// add submit and cancel button
        /// </summary>
        private void AddFormButton()
        {
            CCMenuItemImage imagesubmit = CCMenuItemImage.itemFromNormalImage("image/ButtonNormal", "image/ButtonClick", this, AddImageClick);
            CCLabelTTF      textsubmit  = CCLabelTTF.labelWithString("确定", "ChineseContent", 28);

            textsubmit.Color = new ccColor3B(Color.Black);
            CCMenuItemLabel labelsubmit = CCMenuItemLabel.itemWithLabel(textsubmit);

            labelsubmit.position = new CCPoint(imagesubmit.contentSize.width / 2, imagesubmit.contentSize.height / 2);
            imagesubmit.addChild(labelsubmit);

            CCMenuItemImage imagecancel = CCMenuItemImage.itemFromNormalImage("image/ButtonNormal", "image/ButtonClick", this, AddImageClick);
            CCLabelTTF      textcancel  = CCLabelTTF.labelWithString("取消", "ChineseContent", 28);

            textcancel.Color = new ccColor3B(Color.Black);
            CCMenuItemLabel labelcancel = CCMenuItemLabel.itemWithLabel(textcancel);

            labelcancel.position = new CCPoint(imagecancel.contentSize.width / 2, imagecancel.contentSize.height / 2);

            imagecancel.addChild(labelcancel);


            CCMenu menu = CCMenu.menuWithItems(imagesubmit, imagecancel);

            menu.alignItemsHorizontally();
            menu.position = new CCPoint(240, m_CurrPostion.y);
            addChild(menu);

            m_CurrPostion.y -= imagesubmit.contentSize.height;
            m_CurrPostion.y -= StillWhite;
        }
示例#2
0
        /// <summary>
        /// add chinese input item
        /// </summary>
        private void AddEnglishItem()
        {
            CCMenuItemImage image = LoadTextBoxSprite();

            CCLabelTTF text = CCLabelTTF.labelWithString("英文", "ChineseTitle", 28);

            text.Color = new ccColor3B(Color.Black);
            CCMenuItemLabel label = CCMenuItemLabel.itemWithLabel(text);

            m_EnglishLabel       = CreateTextLabel(Language.Enlish, String.Empty);
            m_EnglishLabel.Color = new ccColor3B(Color.Black);
            CCMenuItemLabel content = CCMenuItemLabel.itemWithLabel(m_EnglishLabel);

            content.position = new CCPoint(10, 0);
            image.addChild(content);

            CCMenu menu = CCMenu.menuWithItems(label, image);

            menu.alignItemsHorizontallyWithPadding(50);
            menu.position = new CCPoint(240, m_CurrPostion.y);
            addChild(menu);

            m_CurrPostion.y -= image.contentSize.height;
            m_CurrPostion.y -= StillWhite;
        }