Ejemplo n.º 1
0
        public override void OnInitialize()
        {
            voidBarUI        = new DragableUIPanel();
            voidBarUI.HAlign = 0.9f;
            voidBarUI.VAlign = 0.9f;
            voidBarUI.Width.Set(66f * 1.5f, 0f);
            voidBarUI.Height.Set(60f * 1.5f, 0f);
            voidBarUI.BackgroundColor = new Color(0, 0, 0, 0);
            voidBarUI.BorderColor     = new Color(0, 0, 0, 0);

            voidText        = new UIText("");
            voidText.HAlign = 0.5f;
            voidText.VAlign = 1.4f;
            voidText.Width.Set(22f, 0f);
            voidText.Height.Set(22f, 0f);
            voidBarUI.Append(voidText);

            Append(voidBarUI);
        }
Ejemplo n.º 2
0
        public override void OnInitialize()
        {
            HamonBar = new DragableUIPanel();
            HamonBar.Left.Set(MyPlayer.HamonBarPositionX * (Main.screenWidth * 0.01f), 0f);
            HamonBar.Top.Set(MyPlayer.HamonBarPositionY * (Main.screenHeight * 0.01f), 0f);
            HamonBar.Width.Set(140f, 0f);
            HamonBar.Height.Set(96f, 0f);
            HamonBar.BackgroundColor = new Color(0, 0, 0, 0);       //make it invisible so that the image is there itself
            HamonBar.BorderColor     = new Color(0, 0, 0, 0);

            hamonDisplay = new UIText(0 + "/" + 0);
            hamonDisplay.Left.Set(70f, 0f);
            hamonDisplay.Top.Set(150f, 0f);
            hamonDisplay.Width.Set(22f, 0f);
            hamonDisplay.Height.Set(22f, 0f);
            HamonBar.Append(hamonDisplay);

            Append(HamonBar);
            base.OnInitialize();
        }
Ejemplo n.º 3
0
        public override void OnInitialize()
        {
            GSpinMeter        = new DragableUIPanel();
            GSpinMeter.HAlign = 0.9f;
            GSpinMeter.VAlign = 0.9f;
            GSpinMeter.Width.Set(140f, 0f);
            GSpinMeter.Height.Set(96f, 0f);
            GSpinMeter.BackgroundColor = new Color(0, 0, 0, 0);
            GSpinMeter.BorderColor     = new Color(0, 0, 0, 0);

            spinAmountText        = new UIText("");
            spinAmountText.HAlign = 0.5f;
            spinAmountText.VAlign = 1.4f;
            spinAmountText.Width.Set(22f, 0f);
            spinAmountText.Height.Set(22f, 0f);
            GSpinMeter.Append(spinAmountText);

            Append(GSpinMeter);
            base.OnInitialize();
        }
Ejemplo n.º 4
0
        public override void OnInitialize()
        {
            aerosmithRadarUI = new DragableUIPanel();
            aerosmithRadarUI.Left.Set(800f, 0f);
            aerosmithRadarUI.Top.Set(510f, 0f);
            aerosmithRadarUI.Width.Set(150f, 0f);
            aerosmithRadarUI.Height.Set(150f, 0f);
            aerosmithRadarUI.BackgroundColor = new Color(0, 0, 0, 0);
            aerosmithRadarUI.BorderColor     = new Color(0, 0, 0, 0);

            centerDot = new UIImage(ModContent.GetTexture("JoJoStands/UI/GreenDot"));
            centerDot.Left.Set(58f, 0f);
            centerDot.Top.Set(62f, 0f);
            centerDot.Width.Set(10f, 0f);
            centerDot.Height.Set(10f, 0f);
            aerosmithRadarUI.Append(centerDot);

            Append(aerosmithRadarUI);
            base.OnInitialize();
        }
