示例#1
0
		void __focusIn(EventContext context)
		{
			if (_input)
			{
				if (_mobileInputAdapter != null)
				{
					OpenKeyboard();
				}
				else
				{
					_caret = Stage.inst.inputCaret;
					_caret.grahpics.sortingOrder = this.renderingOrder + 1;
					_caret.SetParent(cachedTransform);
					_caret.SetSizeAndColor(_textFormat.size, _textFormat.color);

					_highlighter = Stage.inst.highlighter;
					_highlighter.grahpics.sortingOrder = this.renderingOrder + 2;
					_highlighter.SetParent(cachedTransform);

					onKeyDown.AddCapture(__keydown);
					onTouchBegin.AddCapture(__touchBegin);
				}
			}
		}
		void __focusIn(EventContext context)
		{
			if (_mobileInputAdapter != null)
			{
				OpenKeyboard();
			}
			else
			{
				_caret = Stage.inst.inputCaret;
				_caret.grahpics.sortingOrder = this.renderingOrder + 1;
				_caret.SetParent(cachedTransform);
				_caret.SetSizeAndColor(_textFormat.size, _textFormat.color);

				_highlighter = Stage.inst.highlighter;
				_highlighter.grahpics.sortingOrder = this.renderingOrder + 2;
				_highlighter.SetParent(cachedTransform);

				_caretPosition = _text.Length;
				CharPosition cp = GetCharPosition(_caretPosition);
				AdjustCaret(cp);
				_selectionStart = cp;
			}
		}
示例#3
0
        void __focusIn(EventContext context)
        {
            if (_input)
            {
                if (_mobileInputAdapter != null)
                {
                    OpenKeyboard();
                    onMouseDown.AddCapture(__mouseDown2);
                }
                else
                {
                    _caret = Stage.inst.inputCaret;
                    _caret.SetParent(cachedTransform);
                    _caret.SetSizeAndColor(Mathf.FloorToInt(_textFormat.size * _fontScale), _textFormat.color);

                    _highlighter = Stage.inst.highlighter;
                    _highlighter.SetParent(cachedTransform);

                    onKeyDown.AddCapture(__keydown);
                    onMouseDown.AddCapture(__mouseDown);
                }
            }
        }