Пример #1
0
        public GTextField()
            : base()
        {
            underConstruct = true;

            _textFormat = new TextFormat();
            _textFormat.font = UIConfig.defaultFont;
            _textFormat.size = 12;
            _textFormat.color = Color.black;
            _textFormat.lineSpacing = 3;
            _textFormat.letterSpacing = 0;
            _strokeColor = new Color(0, 0, 0, 1);
            UpdateTextFormat();

            _text = string.Empty;
            _align = AlignType.Left;
            _verticalAlign = VertAlignType.Top;

            this.autoSize = AutoSizeType.Both;

            underConstruct = false;

            gearColor = new GearColor(this);

            onFocusIn = new EventListener(this, "onFocusIn");
            onFocusOut = new EventListener(this, "onFocusOut");
            onChanged = new EventListener(this, "onChanged");
        }
        public GTextField()
            : base()
        {
            _textFormat = new TextFormat();
            _textFormat.font = UIConfig.defaultFont;
            _textFormat.size = 12;
            _textFormat.color = Color.black;
            _textFormat.lineSpacing = 3;
            _textFormat.letterSpacing = 0;

            TextFormat tf = _textField.textFormat;
            tf.CopyFrom(_textFormat);
            _textField.textFormat = tf;

            _text = string.Empty;
            _autoSize = AutoSizeType.Both;
            _widthAutoSize = true;
            _heightAutoSize = true;
            _textField.autoSize = true;
            _textField.wordWrap = false;

            gearColor = new GearColor(this);

            onFocusIn = new EventListener(this, "onFocusIn");
            onFocusOut = new EventListener(this, "onFocusOut");
            onChanged = new EventListener(this, "onChanged");
        }
Пример #3
0
		public TextField()
		{
			_optimizeNotTouchable = true;

			_textFormat = new TextFormat();
			_textFormat.size = 12;
			_textFormat.lineSpacing = 3;
			_strokeColor = new Color(0, 0, 0, 1);

			_wordWrap = true;
			_displayAsPassword = false;
			_maxLength = int.MaxValue;
			_text = string.Empty;

			_elements = new List<HtmlElement>(1);
			_lines = new List<LineInfo>(1);

			CreateGameObject("TextField");
			graphics = new NGraphics(gameObject);

			onFocusIn = new EventListener(this, "onFocusIn");
			onFocusOut = new EventListener(this, "onFocusOut");
			onChanged = new EventListener(this, "onChanged");

			_touchMoveDelegate = __touchMove;
			_onChangedDelegate = OnChanged;
		}
Пример #4
0
 public void CopyFrom(TextFormat source)
 {
     this.size = source.size;
     this.font = source.font;
     this.color = source.color;
     this.lineSpacing = source.lineSpacing;
     this.letterSpacing = source.letterSpacing;
     this.bold = source.bold;
     this.underline = source.underline;
     this.italic = source.italic;
 }
Пример #5
0
    static int set_gradientColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat   obj  = (FairyGUI.TextFormat)o;
            UnityEngine.Color32[] arg0 = ToLua.CheckStructArray <UnityEngine.Color32>(L, 2);
            obj.gradientColor = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index gradientColor on a nil value"));
        }
    }
Пример #6
0
    static int get_specialStyle(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            FairyGUI.TextFormat.SpecialStyle ret = obj.specialStyle;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index specialStyle on a nil value"));
        }
    }
Пример #7
0
    static int get_size(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            int ret = obj.size;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index size on a nil value" : e.Message));
        }
    }
Пример #8
0
 override public void SetFontStyle(TextFormat format)
 {
     if (format.bold && !customBold)
     {
         if (format.italic)
             _style = FontStyle.BoldAndItalic;
         else
             _style = FontStyle.Bold;
     }
     else
     {
         if (format.italic)
             _style = FontStyle.Italic;
         else
             _style = FontStyle.Normal;
     }
 }
