Example #1
0
        private void InitUI()
        {
            var s = VisibleBoundsWorldspace.Size;

            NameText = new CCTextField("[Name]", "Consolas", 16)
            {
                Position = new CCPoint(s.Width / 2, 400),
                AutoEdit = true,
            };
            AddChild(NameText, 100);
            FiledList.Add(NameText);

            PassText = new CCTextField("[Pass]", "Consolas", 16)
            {
                Position = new CCPoint(s.Width / 2, 350),
                AutoEdit = true,
            };
            AddChild(PassText, 100);
            FiledList.Add(PassText);

            PassRepeatText = new CCTextField("[Pass Repeat]", "Consolas", 16)
            {
                Position = new CCPoint(s.Width / 2, 300),
                AutoEdit = true,
            };
            AddChild(PassRepeatText, 100);
            FiledList.Add(PassRepeatText);

            NickNameText = new CCTextField("[NickName]", "Consolas", 16)
            {
                Position = new CCPoint(s.Width / 2, 250),
                AutoEdit = true,
            };
            AddChild(NickNameText, 100);
            FiledList.Add(NickNameText);

            CurrButton = new CozySampleButton(s.Width / 2, 100, 200, 80)
            {
                Text = "注册账号",
                FontSize = 24,
                OnClick = () => OnRegister()
            };
            AddChild(CurrButton, 100);
            dispatcher.Add(CurrButton);
        }
        public override void OnEnter()
        {
            base.OnEnter();

            var s = VisibleBoundsWorldspace.Size;

            var textField = new CCTextField("[click here for input]",
                "fonts/MarkerFelt",
                22,
                CCLabelFormat.SpriteFont);

            textField.BeginEditing += OnBeginEditing;
            textField.EndEditing += OnEndEditing;
            textField.Position = s.Center;

            textField.AutoEdit = true;

            AddChild(textField);

            TrackNode = textField;
            scrollUp = new CCMoveTo(0.5f, VisibleBoundsWorldspace.Top() - new CCPoint(0, s.Height / 4));
            scrollDown = new CCMoveTo(0.5f, textField.Position);

        }
        public override void OnEnter()
        {
            base.OnEnter();

            var s = VisibleBoundsWorldspace.Size;

            var textField = new CCTextField("<CLICK HERE FOR INPUT>", 
                TextInputTestScene.FONT_NAME, 
                TextInputTestScene.FONT_SIZE, 
                CCLabelFormat.SpriteFont);

            // Override the default implementation
            textField.TextFieldIMEImplementation = UppercaseIMEKeyboardImpl.SharedInstance;

            textField.Position = s.Center;

            textField.AutoEdit = true;

            AddChild(textField);

            TrackNode = textField;
        }
        public override void OnEnter()
        {
            base.OnEnter();

            var s = VisibleBoundsWorldspace.Size;

            var textField = new CCTextField("<CLICK HERE FOR INPUT>", 
                TextInputTestScene.FONT_NAME, 
                TextInputTestScene.FONT_SIZE, 
                CCLabelFormat.SpriteFont);

            var imeImplementation = textField.TextFieldIMEImplementation;
            imeImplementation.InsertText += OnInsertText;
            imeImplementation.ReplaceText += OnReplaceText;


            textField.Position = s.Center;

            textField.AutoEdit = true;

            AddChild(textField);

            TrackNode = textField;
        }
        // CCLayer
        public override void OnEnter()
        {
            base.OnEnter();

            charLimit = 12;

            action = false;

            textField = new CCTextField("<click here for input>",
                                              TextInputTestScene.FONT_NAME, 
                                              TextInputTestScene.FONT_SIZE,
                                              CCLabelFormat.SpriteFont);

            var imeImplementation = textField.TextFieldIMEImplementation;
            imeImplementation.KeyboardDidHide += OnKeyboardDidHide;
            imeImplementation.KeyboardDidShow += OnKeyboardDidShow;
            imeImplementation.InsertText += OnInsertText;
            imeImplementation.ReplaceText += OnReplaceText;
            imeImplementation.DeleteBackward += OnDeleteBackward;

            textField.Position = VisibleBoundsWorldspace.Center;
            textField.PositionY += VisibleBoundsWorldspace.Size.Height / 4;

            AddChild(textField);

            TrackNode = textField;
        }
Example #6
0
 private void OnClickTrackNode(CCTextField node,bool v)
 {
     if (v && node != null)
     {
         node.Edit();
     }
     else
     {
         if (node != null)
         {
             node.EndEdit();
         }
     }
 }