// This class does not support visibility. // The reason is because setting visibility // on a AxisAlignedRectangle (which would occur // in the ToAxisAlignedRectangle method) would add // it to the manager. We can't do that because the ToRuntime // methods should not add the object to any manager. Maybe we'll // fix this at some point in the future. //public bool Visible; //public bool ShouldSerializeVisible() //{ // return Visible == false; //} #endregion public static AxisAlignedRectangleSave FromAxisAlignedRectangle(FlatRedBall.Math.Geometry.AxisAlignedRectangle rectangle) { AxisAlignedRectangleSave aars = new AxisAlignedRectangleSave(); aars.SetFrom(rectangle); return aars; }
// This class does not support visibility. // The reason is because setting visibility // on a AxisAlignedRectangle (which would occur // in the ToAxisAlignedRectangle method) would add // it to the manager. We can't do that because the ToRuntime // methods should not add the object to any manager. Maybe we'll // fix this at some point in the future. //public bool Visible; //public bool ShouldSerializeVisible() //{ // return Visible == false; //} #endregion public static AxisAlignedRectangleSave FromAxisAlignedRectangle(FlatRedBall.Math.Geometry.AxisAlignedRectangle rectangle) { AxisAlignedRectangleSave aars = new AxisAlignedRectangleSave(); aars.SetFrom(rectangle); return(aars); }
public void AddAxisAlignedRectangleList(PositionedObjectList <FlatRedBall.Math.Geometry.AxisAlignedRectangle> axisAlignedRectanglesToAdd) { foreach (FlatRedBall.Math.Geometry.AxisAlignedRectangle rectangle in axisAlignedRectanglesToAdd) { AxisAlignedRectangleSave rectangleSave = AxisAlignedRectangleSave.FromAxisAlignedRectangle(rectangle); AxisAlignedRectangleSaves.Add(rectangleSave); } }
public NamedObjectSave RectangleSaveToNamedObjectSave(AxisAlignedRectangleSave rectangle) { NamedObjectSave toReturn = new NamedObjectSave(); toReturn.SourceType = SourceType.FlatRedBallType; toReturn.SourceClassType = "AxisAlignedRectangle"; toReturn.InstanceName = rectangle.Name; AddVariablesForAllProperties(rectangle, toReturn); return toReturn; }
internal void Rectangle() { if (ArrowState.Self.CurrentArrowElementSave != null) { TextInputWindow tiw = new TextInputWindow(); tiw.Text = "Enter new Rectangle name:"; tiw.Result = "Rectangle"; var result = tiw.ShowDialog(); if (result.HasValue && result.Value) { bool isInvalid = CheckAndShowMessageIfInvalid(tiw.Result); if (!isInvalid) { AxisAlignedRectangleSave rectangleSave = new AxisAlignedRectangleSave(); rectangleSave.ScaleX = 16; rectangleSave.ScaleY = 16; rectangleSave.Name = tiw.Result; ArrowState.Self.CurrentArrowElementSave.Rectangles.Add(rectangleSave); AfterAddLogic(ArrowState.Self.CurrentArrowElementSave, rectangleSave); } } } }