ScaleX
Introduction
Scale and Position
Code example
using FlatRedBall.Math.Geometry;
using FlatRedBall.Graphics; Text text1 = TextManager.AddText("Short text");
Text text2 = TextManager.AddText("Some longer text");
text2.Y = -4;
// Now create the AxisAlignedRectangles using the scale and position of the
// texts we just created:
AxisAlignedRectangle aaRect1 = ShapeManager.AddAxisAlignedRectangle();
aaRect1.X = text1.HorizontalCenter;
aaRect1.Y = text1.VerticalCenter;
aaRect1.ScaleX = text1.ScaleX;
aaRect1.ScaleY = text1.ScaleY;
AxisAlignedRectangle aaRect2 = ShapeManager.AddAxisAlignedRectangle();
aaRect2.X = text2.HorizontalCenter;
aaRect2.Y = text2.VerticalCenter;
aaRect2.ScaleX = text2.ScaleX;
aaRect2.ScaleY = text2.ScaleY;
Last updated
Was this helpful?