public List <List <InlineSegment> > WrapSegments() { _curLine = new List <InlineSegment>(); _lines = new List <List <InlineSegment> > { _curLine }; foreach (InlineSegment sourceSeg in _container._inlineSequence.Segments) { if (sourceSeg.Color != null || sourceSeg.Background != null) { _curLine.Add(sourceSeg); } else { TextWrap textWrap = _container.TextWrap; if (textWrap == TextWrap.NoWrap) { AppendTextSegmentNoWrap(sourceSeg); } else if (textWrap == TextWrap.CharWrap) { AppendTextSegmentCharWrap(sourceSeg); } else if (textWrap == TextWrap.WordWrap) { AppendTextSegmentWordWrap(sourceSeg); } } } return(_lines); }
private void UpdateLayout(string text, double width, double?height, bool forceWidth) { if (text != last_text) { last_formatted_text = GetFormattedText(text) ?? ""; last_text = text; if (TextWrap == TextWrap.None && last_formatted_text.IndexOfAny(lfcr) >= 0) { last_formatted_text = last_formatted_text.Replace("\r\n", "\x20").Replace('\n', '\x20').Replace('\r', '\x20'); } } TextWrap wrap = TextWrap; layout.Width = wrap != TextWrap.None || forceWidth ? (int)(Pango.Scale.PangoScale * width) : -1; layout.Wrap = GetPangoWrapMode(wrap); if (height != null && wrap != TextWrap.None) { layout.SetHeight((int)(Pango.Scale.PangoScale * height.Value)); } font_desc.Weight = GetPangoFontWeight(FontWeight); layout.SingleParagraphMode = wrap == TextWrap.None; layout.Ellipsize = EllipsizeMode; if (UseMarkup) { layout.SetMarkup(last_formatted_text); } else { layout.SetText(last_formatted_text); } }
public override void OnInspectorGUI() { TextWrap target_ = (TextWrap)target; EditorTools.SetLabelWidth(80); target_.text = EditorGUILayout.TextArea(target_.text); target_.NumCount = EditorGUILayout.IntField("最大位数", target_.NumCount); target_.interval = EditorGUILayout.FloatField("字间间隔", target_.interval); target_.mode = (TextWrap.WrapMode)EditorGUILayout.EnumPopup("显示方式", target_.mode); target_.atlas = EditorGUILayout.ObjectField("图集", target_.atlas, typeof(SpriteAtlas), true) as SpriteAtlas; target_.ImageSize = EditorGUILayout.Vector2Field("图片尺寸", target_.ImageSize); }
static int QPYX_NumChange_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)ToLua.CheckObject <TextWrap>(L_YXQP, 1); QPYX_obj_YXQP.NumChange(); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
Pango.WrapMode GetPangoWrapMode(TextWrap wrap) { switch (wrap) { case TextWrap.Char: return(Pango.WrapMode.Char); case TextWrap.WordChar: return(Pango.WrapMode.WordChar); case TextWrap.None: case TextWrap.Word: default: return(Pango.WrapMode.Word); } }
static int NumChange(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); TextWrap obj = (TextWrap)ToLua.CheckObject <TextWrap>(L, 1); obj.NumChange(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int QPYX_set_imageList_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; System.Collections.Generic.List <UnityEngine.UI.Image> QPYX_arg0_YXQP = (System.Collections.Generic.List <UnityEngine.UI.Image>)ToLua.CheckObject(L_YXQP, 2, typeof(System.Collections.Generic.List <UnityEngine.UI.Image>)); QPYX_obj_YXQP.imageList = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index imageList on a nil value")); } }
static int QPYX_set_atlas_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; SpriteAtlas QPYX_arg0_YXQP = (SpriteAtlas)ToLua.CheckObject <SpriteAtlas>(L_YXQP, 2); QPYX_obj_YXQP.atlas = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index atlas on a nil value")); } }
static int QPYX_get_interval_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; float QPYX_ret_YXQP = QPYX_obj_YXQP.interval; LuaDLL.lua_pushnumber(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index interval on a nil value")); } }
static int QPYX_get_mode_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; TextWrap.WrapMode QPYX_ret_YXQP = QPYX_obj_YXQP.mode; ToLua.Push(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index mode on a nil value")); } }
static int QPYX_get_text_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; string QPYX_ret_YXQP = QPYX_obj_YXQP.text; LuaDLL.lua_pushstring(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index text on a nil value")); } }
static int QPYX_get_imageList_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; System.Collections.Generic.List <UnityEngine.UI.Image> QPYX_ret_YXQP = QPYX_obj_YXQP.imageList; ToLua.PushSealed(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index imageList on a nil value")); } }
static int QPYX_get_atlas_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; SpriteAtlas QPYX_ret_YXQP = QPYX_obj_YXQP.atlas; ToLua.Push(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index atlas on a nil value")); } }
static int QPYX_get_value_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); ComponentCache.Injection <TextWrap> QPYX_obj_YXQP = (ComponentCache.Injection <TextWrap>)QPYX_o_YXQP; TextWrap QPYX_ret_YXQP = QPYX_obj_YXQP.value; ToLua.Push(L_YXQP, QPYX_ret_YXQP); return(1); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index value on a nil value")); } }
static int QPYX_set_ImageSize_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; UnityEngine.Vector2 QPYX_arg0_YXQP = ToLua.ToVector2(L_YXQP, 2); QPYX_obj_YXQP.ImageSize = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index ImageSize on a nil value")); } }
static int QPYX_set_interval_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; float QPYX_arg0_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 2); QPYX_obj_YXQP.interval = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index interval on a nil value")); } }
static int QPYX_set_text_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2); QPYX_obj_YXQP.text = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index text on a nil value")); } }
static int QPYX_set_mode_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); TextWrap QPYX_obj_YXQP = (TextWrap)QPYX_o_YXQP; TextWrap.WrapMode QPYX_arg0_YXQP = (TextWrap.WrapMode)ToLua.CheckObject(L_YXQP, 2, typeof(TextWrap.WrapMode)); QPYX_obj_YXQP.mode = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index mode on a nil value")); } }
static int QPYX_GetDigit_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 2); TextWrap QPYX_obj_YXQP = (TextWrap)ToLua.CheckObject <TextWrap>(L_YXQP, 1); int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2); int QPYX_o_YXQP = QPYX_obj_YXQP.GetDigit(QPYX_arg0_YXQP); LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP); return(1); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int QPYX_SetDigitStr_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 3); TextWrap QPYX_obj_YXQP = (TextWrap)ToLua.CheckObject <TextWrap>(L_YXQP, 1); BetterList <string> QPYX_arg0_YXQP = (BetterList <string>)ToLua.CheckObject <BetterList <string> >(L_YXQP, 2); int QPYX_arg1_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 3); QPYX_obj_YXQP.SetDigitStr(QPYX_arg0_YXQP, QPYX_arg1_YXQP); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int QPYX_set_value_YXQP(IntPtr L_YXQP) { object QPYX_o_YXQP = null; try { QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1); ComponentCache.Injection <TextWrap> QPYX_obj_YXQP = (ComponentCache.Injection <TextWrap>)QPYX_o_YXQP; TextWrap QPYX_arg0_YXQP = (TextWrap)ToLua.CheckObject <TextWrap>(L_YXQP, 2); QPYX_obj_YXQP.value = QPYX_arg0_YXQP; return(0); } catch (Exception QPYX_e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index value on a nil value")); } }
static int QPYX_SetImage_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 4); TextWrap QPYX_obj_YXQP = (TextWrap)ToLua.CheckObject <TextWrap>(L_YXQP, 1); UnityEngine.UI.Image QPYX_arg0_YXQP = (UnityEngine.UI.Image)ToLua.CheckObject <UnityEngine.UI.Image>(L_YXQP, 2); UnityEngine.Sprite QPYX_arg1_YXQP = (UnityEngine.Sprite)ToLua.CheckObject(L_YXQP, 3, typeof(UnityEngine.Sprite)); UnityEngine.Vector3 QPYX_arg2_YXQP = ToLua.ToVector3(L_YXQP, 4); QPYX_obj_YXQP.SetImage(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int GetDigit(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); TextWrap obj = (TextWrap)ToLua.CheckObject <TextWrap>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int o = obj.GetDigit(arg0); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetDigitStr(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); TextWrap obj = (TextWrap)ToLua.CheckObject <TextWrap>(L, 1); BetterList <string> arg0 = (BetterList <string>)ToLua.CheckObject <BetterList <string> >(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.SetDigitStr(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_NumCount(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); TextWrap obj = (TextWrap)o; int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.NumCount = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index NumCount on a nil value")); } }
static int set_ImageSize(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); TextWrap obj = (TextWrap)o; UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); obj.ImageSize = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ImageSize on a nil value")); } }
static int SetImage(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); TextWrap obj = (TextWrap)ToLua.CheckObject <TextWrap>(L, 1); UnityEngine.UI.Image arg0 = (UnityEngine.UI.Image)ToLua.CheckObject <UnityEngine.UI.Image>(L, 2); UnityEngine.Sprite arg1 = (UnityEngine.Sprite)ToLua.CheckObject(L, 3, typeof(UnityEngine.Sprite)); UnityEngine.Vector3 arg2 = ToLua.ToVector3(L, 4); obj.SetImage(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_interval(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); TextWrap obj = (TextWrap)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.interval = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index interval on a nil value")); } }
static int set_mode(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); TextWrap obj = (TextWrap)o; TextWrap.WrapMode arg0 = (TextWrap.WrapMode)ToLua.CheckObject(L, 2, typeof(TextWrap.WrapMode)); obj.mode = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index mode on a nil value")); } }
static int set_text(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); TextWrap obj = (TextWrap)o; string arg0 = ToLua.CheckString(L, 2); obj.text = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index text on a nil value")); } }
private Pango.WrapMode GetPangoWrapMode(TextWrap wrap) { switch (wrap) { case TextWrap.Char: return Pango.WrapMode.Char; case TextWrap.WordChar: return Pango.WrapMode.WordChar; case TextWrap.None: case TextWrap.Word: default: return Pango.WrapMode.Word; } }
public override TextSample CreateSample(string Text, Point? MaxSize, TextAlign HorizontalAlign, TextAlign VerticalAlign, TextWrap Wrap) { return new _TextSample(this, Text, MaxSize, HorizontalAlign, VerticalAlign, Wrap); }
/// <summary> /// Gets a text sample for the specified text when drawn with this font. Note that multiple lines can be created with '\n'. /// <returns></returns> public abstract TextSample CreateSample(string Text, Point? MaxSize, TextAlign HorizontalAlign, TextAlign VerticalAlign, TextWrap Wrap);
public _TextSample(SystemFont Font, string Text, Point? MaxSize, TextAlign HorizontalAlign, TextAlign VerticalAlign, TextWrap Wrap) { this._Font = Font; this._Text = Text; this._TextureID = -1; this._MaxSize = MaxSize; this._HorizontalAlign = HorizontalAlign; this._VerticalAlign = VerticalAlign; this._Wrap = Wrap; }
private void SetTextWrap(TextWrap textWrap) { switch (textWrap) { case TextWrap.BothSides: this.radWrapTextBothSides.IsChecked = true; break; case TextWrap.LeftOnly: this.radWrapTextLeft.IsChecked = true; break; case TextWrap.RightOnly: this.radWrapTextRight.IsChecked = true; break; default: throw new NotImplementedException("Unknown TextWrap: " + textWrap.ToString()); } }