public static void LoadStaticContent(string contentManagerName) { if (string.IsNullOrEmpty(contentManagerName)) { throw new System.ArgumentException("contentManagerName cannot be empty or null"); } // Set the content manager for Gum var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper(); contentManagerWrapper.ContentManagerName = contentManagerName; RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper; // Access the GumProject just in case it's async loaded var throwaway = GlobalContent.GumProject; #if DEBUG if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager) { HasBeenLoadedWithGlobalContentManager = true; } else if (HasBeenLoadedWithGlobalContentManager) { throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global. This can lead to a lot of bugs"); } #endif TestLevel = FlatRedBall.TileGraphics.LayeredTileMap.FromTiledMapSave("content/screens/gamescreen/levels/testlevel.tmx", contentManagerName); Gum.Wireframe.GraphicalUiElement.IsAllLayoutSuspended = true; GameScreenGum = new FlatRedBall.Gum.GumIdb(); GameScreenGum.LoadFromFile("content/gumproject/screens/gamescreengum.gusx"); GameScreenGum.AssignReferences(); Gum.Wireframe.GraphicalUiElement.IsAllLayoutSuspended = false; GameScreenGum.Element.UpdateLayout(); GameScreenGum.Element.UpdateLayout(); GreasyPlatypusSlapper.Entities.CameraEntity.LoadStaticContent(contentManagerName); CustomLoadStaticContent(contentManagerName); }
public static void LoadStaticContent(string contentManagerName) { if (string.IsNullOrEmpty(contentManagerName)) { throw new System.ArgumentException("contentManagerName cannot be empty or null"); } // Set the content manager for Gum var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper(); contentManagerWrapper.ContentManagerName = contentManagerName; RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper; // Access the GumProject just in case it's async loaded var throwaway = GlobalContent.GumProject; #if DEBUG if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager) { HasBeenLoadedWithGlobalContentManager = true; } else if (HasBeenLoadedWithGlobalContentManager) { throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global. This can lead to a lot of bugs"); } #endif Terrain = FlatRedBall.TileGraphics.LayeredTileMap.FromTiledMapSave("content/screens/gamescreen/terrain.tmx", contentManagerName); FlatRedBall.Gum.GumIdb.UpdateDisplayToMainFrbCamera(); GameScreenGum = GumRuntime.ElementSaveExtensions.CreateGueForElement(Gum.Managers.ObjectFinder.Self.GetScreen(FlatRedBall.IO.FileManager.RemoveExtension(FlatRedBall.IO.FileManager.RemovePath("content/gumproject/screens/gamescreengum.gusx"))), true); Pirates.Entities.Boat.LoadStaticContent(contentManagerName); Pirates.Entities.Player.LoadStaticContent(contentManagerName); Pirates.Entities.UI.SpeedMeter.LoadStaticContent(contentManagerName); CustomLoadStaticContent(contentManagerName); }
public static new void LoadStaticContent(string contentManagerName) { if (string.IsNullOrEmpty(contentManagerName)) { throw new System.ArgumentException("contentManagerName cannot be empty or null"); } Super_Marios_Bros.Screens.GameScreen.LoadStaticContent(contentManagerName); // Set the content manager for Gum var contentManagerWrapper = new FlatRedBall.Gum.ContentManagerWrapper(); contentManagerWrapper.ContentManagerName = contentManagerName; RenderingLibrary.Content.LoaderManager.Self.ContentLoader = contentManagerWrapper; // Access the GumProject just in case it's async loaded var throwaway = GlobalContent.GumProject; #if DEBUG if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager) { HasBeenLoadedWithGlobalContentManager = true; } else if (HasBeenLoadedWithGlobalContentManager) { throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global. This can lead to a lot of bugs"); } #endif tiled = FlatRedBall.TileGraphics.LayeredTileMap.FromTiledMapSave("content/screens/world1level1/tiled.tmx", contentManagerName); tiles = FlatRedBall.FlatRedBallServices.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/screens/world1level1/tiles.png", contentManagerName); CustomLoadStaticContent(contentManagerName); }
public void SetCameraBoundsFromTiledMap(FlatRedBall.TileGraphics.LayeredTileMap mapToSetBoundsFrom) { cameraLeftXBound = mapToSetBoundsFrom.X; cameraRightXBound = mapToSetBoundsFrom.X + mapToSetBoundsFrom.Width; cameraTopYBound = mapToSetBoundsFrom.Y; cameraBottomYBound = mapToSetBoundsFrom.Y - mapToSetBoundsFrom.Height; }
public override void Destroy() { base.Destroy(); tmxFile.Destroy(); tmxFile = null; if (Map != null) { Map.Destroy(); } FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear(); CustomDestroy(); }
public override void Destroy() { base.Destroy(); PlatformerLevel1.Destroy(); PlatformerLevel1 = null; if (PlayerInstance != null) { PlayerInstance.Destroy(); PlayerInstance.Detach(); } CustomDestroy(); }
public override void Destroy() { FlatRedBall.SpriteManager.RemoveDrawableBatch(gumIdb); base.Destroy(); Level2File.Destroy(); Level2File = null; if (Map != null) { Map.Destroy(); } FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear(); CustomDestroy(); }
public static new void LoadStaticContent(string contentManagerName) { if (string.IsNullOrEmpty(contentManagerName)) { throw new System.ArgumentException("contentManagerName cannot be empty or null"); } Soccer.Screens.GameScreen.LoadStaticContent(contentManagerName); #if DEBUG if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager) { HasBeenLoadedWithGlobalContentManager = true; } else if (HasBeenLoadedWithGlobalContentManager) { throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global. This can lead to a lot of bugs"); } #endif tmxFile = FlatRedBall.TileGraphics.LayeredTileMap.FromTiledMapSave("content/screens/gamescreen/tmxfile.tmx", contentManagerName); CustomLoadStaticContent(contentManagerName); }
public override void Destroy() { base.Destroy(); HealthPointFactory.Destroy(); PlatformerLevel1.Destroy(); PlatformerLevel1 = null; PositionedObjectListInstance.MakeOneWay(); if (PlayerInstance != null) { PlayerInstance.Destroy(); PlayerInstance.Detach(); } for (int i = PositionedObjectListInstance.Count - 1; i > -1; i--) { PositionedObjectListInstance[i].Destroy(); } PositionedObjectListInstance.MakeTwoWay(); CustomDestroy(); }
public static void LoadStaticContent(string contentManagerName) { if (string.IsNullOrEmpty(contentManagerName)) { throw new System.ArgumentException("contentManagerName cannot be empty or null"); } #if DEBUG if (contentManagerName == FlatRedBall.FlatRedBallServices.GlobalContentManager) { HasBeenLoadedWithGlobalContentManager = true; } else if (HasBeenLoadedWithGlobalContentManager) { throw new System.Exception("This type has been loaded with a Global content manager, then loaded with a non-global. This can lead to a lot of bugs"); } #endif PlatformerLevel1 = FlatRedBall.TileGraphics.LayeredTileMap.FromTiledMapSave("content/screens/level1/platformerlevel1.tmx", contentManagerName); Platformer.Entities.Player.LoadStaticContent(contentManagerName); CustomLoadStaticContent(contentManagerName); }
public override void Destroy() { base.Destroy(); Factories.TankFactory.Destroy(); Factories.BulletFactory.Destroy(); Factories.TreadEffectFactory.Destroy(); TestLevel.Destroy(); TestLevel = null; FlatRedBall.SpriteManager.RemoveDrawableBatch(GameScreenGum); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= GameScreenGum.HandleResolutionChanged; GameScreenGum = null; TankList.MakeOneWay(); BulletList.MakeOneWay(); TreadEffects.MakeOneWay(); for (int i = TankList.Count - 1; i > -1; i--) { TankList[i].Destroy(); } for (int i = BulletList.Count - 1; i > -1; i--) { BulletList[i].Destroy(); } if (CameraEntityInstance != null) { CameraEntityInstance.Destroy(); CameraEntityInstance.Detach(); } for (int i = TreadEffects.Count - 1; i > -1; i--) { TreadEffects[i].Destroy(); } if (PlayerSelectionUIInstance != null) { PlayerSelectionUIInstance.RemoveFromManagers(); } TankList.MakeTwoWay(); BulletList.MakeTwoWay(); TreadEffects.MakeTwoWay(); FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear(); CustomDestroy(); }
public override void Destroy() { base.Destroy(); tiled.Destroy(); tiled = null; tiles = null; if (Map != null) { Map.Destroy(); } if (SolidCollision != null) { SolidCollision.Visible = false; } if (CloudCollision != null) { CloudCollision.Visible = false; } FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear(); CustomDestroy(); }
public override void Destroy() { base.Destroy(); Factories.DockFactory.Destroy(); Factories.CannonballFactory.Destroy(); Factories.ExplosionFactory.Destroy(); Factories.BulletFactory.Destroy(); Factories.SkeletonFactory.Destroy(); Terrain.Destroy(); Terrain = null; GameScreenGum.RemoveFromManagers(); GameScreenGum = null; BoatList.MakeOneWay(); DockList.MakeOneWay(); CannonballList.MakeOneWay(); ExplosionList.MakeOneWay(); BulletList.MakeOneWay(); EnemyList.MakeOneWay(); if (PlayerBoat != null) { PlayerBoat.Destroy(); PlayerBoat.Detach(); } for (int i = BoatList.Count - 1; i > -1; i--) { BoatList[i].Destroy(); } for (int i = DockList.Count - 1; i > -1; i--) { DockList[i].Destroy(); } if (PlayerInstance != null) { PlayerInstance.Destroy(); PlayerInstance.Detach(); } if (UIBoatLayer != null) { FlatRedBall.SpriteManager.RemoveLayer(UIBoatLayer); } if (SandCollision != null) { SandCollision.Visible = false; } if (WaterCollision != null) { WaterCollision.Visible = false; } if (DirtCollision != null) { DirtCollision.Visible = false; } if (HulkCollision != null) { HulkCollision.Visible = false; } if (RockCollision != null) { RockCollision.Visible = false; } for (int i = CannonballList.Count - 1; i > -1; i--) { CannonballList[i].Destroy(); } if (SpeedMeter != null) { SpeedMeter.Destroy(); SpeedMeter.Detach(); } for (int i = ExplosionList.Count - 1; i > -1; i--) { ExplosionList[i].Destroy(); } if (ButtonPistol != null) { ButtonPistol.RemoveFromManagers(); } if (ButtonShotgun != null) { ButtonShotgun.RemoveFromManagers(); } for (int i = BulletList.Count - 1; i > -1; i--) { BulletList[i].Destroy(); } for (int i = EnemyList.Count - 1; i > -1; i--) { EnemyList[i].Destroy(); } if (InventoryBar != null) { InventoryBar.RemoveFromManagers(); } if (InventoryGui != null) { InventoryGui.RemoveFromManagers(); } BoatList.MakeTwoWay(); DockList.MakeTwoWay(); CannonballList.MakeTwoWay(); ExplosionList.MakeTwoWay(); BulletList.MakeTwoWay(); EnemyList.MakeTwoWay(); FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear(); CustomDestroy(); }