/// <summary> /// Sets the material text of this IGameObject. /// </summary> /// <param name="materialindex">The material index on the object to change.</param> /// <param name="text">The text to show on the object. (MAX 2048 characters)</param> /// <param name="materialsize">The object's material index to replace with text.</param> /// <param name="fontface">The font to use.</param> /// <param name="fontsize">The size of the text (max 255).</param> /// <param name="bold">Whether to write in bold.</param> /// <param name="foreColor">The color of the text.</param> /// <param name="backColor">The background color of the text.</param> /// <param name="textalignment">The alignment of the text.</param> public virtual void SetMaterialText(int materialindex, string text, ObjectMaterialSize materialsize, string fontface, int fontsize, bool bold, Color foreColor, Color backColor, ObjectMaterialTextAlign textalignment) { GlobalObjectInternal.Instance.SetObjectMaterialText(Id, text, materialindex, (int)materialsize, fontface, fontsize, bold, foreColor.ToInteger(ColorFormat.ARGB), backColor.ToInteger(ColorFormat.ARGB), (int)textalignment); }
public void SetMaterialText(int materialindex, string text, ObjectMaterialSize materialsize = ObjectMaterialSize.X256X128, string fontface = "Arial", int fontsize = 24, bool bold = true, Color fontcolor = new Color(), Color backcolor = new Color(), ObjectMaterialTextAlign textalignment = ObjectMaterialTextAlign.Center) { AssertNotDisposed(); Internal.SetDynamicObjectMaterialText(Id, materialindex, text, (int)materialsize, fontface, fontsize, bold, fontcolor.ToInteger(ColorFormat.ARGB), backcolor.ToInteger(ColorFormat.ARGB), (int)textalignment); }
/// <summary> /// Sets the material text of this <see cref="IGameObject" />. /// </summary> /// <param name="materialindex">The material index on the object to change.</param> /// <param name="text">The text to show on the object. (MAX 2048 characters)</param> /// <param name="materialsize">The object's material index to replace with text.</param> /// <param name="fontface">The font to use.</param> /// <param name="fontsize">The size of the text (max 255).</param> /// <param name="bold">Whether to write in bold.</param> /// <param name="foreColor">The color of the text.</param> /// <param name="backColor">The background color of the text.</param> /// <param name="textalignment">The alignment of the text.</param> public virtual void SetMaterialText(int materialindex, string text, ObjectMaterialSize materialsize, string fontface, int fontsize, bool bold, Color foreColor, Color backColor, ObjectMaterialTextAlign textalignment) { AssertNotDisposed(); Internal.SetPlayerObjectMaterialText(Owner.Id, Id, text, materialindex, (int)materialsize, fontface, fontsize, bold, foreColor.ToInteger(ColorFormat.ARGB), backColor.ToInteger(ColorFormat.ARGB), (int)textalignment); }
public void GetMaterialText(int materialindex, out string text, out ObjectMaterialSize materialSize, out string fontface, out int fontsize, out bool bold, out Color fontcolor, out Color backcolor, out ObjectMaterialTextAlign textalignment) { AssertNotDisposed(); Internal.GetDynamicObjectMaterialText(Id, materialindex, out text, out var holderMaterialSize, out fontface, out fontsize, out bold, out var holderFontColor, out var holderBackColor, out var holderTextalignment, 1024, 64); fontcolor = Color.FromInteger(holderFontColor, ColorFormat.ARGB); backcolor = Color.FromInteger(holderBackColor, ColorFormat.ARGB); materialSize = (ObjectMaterialSize)holderMaterialSize; textalignment = (ObjectMaterialTextAlign)holderTextalignment; }