Beispiel #1
0
        public override void Initialize(bool addToManagers)
        {
            LoadStaticContent(ContentManagerName);
            ButtonPlay             = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonPlay") as Pirates.GumRuntimes.ButtonRuntime;
            ButtonSettings         = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonSettings") as Pirates.GumRuntimes.ButtonRuntime;
            ButtonQuit             = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonQuit") as Pirates.GumRuntimes.ButtonRuntime;
            ButtonBack             = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonBack") as Pirates.GumRuntimes.ButtonRuntime;
            MainContainer          = MainMenuScreenGum.GetGraphicalUiElementByName("MainContainer") as Pirates.GumRuntimes.ContainerRuntime;
            SettingsContainer      = MainMenuScreenGum.GetGraphicalUiElementByName("SettingsContainer") as Pirates.GumRuntimes.ContainerRuntime;
            SliderVolume           = MainMenuScreenGum.GetGraphicalUiElementByName("SliderVolume") as Pirates.GumRuntimes.DefaultForms.SliderRuntime;
            TextVolumeLevel        = MainMenuScreenGum.GetGraphicalUiElementByName("TextVolumeLevel") as Pirates.GumRuntimes.TextRuntime;
            ButtonSwitchFullscreen = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonSwitchFullscreen") as Pirates.GumRuntimes.ButtonRuntime;
            ButtonApply            = MainMenuScreenGum.GetGraphicalUiElementByName("ButtonApply") as Pirates.GumRuntimes.ButtonRuntime;


            PostInitialize();
            base.Initialize(addToManagers);
            if (addToManagers)
            {
                AddToManagers();
            }
        }
Beispiel #2
0
        public override void Initialize(bool addToManagers)
        {
            LoadStaticContent(ContentManagerName);
            PlayerBoat          = new Pirates.Entities.Boat(ContentManagerName, false);
            PlayerBoat.Name     = "PlayerBoat";
            BoatList            = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Boat>();
            BoatList.Name       = "BoatList";
            DockList            = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Dock>();
            DockList.Name       = "DockList";
            PlayerInstance      = new Pirates.Entities.Player(ContentManagerName, false);
            PlayerInstance.Name = "PlayerInstance";
            UIBoatLayer         = new FlatRedBall.Graphics.Layer();
            UIBoatLayer.Name    = "UIBoatLayer";
            SandCollision       = new FlatRedBall.TileCollisions.TileShapeCollection();
            SandCollision.Name  = "SandCollision";
            WaterCollision      = new FlatRedBall.TileCollisions.TileShapeCollection();
            WaterCollision.Name = "WaterCollision";
            DirtCollision       = new FlatRedBall.TileCollisions.TileShapeCollection();
            DirtCollision.Name  = "DirtCollision";
            HulkCollision       = new FlatRedBall.TileCollisions.TileShapeCollection();
            HulkCollision.Name  = "HulkCollision";
            RockCollision       = new FlatRedBall.TileCollisions.TileShapeCollection();
            RockCollision.Name  = "RockCollision";
            CannonballList      = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Cannonball>();
            CannonballList.Name = "CannonballList";
            SpeedMeter          = new Pirates.Entities.UI.SpeedMeter(ContentManagerName, false);
            SpeedMeter.Name     = "SpeedMeter";
            ExplosionList       = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Animations.Explosion>();
            ExplosionList.Name  = "ExplosionList";
            ButtonPistol        = GameScreenGum.GetGraphicalUiElementByName("ButtonPistol") as Pirates.GumRuntimes.ButtonRuntime;
            ButtonShotgun       = GameScreenGum.GetGraphicalUiElementByName("ButtonShotgun") as Pirates.GumRuntimes.ButtonRuntime;
            BulletList          = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Bullet>();
            BulletList.Name     = "BulletList";
            EnemyList           = new FlatRedBall.Math.PositionedObjectList <Pirates.Entities.Skeleton>();
            EnemyList.Name      = "EnemyList";
            InventoryBar        = GameScreenGum.GetGraphicalUiElementByName("InventoryBarInstance") as Pirates.GumRuntimes.InventoryForms.InventoryBarRuntime;
            InventoryGui        = GameScreenGum.GetGraphicalUiElementByName("InventoryGui") as Pirates.GumRuntimes.InventoryForms.InventoryGuiRuntime;
            // normally we wait to set variables until after the object is created, but in this case if the
            // TileShapeCollection doesn't have its Visible set before creating the tiles, it can result in
            // really bad performance issues, as shapes will be made visible, then invisible. Really bad perf!
            SandCollision.Visible = false;
            FlatRedBall.TileCollisions.TileShapeCollectionLayeredTileMapExtensions.AddCollisionFromTilesWithType(SandCollision, Terrain, "Sand");
            // normally we wait to set variables until after the object is created, but in this case if the
            // TileShapeCollection doesn't have its Visible set before creating the tiles, it can result in
            // really bad performance issues, as shapes will be made visible, then invisible. Really bad perf!
            WaterCollision.Visible = false;
            FlatRedBall.TileCollisions.TileShapeCollectionLayeredTileMapExtensions.AddCollisionFromTilesWithType(WaterCollision, Terrain, "Water");
            // normally we wait to set variables until after the object is created, but in this case if the
            // TileShapeCollection doesn't have its Visible set before creating the tiles, it can result in
            // really bad performance issues, as shapes will be made visible, then invisible. Really bad perf!
            DirtCollision.Visible = false;
            FlatRedBall.TileCollisions.TileShapeCollectionLayeredTileMapExtensions.AddCollisionFromTilesWithType(DirtCollision, Terrain, "Dirt");
            // normally we wait to set variables until after the object is created, but in this case if the
            // TileShapeCollection doesn't have its Visible set before creating the tiles, it can result in
            // really bad performance issues, as shapes will be made visible, then invisible. Really bad perf!
            HulkCollision.Visible = false;
            FlatRedBall.TileCollisions.TileShapeCollectionLayeredTileMapExtensions.AddCollisionFromTilesWithType(HulkCollision, Terrain, "Hulk");
            // normally we wait to set variables until after the object is created, but in this case if the
            // TileShapeCollection doesn't have its Visible set before creating the tiles, it can result in
            // really bad performance issues, as shapes will be made visible, then invisible. Really bad perf!
            RockCollision.Visible = false;
            FlatRedBall.TileCollisions.TileShapeCollectionLayeredTileMapExtensions.AddCollisionFromTilesWithType(RockCollision, Terrain, "Rock");


            PostInitialize();
            base.Initialize(addToManagers);
            if (addToManagers)
            {
                AddToManagers();
            }
        }
Beispiel #3
0
 private void ReactToVisualChanged()
 {
     ButtonInstance = (FlatRedBall.Forms.Controls.Button)Visual.GetGraphicalUiElementByName("ButtonInstance").FormsControlAsObject;
 }