From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Scripts/Runtime/TMP_SpriteGlyph.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_SpriteGlyph.cs (limited to 'Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_SpriteGlyph.cs') diff --git a/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_SpriteGlyph.cs b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_SpriteGlyph.cs new file mode 100644 index 0000000..c57b84c --- /dev/null +++ b/Library/PackageCache/com.unity.textmeshpro@2.0.1/Scripts/Runtime/TMP_SpriteGlyph.cs @@ -0,0 +1,61 @@ +using System; +using UnityEngine; +using UnityEngine.TextCore; + +namespace TMPro +{ + /// + /// The visual representation of the sprite character using this glyph. + /// + [Serializable] + public class TMP_SpriteGlyph : Glyph + { + /// + /// An optional reference to the underlying sprite used to create this glyph. + /// + public Sprite sprite; + + + // ******************** + // CONSTRUCTORS + // ******************** + + public TMP_SpriteGlyph() { } + + /// + /// Constructor for new sprite glyph. + /// + /// Index of the sprite glyph. + /// Metrics which define the position of the glyph in the context of text layout. + /// GlyphRect which defines the coordinates of the glyph in the atlas texture. + /// Scale of the glyph. + /// Index of the atlas texture that contains the glyph. + public TMP_SpriteGlyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex) + { + this.index = index; + this.metrics = metrics; + this.glyphRect = glyphRect; + this.scale = scale; + this.atlasIndex = atlasIndex; + } + + /// + /// Constructor for new sprite glyph. + /// + /// >Index of the sprite glyph. + /// Metrics which define the position of the glyph in the context of text layout. + /// GlyphRect which defines the coordinates of the glyph in the atlas texture. + /// Scale of the glyph. + /// Index of the atlas texture that contains the glyph. + /// A reference to the Unity Sprite representing this sprite glyph. + public TMP_SpriteGlyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex, Sprite sprite) + { + this.index = index; + this.metrics = metrics; + this.glyphRect = glyphRect; + this.scale = scale; + this.atlasIndex = atlasIndex; + this.sprite = sprite; + } + } +} \ No newline at end of file -- cgit v1.2.3