public DrawWithTextSelection ( |
||
position | ||
content | ||
controlID | int | |
firstSelectedCharacter | int | |
lastSelectedCharacter | int | |
return | void |
public void DrawCursor(string newText) { string text = this.text; int num = cursorIndex; if (Input.compositionString.Length > 0) { m_Content.text = newText.Substring(0, cursorIndex) + Input.compositionString + newText.Substring(selectIndex); num += Input.compositionString.Length; } else { m_Content.text = newText; } graphicalCursorPos = style.GetCursorPixelPosition(new Rect(0f, 0f, position.width, position.height), m_Content, num); Vector2 contentOffset = style.contentOffset; style.contentOffset -= scrollOffset; style.Internal_clipOffset = scrollOffset; Input.compositionCursorPos = graphicalCursorPos + new Vector2(position.x, position.y + style.lineHeight) - scrollOffset; if (Input.compositionString.Length > 0) { style.DrawWithTextSelection(position, m_Content, controlID, cursorIndex, cursorIndex + Input.compositionString.Length, drawSelectionAsComposition: true); } else { style.DrawWithTextSelection(position, m_Content, controlID, cursorIndex, selectIndex); } if (m_iAltCursorPos != -1) { style.DrawCursor(position, m_Content, controlID, m_iAltCursorPos); } style.contentOffset = contentOffset; style.Internal_clipOffset = Vector2.zero; m_Content.text = text; }
static int DrawWithTextSelection(IntPtr L) { try { ToLua.CheckArgsCount(L, 6); UnityEngine.GUIStyle obj = (UnityEngine.GUIStyle)ToLua.CheckObject(L, 1, typeof(UnityEngine.GUIStyle)); UnityEngine.Rect arg0 = (UnityEngine.Rect)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rect)); UnityEngine.GUIContent arg1 = (UnityEngine.GUIContent)ToLua.CheckObject(L, 3, typeof(UnityEngine.GUIContent)); int arg2 = (int)LuaDLL.luaL_checknumber(L, 4); int arg3 = (int)LuaDLL.luaL_checknumber(L, 5); int arg4 = (int)LuaDLL.luaL_checknumber(L, 6); obj.DrawWithTextSelection(arg0, arg1, arg2, arg3, arg4); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int DrawWithTextSelection(IntPtr l) { try { UnityEngine.GUIStyle self = (UnityEngine.GUIStyle)checkSelf(l); UnityEngine.Rect a1; checkValueType(l, 2, out a1); UnityEngine.GUIContent a2; checkType(l, 3, out a2); System.Int32 a3; checkType(l, 4, out a3); System.Int32 a4; checkType(l, 5, out a4); System.Int32 a5; checkType(l, 6, out a5); self.DrawWithTextSelection(a1, a2, a3, a4, a5); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }