Class ModelText
A collection of text tags which are visible in 3D.
Examples
var squareSize = 25.0;
var texts = new List<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)>();
var dir = Vector3.YAxis.Negate();
for (var x = 0.0; x < squareSize; x += 1.0)
{
for (var y = 0.0; y < squareSize; y += 1.0)
{
var c = new Color(x / squareSize, y / squareSize, 0.0, 1.0);
texts.Add((new Vector3(x, y), dir, Vector3.XAxis, $"[{x},{y}]", c));
}
}
// Create a model text object.
var modelText = new ModelText(texts, FontSize.PT36, 30);
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public class ModelText : MeshElement, INotifyPropertyChanged, ITessellate
Constructors
ModelText(IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, String text, Nullable<Color> color)>, FontSize, Double)
Create a set of text
Declaration
public ModelText(IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)> texts, FontSize fontSize, double scale = 10)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.ValueTuple<Vector3, Vector3, Vector3, System.String, System.Nullable<Color>>> | texts | A collection of text data objects which specify the location, direction, and content of the text. |
FontSize | fontSize | The font size of the text. |
System.Double | scale | An additional scale to apply to the size of the text. Fonts will be drawn at the real world equivalent of 72 dpi at scale=1.0. |
Properties
FontSize
The font size of the model text.
Declaration
public FontSize FontSize { get; set; }
Property Value
Type | Description |
---|---|
FontSize |
Scale
An additional scale to apply to the size of the text. Fonts will be drawn at the real world equivalent of 72 dpi at scale=1.0.
Declaration
public double Scale { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Texts
A collection of text data objects which specify the location, direction, content, and color of the text.
Declaration
public IList<(Vector3 location, Vector3 facingDirection, Vector3 lineDirection, string text, Color? color)> Texts { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.ValueTuple<Vector3, Vector3, Vector3, System.String, System.Nullable<Color>>> |
Implements
System.ComponentModel.INotifyPropertyChanged