VerticalAlignment
Introduction
Example - Vertical Alignment Values
// Initialize
var topAligned = new TextRuntime();
topAligned.AddToRoot();
topAligned.Text = "Hi, I am some text that is top aligned, even if I line wrap";
topAligned.VerticalAlignment = RenderingLibrary.Graphics.VerticalAlignment.Top;
topAligned.Width = 150;
topAligned.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
topAligned.Height = 150;
topAligned.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
topAligned.X = 50;
topAligned.Y = 100;
var centerAligned = new TextRuntime();
centerAligned.AddToRoot();
centerAligned.Text = "Hi, I am some text that is center aligned, even if I line wrap";
centerAligned.VerticalAlignment = RenderingLibrary.Graphics.VerticalAlignment.Center;
centerAligned.Width = 150;
centerAligned.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
centerAligned.Height = 150;
centerAligned.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
centerAligned.X = 250;
centerAligned.Y = 100;
var bottomAligned = new TextRuntime();
bottomAligned.AddToRoot();
bottomAligned.Text = "Hi, I am some text that is bottom aligned, even if I line wrap";
bottomAligned.VerticalAlignment = RenderingLibrary.Graphics.VerticalAlignment.Bottom;
bottomAligned.Width = 150;
bottomAligned.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
bottomAligned.Height = 150;
bottomAligned.HeightUnits = Gum.DataTypes.DimensionUnitType.Absolute;
bottomAligned.X = 450;
bottomAligned.Y = 100;VerticalAlignment, Anchor, and Dock
Last updated
Was this helpful?