Пример #9
0
    static int set_align(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj  = (FairyGUI.TextFormat)o;
            FairyGUI.AlignType  arg0 = (FairyGUI.AlignType)ToLua.CheckObject(L, 2, typeof(FairyGUI.AlignType));
            obj.align = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index align on a nil value"));
        }
    }
Пример #10
0
    static int set_letterSpacing(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.letterSpacing = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index letterSpacing on a nil value"));
        }
    }
Пример #11
0
    static int set_strikethrough(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.strikethrough = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index strikethrough on a nil value"));
        }
    }
Пример #12
0
    static int get_shadowColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            UnityEngine.Color   ret = obj.shadowColor;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowColor on a nil value"));
        }
    }
Пример #13
0
    static int set_font(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            string arg0             = ToLua.CheckString(L, 2);
            obj.font = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index font on a nil value"));
        }
    }
Пример #14
0
    static int set_shadowColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj  = (FairyGUI.TextFormat)o;
            UnityEngine.Color   arg0 = ToLua.ToColor(L, 2);
            obj.shadowColor = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowColor on a nil value"));
        }
    }
Пример #15
0
    static int get_textFormat(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GTextField obj = (FairyGUI.GTextField)o;
            FairyGUI.TextFormat ret = obj.textFormat;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index textFormat on a nil value"));
        }
    }
Пример #16
0
    static int get_strikethrough(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            bool ret = obj.strikethrough;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index strikethrough on a nil value"));
        }
    }
Пример #17
0
    static int get_align(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            FairyGUI.AlignType  ret = obj.align;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index align on a nil value"));
        }
    }
Пример #18
0
    static int get_letterSpacing(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            int ret = obj.letterSpacing;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index letterSpacing on a nil value"));
        }
    }
Пример #19
0
    static int get_font(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            string ret = obj.font;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index font on a nil value"));
        }
    }
Пример #20
0
    static int set_textFormat(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GTextField obj  = (FairyGUI.GTextField)o;
            FairyGUI.TextFormat arg0 = (FairyGUI.TextFormat)ToLua.CheckObject <FairyGUI.TextFormat>(L, 2);
            obj.textFormat = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index textFormat on a nil value"));
        }
    }
Пример #21
0
    static int set_specialStyle(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            FairyGUI.TextFormat.SpecialStyle arg0 = (FairyGUI.TextFormat.SpecialStyle)ToLua.CheckObject(L, 2, typeof(FairyGUI.TextFormat.SpecialStyle));
            obj.specialStyle = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index specialStyle on a nil value"));
        }
    }
Пример #22
0
    static int get_outline(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            float ret = obj.outline;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index outline on a nil value"));
        }
    }
Пример #23
0
    static int set_outline(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.TextFormat obj = (FairyGUI.TextFormat)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.outline = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index outline on a nil value"));
        }
    }
Пример #24
0
        public GTextField()
            : base()
        {
            _textFormat = new TextFormat();
            _textFormat.font = UIConfig.defaultFont;
            _textFormat.size = 12;
            _textFormat.color = Color.black;
            _textFormat.lineSpacing = 3;
            _textFormat.letterSpacing = 0;

            TextFormat tf = _textField.textFormat;
            tf.CopyFrom(_textFormat);
            _textField.textFormat = tf;

            _text = string.Empty;
            _textField.autoSize = AutoSizeType.Both;
            _textField.wordWrap = false;
        }
Пример #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 public void CopyFrom(TextFormat source)
 {
     this.size = source.size;
     this.font = source.font;
     this.color = source.color;
     this.lineSpacing = source.lineSpacing;
     this.letterSpacing = source.letterSpacing;
     this.bold = source.bold;
     this.underline = source.underline;
     this.italic = source.italic;
     if (source.gradientColor != null)
     {
         this.gradientColor = new Color32[4];
         source.gradientColor.CopyTo(this.gradientColor, 0);
     }
     else
         this.gradientColor = null;
 }
