public static AxisAlignedCubeSave FromAxisAlignedCube(FlatRedBall.Math.Geometry.AxisAlignedCube cube) { AxisAlignedCubeSave aacs = new AxisAlignedCubeSave(); aacs.X = cube.X; aacs.Y = cube.Y; aacs.Z = cube.Z; aacs.ScaleX = cube.ScaleX; aacs.ScaleY = cube.ScaleY; aacs.ScaleZ = cube.ScaleZ; aacs.Name = cube.Name; if (cube.Parent != null) { aacs.Parent = cube.Parent.Name; } aacs.Alpha = cube.Color.A / 255.0f; aacs.Red = cube.Color.R / 255.0f; aacs.Green = cube.Color.G / 255.0f; aacs.Blue = cube.Color.B / 255.0f; return aacs; }
public static void LoadEmittersClick(FlatRedBall.Gui.Window callingWindow) { FileWindow tempWindow = GuiManager.AddFileWindow(); tempWindow.Filter = "XML Emitter (*.emix)|*.emix"; tempWindow.CurrentFileType = "emix"; tempWindow.OkClick += new GuiMessage(LoadEmitterOK); }
public static void LoadEmitterOK(FlatRedBall.Gui.Window callingWindow) { string fileName = ((FileWindow)callingWindow).Results[0]; AppCommands.Self.File.LoadEmitters(fileName); }
public virtual void AddToManagers (FlatRedBall.Graphics.Layer layerToAddTo) { LayerProvidedByContainer = layerToAddTo; FlatRedBall.SpriteManager.AddPositionedObject(this); AddToManagersBottomUp(layerToAddTo); CustomInitialize(); }
void OnSoundEffectCheckBoxClick(FlatRedBall.Gui.IWindow callingWindow) { if(this.SoundEffectCheckBox.CurrentState == CheckBox.VariableState.Checked) { } }
// 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 static CircleSave FromCircle(FlatRedBall.Math.Geometry.Circle circle) { CircleSave circleSave = new CircleSave(); circleSave.SetFrom(circle); return circleSave; }
public static PolygonSave FromPolygon(FlatRedBall.Math.Geometry.Polygon polygon) { PolygonSave polygonSave = new PolygonSave(); int pointCount = polygon.Points.Count; polygonSave.Points = new Point[pointCount]; for (int i = 0; i < polygon.Points.Count; i++) { polygonSave.Points[i] = polygon.Points[i]; } polygonSave.Name = polygon.Name; polygonSave.X = polygon.Position.X; polygonSave.Y = polygon.Position.Y; polygonSave.Z = polygon.Position.Z; polygonSave.RotationZ = polygon.RotationZ; polygonSave.Alpha = polygon.Color.A / 255.0f; polygonSave.Red = polygon.Color.R / 255.0f; polygonSave.Green = polygon.Color.G / 255.0f; polygonSave.Blue = polygon.Color.B / 255.0f; return polygonSave; }
void OnNextQuestionClickTunnel(FlatRedBall.Gui.IWindow callingWindow) { if (this.NextQuestionClick != null) { NextQuestionClick(callingWindow); } }
private void emitAllClick(FlatRedBall.Gui.Window callingWindow) { foreach (Emitter emitter in EditorData.Emitters) { emitter.Emit(); } }
private void emitCurrentClick(FlatRedBall.Gui.Window callingWindow) { if (AppState.Self.CurrentEmitter != null) { AppState.Self.CurrentEmitter.Emit(null); } }
void OnXboxAButtonRollOn(FlatRedBall.Gui.IWindow callingWindow) { if (canRollOver) { AButtonInst.RotationZ = 1; } }
// Generated AddToManagers public virtual void ReAddToManagers (FlatRedBall.Graphics.Layer layerToAddTo) { LayerProvidedByContainer = layerToAddTo; FlatRedBall.SpriteManager.AddPositionedObject(this); FlatRedBall.SpriteManager.AddToLayer(Sprite, LayerProvidedByContainer); FlatRedBall.Math.Geometry.ShapeManager.AddToLayer(Cuerpo, LayerProvidedByContainer); }
public override void AddToManagers (FlatRedBall.Graphics.Layer layerToAddTo) { LayerProvidedByContainer = layerToAddTo; FlatRedBall.SpriteManager.AddToLayer(Sprite, LayerProvidedByContainer); FlatRedBall.Math.Geometry.ShapeManager.AddToLayer(Cuerpo, LayerProvidedByContainer); base.AddToManagers(layerToAddTo); CustomInitialize(); }
public static bool IsGue(FlatRedBall.Glue.SaveClasses.NamedObjectSave item) { return item.SourceType == FlatRedBall.Glue.SaveClasses.SourceType.File && !string.IsNullOrEmpty(item.SourceFile) && !string.IsNullOrEmpty(item.SourceName) && (FileManager.GetExtension(item.SourceFile) == "gusx" || FileManager.GetExtension(item.SourceFile) == "gucx"); }
public void addEmitterClick(FlatRedBall.Gui.Window callingWindow) { TextInputWindow tempWindow = GuiManager.ShowTextInputWindow("Enter a name for the new Emitter", "Add Particle"); tempWindow.Text = "Emitter" + NumberOfEmittersCreated; NumberOfEmittersCreated++; tempWindow.OkClick += new GuiMessage(addEmitterOkClick); }
public override ICodeBlock GenerateActivity(ICodeBlock codeBlock, FlatRedBall.Glue.SaveClasses.IElement element) { if (Active) { codeBlock.Line("TimeManager.SumTimeSection(\"Throwaway\");"); } return codeBlock; }
public override ICodeBlock GenerateAddToManagers(ICodeBlock codeBlock, FlatRedBall.Glue.SaveClasses.IElement element) { //foreach (var namedObject in element.AllNamedObjects.Where(item => IsGue(item))) //{ // //FlatRedBall.Gui.GuiManager.AddWindow(mNarrowButtonIWindow); // codeBlock.Line("FlatRedBall.Gui.GuiManager.AddWindow(" + GetWrapperNameFor(namedObject) + ");"); //} return base.GenerateAddToManagers(codeBlock, element); }
static void OnElementRemoved(FlatRedBall.Glue.SaveClasses.IElement obj) { if (obj != null) { mElementSettingsSave.SetElementCameraSave(obj, SpriteManager.Camera); mElementSettingsSave.Save(ElementSettingsSaveFileName); GlueViewState.Self.CurrentElement = null; } }
void OnXBoxAButtonRollOff(FlatRedBall.Gui.IWindow callingWindow) { if (canRollOver) { AButtonInst.RotationZ = 0; AButtonInst.RotationX = 0; AButtonInst.RotationY = 0; } }
public override ICodeBlock GenerateFields(ICodeBlock codeBlock, FlatRedBall.Glue.SaveClasses.IElement element) { //foreach (var namedObject in element.AllNamedObjects.Where(item => IsGue(item) && // NamedObjectSaveCodeGenerator.GetFieldCodeGenerationType(item) == CodeGenerationType.Full)) //{ // codeBlock.Line("FlatRedBall.Gum.GueIWindowWrapper " + GetWrapperNameFor(namedObject) + ";"); //} return codeBlock; }
public static LinkSave FromLink(FlatRedBall.AI.Pathfinding.Link link) { LinkSave linkSave = new LinkSave(); linkSave.Cost = link.Cost; linkSave.NodeLinkingTo = link.NodeLinkingTo.Name; return linkSave; }
public List<InstructionSet> ToInstructionSetList(FlatRedBall.Scene scene) { List<InstructionSet> instructionSetList = new List<InstructionSet>(InstructionSetSaves.Count); foreach (InstructionSetSave instructionSetSave in InstructionSetSaves) { instructionSetList.Add(instructionSetSave.ToInstructionSet(scene)); } return instructionSetList; }
public override ICodeBlock GenerateActivity(ICodeBlock codeBlock, FlatRedBall.Glue.SaveClasses.IElement element) { if (element.SupportsAdvancedInterpolation()) { foreach (var enumName in element.GetStateEnumNames()) { codeBlock.Line(TweenerNameFor(enumName) + ".Update(FlatRedBall.TimeManager.SecondDifference);"); } } return codeBlock; }
private void AddFileToFoundFiles(FlatRedBall.Glue.VSHelpers.Projects.ProjectBase project, string fileName, string absoluteFileName) { mFoundFiles.Add(new FileData { ProjectType = project.FolderName, FileName = fileName, ProjectFile = absoluteFileName, ServerFile = _url + fileName, DiskFile = _savePath + @"\" + fileName, TimestampFile = _savePath + @"\" + FileManager.RemovePath(fileName) + "-timestamp.txt" }); }
public NamedObjectSave SpriteSaveToNamedObjectSave(FlatRedBall.Content.Scene.SpriteSave sprite) { NamedObjectSave toReturn = new NamedObjectSave(); toReturn.SourceType = SourceType.FlatRedBallType; toReturn.SourceClassType = "Sprite"; toReturn.InstanceName = sprite.Name; AddVariablesForAllProperties(sprite, toReturn); return toReturn; }
void OnClick(FlatRedBall.Gui.IWindow callingWindow) { //checks what state the checkbox is in and changes it on click if(this.CurrentState == CheckBox.VariableState.Checked) { this.CurrentState = CheckBox.VariableState.Unchecked; } else { this.CurrentState = CheckBox.VariableState.Checked; } }
private void CheckTrashCollision(Orbit1 orbit1Instance, FlatRedBall.Math.PositionedObjectList<Trash> trashList, int p) { var trashLockoutFromSpace = new List<Trash>(); foreach (var trash in trashList.Where(t => !t.Attached)) { //Check if trash hit other trash foreach (var otherTrash in trashList) { //Ignore trashes on the planet if (otherTrash == trash || otherTrash.OnConveyor) { continue; } if (trash.CollisionCircle.CollideAgainstBounce(otherTrash.CollisionCircle, 10F, 0.1F, 0)) { //trash.AttachTo(null, false); //otherTrash.AttachTo(null, false); trash.Detach(); otherTrash.Detach(); //trash fly to space return; } } //Only allow attach once if (!trash.Attached && trash.CollisionCircle.CollideAgainstBounce(Orbit1Instance.Circle, 0, 100, 2)) { trash.AttachTo(Orbit1Instance, true); trash.Attached = true; } int halfScreenWidth = FlatRedBallServices.ClientWidth/2; int halfScreenHeight = FlatRedBallServices.ClientHeight/2; if (!trash.OnConveyor && (trash.X > halfScreenWidth || trash.X < -halfScreenWidth || trash.Y > halfScreenHeight || trash.Y < -halfScreenHeight)) { trashLockoutFromSpace.Add(trash); } } //Remove the trash from game foreach (var trash in trashLockoutFromSpace) { trashList.Remove(trash); trash.RemoveSelfFromListsBelongingTo(); trash.Destroy(); } }
public static NodeNetworkSave FromNodeNetwork(FlatRedBall.AI.Pathfinding.NodeNetwork nodeNetwork) { NodeNetworkSave nodeNetworkSave = new NodeNetworkSave(); foreach (FlatRedBall.AI.Pathfinding.PositionedNode positionedNode in nodeNetwork.Nodes) { nodeNetworkSave.PositionedNodes.Add( PositionedNodeSave.FromPositionedNode(positionedNode)); } return nodeNetworkSave; }
public override ICodeBlock GenerateAdditionalMethods(ICodeBlock codeBlock, FlatRedBall.Glue.SaveClasses.IElement element) { if (element.SupportsAdvancedInterpolation()) { foreach (var enumName in element.GetStateEnumNames()) { codeBlock = GenerateInterpolateToStateAdvanced(codeBlock, enumName); } } return codeBlock; }