Beispiel #1
0
        void InitializeUI()
        {
            SpeedMeter.AttachTo(Camera.Main);
            SpeedMeter.RelativeZ = -40; // so that it's "in front" of the camera
            SpeedMeter.RelativeX = Camera.Main.OrthogonalWidth / 2.0f - (32 + SpeedMeter.mSpriteInstance.Width / 2);
            SpeedMeter.RelativeY = -(Camera.Main.OrthogonalHeight / 2.0f - (32 + SpeedMeter.mSpriteInstance.Height / 2));

            SpeedMeter.SetCaseScale(5, -1, 3, 0);
            SpeedMeter.SetState(PlayerBoat.SpeedScale);


            ButtonPistolClick += (x) =>
            {
                PlayerInstance.EquipItem(Weapon.ExistingWeapons.First(w => w.ItemName == "Pistol"));
            };
            ButtonShotgunClick += (x) =>
            {
                PlayerInstance.AddItemToInventory(Item.ExistingItems.First(y => y.ItemName == "Pistol"));
                PlayerInstance.AddItemToInventory(Item.ExistingItems.First(y => y.ItemName == "Sword"));
            };

            FlatRedBallServices.IsWindowsCursorVisible = true;

            (InventoryGui.GetGraphicalUiElementByName("TextPlayerName") as GumRuntimes.TextRuntime).Text = PlayerInstance.PlayerName;

            InventoryGui.PlaceCasesInInventoryPanel(PlayerInstance.PlayerInventory.Length, 8);

            InventoryGui.OnItemMovedCase += InventoryGuiOnItemMoved;

            foreach (var box in InventoryBar.GetInventoryBoxList())
            {
                box.Click += InventoryBarOnBoxClicked;
            }
        }