Пример #26
0
        public TextField()
        {
            _touchDisabled = true;

            _textFormat = new TextFormat();
            _textFormat.size = 12;
            _textFormat.lineSpacing = 3;
            _strokeColor = new Color(0, 0, 0, 1);
            _fontSizeScale = 1;
            _renderScale = UIContentScaler.scaleFactor;

            _wordWrap = true;
            _text = string.Empty;

            _elements = new List<HtmlElement>(1);
            _lines = new List<LineInfo>(1);

            CreateGameObject("TextField");
            graphics = new NGraphics(gameObject);
        }
    static int _CreateFairyGUI_TextFormat(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                FairyGUI.TextFormat obj = new FairyGUI.TextFormat();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.TextFormat.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Пример #28
0
        public TextField()
        {
            _textFormat = new TextFormat();
            _textFormat.size = 12;
            _textFormat.lineSpacing = 3;
            _fontScale = 1;
            _strokeColor = new Color(0, 0, 0, 1);

            _wordWrap = true;
            _displayAsPassword = false;
            optimizeNotTouchable = true;
            _maxLength = int.MaxValue;
            _text = string.Empty;

            _elements = new List<HtmlElement>();
            _lines = new List<LineInfo>();

            quadBatch = new QuadBatch(gameObject);

            onFocusIn = new EventListener(this, "onFocusIn");
            onFocusOut = new EventListener(this, "onFocusOut");
            onChanged = new EventListener(this, "onChanged");
        }
Пример #29
0
 virtual public void SetFormat(TextFormat format, float fontSizeScale)
 {
 }
Пример #30
0
 public override void SetFontStyle(TextFormat format)
 {
 }
Пример #31
0
 public virtual void SetFormat(TextFormat format)
 {
 }
Пример #32
0
 public bool EqualStyle(TextFormat aFormat)
 {
     return size == aFormat.size && color.Equals(aFormat.color)
         && bold == aFormat.bold && underline == aFormat.underline
         && italic == aFormat.italic;
 }
Пример #33
0
 abstract public void SetFontStyle(TextFormat format);
Пример #34
0
 public override void SetFormat(TextFormat format, float fontSizeScale)
 {
     if (resizable)
         this.scale = (float)format.size / size * fontSizeScale;
 }
Пример #35
0
		FontStyle GetFontStyle(TextFormat format)
		{
			if (format.bold)
			{
				if (format.italic)
					return FontStyle.BoldAndItalic;
				else
					return FontStyle.Bold;
			}
			else
			{
				if (format.italic)
					return FontStyle.Italic;
				else
					return FontStyle.Normal;
			}
		}
Пример #36
0
 virtual public void SetFormat(TextFormat format)
 {
 }
 public override void SetFormat(TextFormat format)
 {
     _size = format.size;
     if (format.bold && !customBold)
     {
         if (format.italic)
         {
             if (customBoldAndItalic)
                 _style = FontStyle.Italic;
             else
                 _style = FontStyle.BoldAndItalic;
         }
         else
             _style = FontStyle.Bold;
     }
     else
     {
         if (format.italic)
             _style = FontStyle.Italic;
         else
             _style = FontStyle.Normal;
     }
 }
Пример #38
0
 public abstract void SetFontStyle(TextFormat format);
Пример #39
0
 override public void SetFontStyle(TextFormat format)
 {
 }
Пример #40
0
        public override void SetFormat(TextFormat format, float fontSizeScale)
        {
            if (fontSizeScale == 1)
                _size = format.size;
            else
                _size = Mathf.FloorToInt((float)format.size * fontSizeScale);
            if (keepCrisp)
                _size = Mathf.FloorToInt(_size * UIContentScaler.scaleFactor);

            if (format.bold && !customBold)
            {
                if (format.italic)
                {
                    if (customBoldAndItalic)
                        _style = FontStyle.Italic;
                    else
                        _style = FontStyle.BoldAndItalic;
                }
                else
                    _style = FontStyle.Bold;
            }
            else
            {
                if (format.italic)
                    _style = FontStyle.Italic;
                else
                    _style = FontStyle.Normal;
            }
        }
Пример #41
0
 public virtual void SetFormat(TextFormat format, float fontSizeScale)
 {
 }