Example #1
0
    // Use this for initialization
    public EquipmentUI()
    {
        uiPos = new EquipmentUIPosition();
        //texPos = new EquipmentTexturePosition();


        arenaMenuMaterial = UIResourceMgr.GetInstance().GetMaterial("ArenaMenu");
        background        = new UIImage();
        background.SetTexture(arenaMenuMaterial, ArenaMenuTexturePosition.Background);
        background.Rect = AutoRect.AutoPos(uiPos.Background);

        /*
         * titleImage = new UIImage();
         * titleImage.SetTexture(weaponUpgradeMaterial, WeaponUpgradeTexturePosition.TitleImage);
         * titleImage.Rect = uiPos.TitleImage;
         */

        returnButton = new UIClickButton();
        returnButton.SetTexture(UIButtonBase.State.Normal, arenaMenuMaterial,

                                ArenaMenuTexturePosition.ReturnButtonNormal, AutoRect.AutoSize(ArenaMenuTexturePosition.ReturnButtonNormal));
        returnButton.SetTexture(UIButtonBase.State.Pressed, arenaMenuMaterial,

                                ArenaMenuTexturePosition.ReturnButtonPressed, AutoRect.AutoSize(ArenaMenuTexturePosition.ReturnButtonPressed));
        returnButton.Rect = AutoRect.AutoPos(uiPos.ReturnButton);



        selectionImage = new UIImage();


        /*
         * weaponInfoText = new UIText();
         * weaponInfoText.Set(ConstData.FONT_NAME2, "", ColorName.fontColor_darkorange);
         * weaponInfoText.Rect = uiPos.WeaponInfoText;
         */



        this.Add(background);
        //this.Add(titleImage);

        this.Add(returnButton);
        //this.Add(weaponInfoText);


        uiInited = true;

        Init();
        selectionImage.Enable = false;
        this.Add(selectionImage);
        //weaponInfoText.Set(ConstData.FONT_NAME2, weaponList[0].Info, ColorName.fontColor_darkorange);
        UpdateWeaponInfo();

        SetUIHandler(this);

        Hide();
    }
Example #2
0
    public WeaponInfoPanel()
    {
        EquipmentUIPosition uiPos          = new EquipmentUIPosition();
        Material            dialogMaterial = UIResourceMgr.GetInstance().GetMaterial("Dialog");

        background = new UIImage();
        background.SetTexture(dialogMaterial, DialogTexturePosition.TextBox, AutoRect.AutoSize(DialogTexturePosition.TextBox));
        background.Rect   = AutoRect.AutoPos(uiPos.WeaponInfoPanel);
        background.Enable = false;
        Add(background);


        Material buttonsMaterial = UIResourceMgr.GetInstance().GetMaterial("Buttons");

        bulletLogo = new UIImage();
        Rect brect = ButtonsTexturePosition.GetBulletsLogoRect(1);

        bulletLogo.SetTexture(buttonsMaterial, brect, AutoRect.AutoSize(brect));
        bulletLogo.Rect    = AutoRect.AutoPos(new Rect(uiPos.WeaponInfoPanel.x + 250, uiPos.WeaponInfoPanel.y + 48, 44, 52));
        bulletLogo.Visible = false;
        bulletLogo.Enable  = false;
        Add(bulletLogo);


        infoText = new UIText();
        infoText.Set(ConstData.FONT_NAME3, "", ColorName.fontColor_darkorange);

        infoText.Rect = AutoRect.AutoPos(new Rect(uiPos.WeaponInfoPanel.x + 50, uiPos.WeaponInfoPanel.y, uiPos.WeaponInfoPanel.width, uiPos.WeaponInfoPanel.height - 40));



        Add(infoText);

        bulletText = new UIText();
        bulletText.Set(ConstData.FONT_NAME3, "", ColorName.fontColor_darkorange);
        bulletText.AlignStyle = UIText.enAlignStyle.left;
        bulletText.Rect       = AutoRect.AutoPos(new Rect(uiPos.WeaponInfoPanel.x + 300, uiPos.WeaponInfoPanel.y - 62, 144, 152));

        Add(bulletText);
    }