Ejemplo n.º 5
0
        public override void OnInitialize()
        {
            UnitsUIPanel        = new DragableUIPanel();
            UnitsUIPanel.HAlign = 0.9f;
            UnitsUIPanel.VAlign = 0.9f;
            UnitsUIPanel.Width.Set(180f, 0f);
            UnitsUIPanel.Height.Set(180f, 0f);

            unitsLeftText = new UIText("Units Left: ");
            unitsLeftText.Top.Set(0f, 0f);
            unitsLeftText.Left.Set(20f, 0f);
            unitsLeftText.Width.Set(40f, 0f);
            unitsLeftText.Height.Set(20f, 0f);
            UnitsUIPanel.Append(unitsLeftText);

            Texture2D soldierTextureImage = ModContent.GetTexture("JoJoStands/Projectiles/PlayerStands/BadCompany/BadCompanySoldier_Prone");

            soldierTexture        = new UIImage(soldierTextureImage);
            soldierTexture.HAlign = 0.1f;
            soldierTexture.VAlign = 0.5f;
            soldierTexture.Width.Set(soldierTextureImage.Width, 0f);
            soldierTexture.Height.Set(soldierTextureImage.Height, 0f);
            UnitsUIPanel.Append(soldierTexture);

            soldiersActiveText        = new UIText("0");
            soldiersActiveText.HAlign = soldierTexture.HAlign;
            soldiersActiveText.VAlign = soldierTexture.VAlign + textDistanceFromTexture;
            soldiersActiveText.Width.Set(20f, 0f);
            soldiersActiveText.Height.Set(20f, 0f);
            UnitsUIPanel.Append(soldiersActiveText);

            Texture2D leftButtonTexture = ModContent.GetTexture("JoJoStands/Extras/LeftArrow");

            subtractSoldierButton        = new UIImageButton(leftButtonTexture);
            subtractSoldierButton.HAlign = soldiersActiveText.HAlign - buttonPadding;
            subtractSoldierButton.VAlign = soldiersActiveText.VAlign;
            subtractSoldierButton.Width.Set(leftButtonTexture.Width, 0f);
            subtractSoldierButton.Height.Set(leftButtonTexture.Height, 0f);
            subtractSoldierButton.OnClick += OnClickSubtractSoldierButton;
            UnitsUIPanel.Append(subtractSoldierButton);

            Texture2D rightButtonTexture = ModContent.GetTexture("JoJoStands/Extras/RightArrow");

            addSoldierButton        = new UIImageButton(rightButtonTexture);
            addSoldierButton.HAlign = soldiersActiveText.HAlign + buttonPadding;
            addSoldierButton.VAlign = soldiersActiveText.VAlign;
            addSoldierButton.Width.Set(rightButtonTexture.Width, 0f);
            addSoldierButton.Height.Set(rightButtonTexture.Height, 0f);
            addSoldierButton.OnClick += OnClickAddSoldierButton;
            UnitsUIPanel.Append(addSoldierButton);

            Texture2D tankTextureImage = ModContent.GetTexture("JoJoStands/Projectiles/PlayerStands/BadCompany/BadCompanyTank");

            tankTexture        = new UIImage(tankTextureImage);
            tankTexture.HAlign = 0.5f;
            tankTexture.VAlign = 0.5f;
            tankTexture.Width.Set(tankTextureImage.Width, 0f);
            tankTexture.Height.Set(tankTextureImage.Height, 0f);
            UnitsUIPanel.Append(tankTexture);

            tanksActiveText        = new UIText("0");
            tanksActiveText.HAlign = tankTexture.HAlign;
            tanksActiveText.VAlign = tankTexture.VAlign + textDistanceFromTexture;
            tanksActiveText.Width.Set(20f, 0f);
            tanksActiveText.Height.Set(20f, 0f);
            UnitsUIPanel.Append(tanksActiveText);

            subtractTankButton        = new UIImageButton(leftButtonTexture);
            subtractTankButton.HAlign = tanksActiveText.HAlign - buttonPadding;
            subtractTankButton.VAlign = tanksActiveText.VAlign;
            subtractTankButton.Width.Set(leftButtonTexture.Width, 0f);
            subtractTankButton.Height.Set(leftButtonTexture.Height, 0f);
            subtractTankButton.OnClick += OnClickSubtractTankButton;
            UnitsUIPanel.Append(subtractTankButton);

            addTankButton        = new UIImageButton(rightButtonTexture);
            addTankButton.HAlign = tanksActiveText.HAlign + buttonPadding;
            addTankButton.VAlign = tanksActiveText.VAlign;
            addTankButton.Width.Set(rightButtonTexture.Width, 0f);
            addTankButton.Height.Set(rightButtonTexture.Height, 0f);
            addTankButton.OnClick += OnClickAddTankButton;
            UnitsUIPanel.Append(addTankButton);

            Texture2D chopperTextureImage = ModContent.GetTexture("JoJoStands/Extras/UnitsUIChopper");

            chopperTexture        = new UIImage(chopperTextureImage);
            chopperTexture.HAlign = 0.9f;
            chopperTexture.VAlign = 0.5f;
            chopperTexture.Width.Set(chopperTextureImage.Width, 0f);
            chopperTexture.Height.Set(chopperTextureImage.Height, 0f);
            UnitsUIPanel.Append(chopperTexture);

            choppersActiveText        = new UIText("0");
            choppersActiveText.HAlign = chopperTexture.HAlign;
            choppersActiveText.VAlign = chopperTexture.VAlign + textDistanceFromTexture;
            choppersActiveText.Width.Set(20f, 0f);
            choppersActiveText.Height.Set(20f, 0f);
            UnitsUIPanel.Append(choppersActiveText);

            subtractChopperButton        = new UIImageButton(leftButtonTexture);
            subtractChopperButton.HAlign = choppersActiveText.HAlign - buttonPadding;
            subtractChopperButton.VAlign = choppersActiveText.VAlign;
            subtractChopperButton.Width.Set(leftButtonTexture.Width, 0f);
            subtractChopperButton.Height.Set(leftButtonTexture.Height, 0f);
            subtractChopperButton.OnClick += OnClickSubtractChopperButton;
            UnitsUIPanel.Append(subtractChopperButton);

            addChopperButton        = new UIImageButton(rightButtonTexture);
            addChopperButton.HAlign = choppersActiveText.HAlign + buttonPadding;
            addChopperButton.VAlign = choppersActiveText.VAlign;
            addChopperButton.Width.Set(rightButtonTexture.Width, 0f);
            addChopperButton.Height.Set(rightButtonTexture.Height, 0f);
            addChopperButton.OnClick += OnClickAddChopperButton;
            UnitsUIPanel.Append(addChopperButton);

            Append(UnitsUIPanel);
        }
