Glyph.Positioning
A class in Root.Township, Alta.Pages.
Where a glyph sits on a page: position, rotation and scale, snapped to steps so it syncs compactly (0.01 position, 10 degrees, 0.1 scale).
- Listed in Items, inventory and logic
- Nested in
Glyph
Constructors
| Member | What it is |
|---|---|
Positioning() | Creates a Glyph.Positioning from glyph, position, rotation and scale. |
Positioning(Glyph glyph, Vector2 position, float rotation, float scale) | Creates a Glyph.Positioning from glyph, position, rotation and scale. |
Fields
4 private and internal fields
Properties
| Member | What it is |
|---|---|
Glyph Glyph { get; } | The glyph drawn. |
Vector2 Position { get; } | Position on the page: x from 0 to 1, y from 0 to the page's size ratio. |
float Rotation { get; } | Rotation in degrees, 0 to 350. |
float Scale { get; } | Scale, from 0.25 to 4.5. |
Methods
| Member | What it is |
|---|---|
void ApplyTo(Transform transform) | Places a transform on the page from this positioning. |
void CalculateFrom(Transform transform) | Reads a transform's place on the page, snaps it to the steps, clamps it and moves the transform to match. |
Glyph.Positioning Copy() | Returns a copy. |
override int GetHashCode() | Hash of the snapped values and the glyph's hash. |
void Serialize(Stream stream) | Reads or writes the glyph hash and snapped values. |
void Validate() | Clamps position, rotation and scale to their ranges. |
Used in
Members of other types that take, return or hold a Positioning:
GenericCraftingRecipe.uniqueGlyphs, GenericCraftingRecipe.UniqueGlyphs, GlyphInstance.details, GlyphInstance.Details, GlyphInstance.Load, PageData.glyphs, PageData.Glyphs, PageInstanceSaveData.custom, PageInstanceSaveData1.custom, PageInstanceSaveData2.custom, ChiselRecipePageSettings.sizeBrackets, ChiselRecipePageSettings.woodBlocks, GlyphPosition.Create.