FairyGUI.Shape.DrawRect C# (CSharp) Method

DrawRect() public method

public DrawRect ( int lineSize, Color colors ) : void
lineSize int
colors UnityEngine.Color
return void
        public void DrawRect(int lineSize, Color[] colors)
        {
            _type = 1;
            _lineSize = lineSize;
            _colors = colors;

            _touchDisabled = false;
            _requireUpdateMesh = true;
        }

Same methods

Shape::DrawRect ( int lineSize, Color lineColor, Color fillColor ) : void

Usage Example

        void __focusIn(EventContext context)
        {
            if (!editable || !Application.isPlaying)
            {
                return;
            }

            _editing = true;

            if (_caret == null)
            {
                CreateCaret();
            }

            if (!string.IsNullOrEmpty(_promptText))
            {
                UpdateText();
            }

            float caretSize;

            //如果界面缩小过,光标很容易看不见,这里放大一下
            if (UIConfig.inputCaretSize == 1 && GRoot.contentScaleFactor < 1)
            {
                caretSize = (float)UIConfig.inputCaretSize / GRoot.contentScaleFactor;
            }
            else
            {
                caretSize = UIConfig.inputCaretSize;
            }
            _caret.SetSize(caretSize, textField.textFormat.size);
            _caret.DrawRect(0, Color.clear, textField.textFormat.color);
            AddChild(_caret);

            _selectionShape.Clear();
            AddChild(_selectionShape);

            if (!textField.Redraw())
            {
                TextField.CharPosition cp = GetCharPosition(_caretPosition);
                AdjustCaret(cp);
            }

            if (Stage.keyboardInput)
            {
                if (keyboardInput)
                {
                    Stage.inst.OpenKeyboard(_text, false, _displayAsPassword ? false : !textField.singleLine,
                                            _displayAsPassword, false, null, keyboardType, hideInput);

                    SetSelection(0, -1);
                }
            }
            else
            {
                Input.imeCompositionMode = IMECompositionMode.On;
                _composing = 0;
            }
        }
All Usage Examples Of FairyGUI.Shape::DrawRect