InsertNewLines
using FlatRedBall.Graphics;
using FlatRedBall.Math.Geometry;AxisAlignedRectangle axisAlignedRectangle =
ShapeManager.AddAxisAlignedRectangle();
axisAlignedRectangle.ScaleX = 5;
axisAlignedRectangle.ScaleY = 5;
Text text = TextManager.AddText(
"Hello. I am a Text object. My DisplayText is pretty long. It's likely " +
"that FlatRedBall users will want to wrap this text. Fortunately, there's a " +
"way to do this that's fairly easy with the InsertNewLines method." +
"I'll fit inside an AxisAlignedRectangle to show how nice I word wrap.");
text.X = axisAlignedRectangle.Left;
float maxWidth = axisAlignedRectangle.ScaleX * 2;
text.InsertNewLines(maxWidth);
Additional Information
Last updated
Was this helpful?