private bool CreateText3D(string identifier, string text, CitizenFX.Core.UI.Font font, Color color, Vector2 scale, Vector3 pos, float maxDistance, int entity = -1) { try { if (identifier == null || texts.ContainsKey(identifier)) { return(false); } texts.Add(identifier, new Text3D { TextString = text, Font = font, Color = color, Scale = scale, Pos = pos, MaxDistance = maxDistance, Entity = entity != -1 ? Entity.FromHandle(entity) : null }); return(true); } catch (Exception Ex) { Debug.WriteLine("Error: " + Ex); return(false); } }
private bool CreateText3D(string identifier, string text, CitizenFX.Core.UI.Font font, System.Drawing.Color color, Vector2 scale, Vector3 pos, float maxDistance) { try { texts.Add(identifier, new Text3D { TextString = text, Font = font, Color = color, Scale = scale, Pos = pos, MaxDistance = maxDistance }); return(true); } catch (Exception Ex) { Debug.WriteLine("Error: " + Ex); return(false); } }
public static float MeasureString(string input, CitizenFX.Core.UI.Font font, float scale) { return(UIResText.MeasureStringWidth(input, font, scale)); }