Ejemplo n.º 6
0
        public override void OnInitialize()
        {
            Texture2D UpArrow     = ModContent.GetTexture("JoJoStands/Extras/UpArrow");
            Texture2D DownArrow   = ModContent.GetTexture("JoJoStands/Extras/DownArrow");
            Texture2D playTexture = ModContent.GetTexture("Terraria/UI/ButtonPlay");

            Bet        = new DragableUIPanel();
            Bet.HAlign = 0.5f;
            Bet.VAlign = 0.5f;
            Bet.Width.Set(470f, 0f);
            Bet.Height.Set(300f, 0f);

            playArea = new UIPanel();
            //playArea.HAlign = 0.8f;
            //playArea.VAlign = 0.5f;
            playArea.Top.Set(10f, 0f);
            playArea.Left.Set(245f, 0f);
            playArea.Width.Set(200f, 0f);
            playArea.Height.Set(260f, 0f);
            Bet.Append(playArea);

            UIImageButton betButton = new UIImageButton(playTexture);

            betButton.Top.Set(260f, 0f);
            betButton.Left.Set(30f, 0f);
            betButton.Width.Set(22f, 0f);
            betButton.Height.Set(22f, 0f);
            betButton.OnClick += new MouseEvent(BetButtonClicked);
            Bet.Append(betButton);

            Texture2D     closeTexture = ModContent.GetTexture("Terraria/UI/ButtonDelete");
            UIImageButton closeButton  = new UIImageButton(closeTexture);

            closeButton.Top.Set(0f, 0f);
            closeButton.Left.Set(0f, 0f);
            closeButton.Width.Set(22f, 0f);
            closeButton.Height.Set(22f, 0f);
            closeButton.OnClick += new MouseEvent(CloseButtonClicked);
            Bet.Append(closeButton);

            UIImageButton pCoinButton = new UIImageButton(UpArrow);

            pCoinButton.Top.Set(104f, 0f);
            pCoinButton.Left.Set(5f, 0f);
            pCoinButton.Width.Set(22f, 0f);
            pCoinButton.Height.Set(14f, 0f);
            pCoinButton.OnClick += new MouseEvent(PlatinumCoinButtonClicked);
            Bet.Append(pCoinButton);

            UIImageButton nPCoinButton = new UIImageButton(DownArrow);

            nPCoinButton.Top.Set(116f, 0f);
            nPCoinButton.Left.Set(5f, 0f);
            nPCoinButton.Width.Set(22f, 0f);
            nPCoinButton.Height.Set(14f, 0f);
            nPCoinButton.OnClick += new MouseEvent(NPlatinumCoinButtonClicked);
            Bet.Append(nPCoinButton);

            UIImageButton gCoinButton = new UIImageButton(UpArrow);

            gCoinButton.Top.Set(54f, 0f);
            gCoinButton.Left.Set(5f, 0f);
            gCoinButton.Width.Set(22f, 0f);
            gCoinButton.Height.Set(14f, 0f);
            gCoinButton.OnClick += new MouseEvent(GoldCoinButtonClicked);
            Bet.Append(gCoinButton);

            UIImageButton nGCoinButton = new UIImageButton(DownArrow);

            nGCoinButton.Top.Set(66f, 0f);
            nGCoinButton.Left.Set(5f, 0f);
            nGCoinButton.Width.Set(22f, 0f);
            nGCoinButton.Height.Set(14f, 0f);
            nGCoinButton.OnClick += new MouseEvent(NGoldCoinButtonClicked);
            Bet.Append(nGCoinButton);

            UIImageButton accuseButton = new UIImageButton(playTexture);

            accuseButton.Top.Set(150f, 0f);
            accuseButton.Left.Set(210f, 0f);
            accuseButton.Width.Set(playTexture.Width, 0f);
            accuseButton.Height.Set(playTexture.Height, 0f);
            accuseButton.OnClick += new MouseEvent(AccuseButtonClicked);
            Bet.Append(accuseButton);


            UIText GambleText = new UIText("Gamble");

            GambleText.Top.Set(265f, 0f);
            GambleText.Left.Set(60f, 0f);
            Bet.Append(GambleText);

            pCoinText = new UIText("0");
            pCoinText.Top.Set(110f, 0f);
            pCoinText.Left.Set(30f, 0f);
            Bet.Append(pCoinText);

            gCoinText = new UIText("0");
            gCoinText.Top.Set(60f, 0f);
            gCoinText.Left.Set(30f, 0f);
            Bet.Append(gCoinText);

            UIText AccuseText = new UIText("Accuse of Cheating");

            AccuseText.Top.Set(150f, 0f);
            AccuseText.Left.Set(50f, 0f);
            Bet.Append(AccuseText);

            Append(Bet);
            base.OnInitialize();
        }