private static Vector2 DoGetCursorPosition(TextNativeSettings settings, Rect rect, int cursorPosition) { Vector2 result; TextNative.DoGetCursorPosition_Injected(ref settings, ref rect, cursorPosition, out result); return(result); }
private static Vector2 DoGetOffset(TextNativeSettings settings, Rect rect) { Vector2 result; TextNative.DoGetOffset_Injected(ref settings, ref rect, out result); return(result); }
public static Vector2 GetCursorPosition(TextNativeSettings settings, Rect rect, int cursorIndex) { if (settings.font == null) { Debug.LogError("Cannot process a null font."); return(Vector2.zero); } return(DoGetCursorPosition(settings, rect, cursorIndex)); }
public static Vector2 GetOffset(TextNativeSettings settings, Rect screenRect) { if (settings.font == null) { Debug.LogError("Cannot process a null font."); return(new Vector2(0, 0)); } settings.text = settings.text ?? ""; return(DoGetOffset(settings, screenRect)); }
public static unsafe NativeArray <TextVertex> GetVertices(TextNativeSettings settings) { int vertexCount = 0; GetVertices(settings, IntPtr.Zero, UnsafeUtility.SizeOf <TextVertex>(), ref vertexCount); var array = new NativeArray <TextVertex>(vertexCount, Allocator.Temp, NativeArrayOptions.UninitializedMemory); if (vertexCount > 0) { GetVertices(settings, (IntPtr)array.GetUnsafePtr(), UnsafeUtility.SizeOf <TextVertex>(), ref vertexCount); Debug.Assert(vertexCount == array.Length); } return(array); }
public NativeArray <TextVertex> GetVertices(MeshGenerationContextUtils.TextParams parms, float scaling) { int paramsHash = parms.GetHashCode(); if (m_PreviousTextParamsHash == paramsHash) { return(textVertices); } m_PreviousTextParamsHash = paramsHash; TextNativeSettings textSettings = MeshGenerationContextUtils.TextParams.GetTextNativeSettings(parms, scaling); textVertices = TextNative.GetVertices(textSettings); return(textVertices); }
public static NativeArray <TextVertex> GetVertices(TextNativeSettings settings) { int num = 0; TextNative.GetVertices(settings, IntPtr.Zero, UnsafeUtility.SizeOf <TextVertex>(), ref num); NativeArray <TextVertex> nativeArray = new NativeArray <TextVertex>(num, Allocator.Temp, NativeArrayOptions.UninitializedMemory); bool flag = num > 0; if (flag) { TextNative.GetVertices(settings, (IntPtr)nativeArray.GetUnsafePtr <TextVertex>(), UnsafeUtility.SizeOf <TextVertex>(), ref num); Debug.Assert(num == nativeArray.Length); } return(nativeArray); }
public static float ComputeTextHeight(TextNativeSettings settings) { if (settings.font == null) { Debug.LogError("Cannot process a null font."); return(0); } if (string.IsNullOrEmpty(settings.text)) { return(0); } return(DoComputeTextHeight(settings)); }
public static Vector2 GetCursorPosition(TextNativeSettings settings, Rect rect, int cursorIndex) { bool flag = settings.font == null; Vector2 result; if (flag) { Debug.LogError("Cannot process a null font."); result = Vector2.zero; } else { result = TextNative.DoGetCursorPosition(settings, rect, cursorIndex); } return(result); }
public static Vector2 GetOffset(TextNativeSettings settings, Rect screenRect) { bool flag = settings.font == null; Vector2 result; if (flag) { Debug.LogError("Cannot process a null font."); result = new Vector2(0f, 0f); } else { settings.text = (settings.text ?? ""); result = TextNative.DoGetOffset(settings, screenRect); } return(result); }
internal static TextNativeSettings GetTextNativeSettings(MeshGenerationContextUtils.TextParams textParams, float scaling) { TextNativeSettings result = new TextNativeSettings { text = textParams.text, font = textParams.font, size = textParams.fontSize, scaling = scaling, style = textParams.fontStyle, color = textParams.fontColor, anchor = textParams.anchor, wordWrap = textParams.wordWrap, wordWrapWidth = textParams.wordWrapWidth, richText = textParams.richText }; result.color *= textParams.playmodeTintColor; return(result); }
internal static TextNativeSettings GetTextNativeSettings(TextParams textParams, float scaling) { var settings = new TextNativeSettings { text = textParams.text, font = textParams.font, size = textParams.fontSize, scaling = scaling, style = textParams.fontStyle, color = textParams.fontColor, anchor = textParams.anchor, wordWrap = textParams.wordWrap, wordWrapWidth = textParams.wordWrapWidth, richText = textParams.richText }; settings.color *= textParams.playmodeTintColor; return(settings); }
public static float ComputeTextHeight(TextNativeSettings settings) { bool flag = settings.font == null; float result; if (flag) { Debug.LogError("Cannot process a null font."); result = 0f; } else { bool flag2 = string.IsNullOrEmpty(settings.text); if (flag2) { result = 0f; } else { result = TextNative.DoComputeTextHeight(settings); } } return(result); }
private static extern float DoComputeTextHeight_Injected(ref TextNativeSettings settings);
private static extern void DoGetOffset_Injected(ref TextNativeSettings settings, ref Rect rect, out Vector2 ret);
private static float DoComputeTextHeight(TextNativeSettings settings) { return(TextNative.DoComputeTextHeight_Injected(ref settings)); }
private static extern Vector2 DoGetOffset(TextNativeSettings settings, Rect rect);
private static extern void GetVertices(TextNativeSettings settings, IntPtr buffer, int vertexSize, ref int vertexCount);
private static extern Vector2 DoGetCursorPosition(TextNativeSettings settings, Rect rect, int cursorPosition);
private static extern float DoComputeTextHeight(TextNativeSettings settings);
private static extern float DoComputeTextWidth(TextNativeSettings settings);
private static extern void DoGetCursorPosition_Injected(ref TextNativeSettings settings, ref Rect rect, int cursorPosition, out Vector2 ret);
private static void GetVertices(TextNativeSettings settings, IntPtr buffer, int vertexSize, ref int vertexCount) { TextNative.GetVertices_Injected(ref settings, buffer, vertexSize, ref vertexCount); }
private static float DoComputeTextWidth(TextNativeSettings settings) { return(TextNative.DoComputeTextWidth_Injected(ref settings)); }