コード例 #1
0
ファイル: FUICard.cs プロジェクト: yzx4036/ET
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GComponent)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                cost_bg    = (GImage)com.GetChildAt(3);
                cost_txt   = (GTextField)com.GetChildAt(4);
                effect_txt = (GRichTextField)com.GetChildAt(5);
                attack_txt = (GTextField)com.GetChildAt(6);
                hp_txt     = (GTextField)com.GetChildAt(7);
                size_bg    = (GImage)com.GetChildAt(8);
                size_txt   = (GTextField)com.GetChildAt(9);
            }
        }
コード例 #2
0
ファイル: SuspendUIController.cs プロジェクト: linxscc/bnyx
 public void Init()
 {
     valueMonitorPool.Clear();
     ui          = gameObject.GetComponent <UIPanel>().ui;
     choiceframe = ui.GetChild("choiceframe").asCom;
     swordchoice = choiceframe.GetChild("swordchoice").asCom;
     choice0     = choiceframe.GetChild("n0").asRichTextField;
     choice1     = choiceframe.GetChild("n1").asRichTextField;
     choice2     = choiceframe.GetChild("n2").asRichTextField;
     choice3     = choiceframe.GetChild("n3").asRichTextField;
     choice4     = choiceframe.GetChild("n4").asRichTextField;
     choicelist.Add(choice0);
     choicelist.Add(choice1);
     choicelist.Add(choice2);
     choicelist.Add(choice3);
     choicelist.Add(choice4);
     choiceframe.visible = false;
     choiceindex         = 0;
     valueMonitorPool.AddMonitor(() =>
     {
         return(choiceindex);
     }, (int from, int to) =>
     {
         FocusIndex(choiceindex);
     });
     alphachoice(0);
 }
コード例 #3
0
ファイル: FUIStoryWin.cs プロジェクト: yzx4036/ET
        public void Awake(GObject go)
        {
            if (go == null)
            {
                return;
            }

            GObject = go;

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = Id.ToString();
            }

            self = (GComponent)go;

            self.Add(this);

            var com = go.asCom;

            if (com != null)
            {
                speakerTxt = (GRichTextField)com.GetChildAt(1);
                btnList    = (GList)com.GetChildAt(2);
            }
        }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;

        _mainView = this.GetComponent <UIPanel>().ui;

        // 主UI界面
        GRichTextField richText = _mainView.GetChild("name").asRichTextField;

        richText.text = "[color=#ff4400]hello[/color]";

        Transform      npc          = GameObject.Find("npc1").transform;
        UIPanel        panel        = npc.FindChild("HeadBar").GetComponent <UIPanel>();
        GRichTextField richTextNpc1 = panel.ui.GetChild("name").asRichTextField;

        richTextNpc1.text = "Long [color=#FFFFFF]LongName[/color]<a href='http://www.baidu.com><img src='ui://21gc3jcpoi6k4'/></a> Name";  //<a href=’xx><img src=’yy’/></a>
        richTextNpc1.onClickLink.Add(() => {
            Debug.Log("click rich text img ");
        });
        panel.ui.GetChild("blood").asProgress.value = 80;
        panel.ui.GetChild("sign").asLoader.url      = UIPackage.GetItemURL("HeaderBar", "task");

        npc   = GameObject.Find("npc2").transform;
        panel = npc.FindChild("HeadBar").GetComponent <UIPanel>();
        panel.ui.GetChild("name").text = "Man2";
        panel.ui.GetChild("blood").asProgress.value = 20;
        panel.ui.GetChild("sign").asLoader.url      = UIPackage.GetItemURL("HeaderBar", "fighting");
    }
コード例 #5
0
 /// <summary>
 /// 设置字体组件值
 /// </summary>
 /// <param name="gRichTextField"></param>
 public static void SetGRichTextByCode(this GRichTextField gRichTextField, string code)
 {
     if (!string.IsNullOrEmpty(code))
     {
         CentorPivot.This.GetComponent <LocalizationComponent>().SetGRichTextByCode(gRichTextField, code);
     }
 }
コード例 #6
0
 public static void Parse(GRichTextField tf, string text)
 {
     tf.emojies = EmojiTools.GetEmojis();       //给富文本设置emoji包
     tf.width   = tf.initWidth;
     tf.text    = EmojiParser.inst.Parse(text); //解析string替换Emoji表情
     tf.width   = tf.textWidth;                 //宽度自适应
 }
コード例 #7
0
ファイル: OverHeadComponent.cs プロジェクト: spadd/ET_Tank
        public void Awake()
        {
            Game.Scene.GetComponent <FUIPackageComponent>().AddPackage("OverHead");

            this.m_tank = this.GetParent <Tank>();

            this.m_overHeadGO = this.m_tank.GameObject.FindChildObjectByPath("OverHead");

            this.m_overHeadGO.SetActive(true);

            this.m_uiPanel = this.m_overHeadGO.GetComponent <UIPanel>();

            this.m_name = this.m_uiPanel.ui.GetChild("name").asRichTextField;

            this.m_redBar = this.m_uiPanel.ui.GetChild("n0").asProgress;

            this.m_whiteBar = this.m_uiPanel.ui.GetChild("n1").asProgress;

            this.m_name.text = this.m_tank.Name;

            m_numericComponent = this.m_tank.GetComponent <NumericComponent>();

            this.m_redBar.max = m_numericComponent[NumericType.MaxHp];

            this.m_redBar.value = m_numericComponent[NumericType.Hp];

            this.m_whiteBar.max = 100;

            this.m_whiteBar.value = 100;

            if (this.m_tank.TankCamp != TankComponent.Instance.MyTank.TankCamp)
            {
                this.m_name.color = Color.red;
            }
        }
コード例 #8
0
ファイル: ShowRewardDialog.cs プロジェクト: bludee/GameBase
 public override void ConstructFromXML(FairyGUI.Utils.XML xml)
 {
     base.ConstructFromXML(xml);
     iconCon   = this.GetController("c1");
     tipText   = this.GetChild("tipText").asRichTextField;
     trans     = this.GetTransition("t0");
     moneyText = this.GetChild("n11").asTextField;
 }
コード例 #9
0
        public override void ConstructFromXML()
        {
            this.Owner = "FUI.Login";

            m_Ctrl_Content = this.GetController("Ctrl_Content");
            m_Text_Protocol_Content_User    = (GRichTextField)this.GetChild("Text_Protocol_Content_User");
            m_Text_Protocol_Content_Privacy = (GRichTextField)this.GetChild("Text_Protocol_Content_Privacy");
        }
コード例 #10
0
        public override void ConstructFromXML()
        {
            this.Owner = "FUI.Login";

            m_Text_Number_Item = (GTextField)this.GetChild("Text_Number_Item");
            m_Button_Close_X2  = (GButton)this.GetChild("Button_Close_X2");
            m_Text_Date        = (GTextField)this.GetChild("Text_Date");
            m_Text_Icon        = (GRichTextField)this.GetChild("Text_Icon");
        }
コード例 #11
0
        void Start()
        {
            var ui = GetComponent <UIPanel>().ui;

            textField = ui.GetChild("n2").asRichTextField;
            bg        = ui.GetChild("n1").asImage;
            jiao      = ui.GetChild("n0").asImage;
            tiaozheng();
        }
コード例 #12
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_BaseWindow  = (WindowFrame)this.GetChildAt(0);
            m_Acount      = (BasicInput)this.GetChildAt(1);
            m_Password    = (BasicPassword)this.GetChildAt(2);
            m_LoginButton = (GreenButton)this.GetChildAt(3);
            m_HtmlText    = (GRichTextField)this.GetChildAt(4);
        }
コード例 #13
0
    //------------------------------
    private void PlayText()
    {
        GComponent obj = _demoObjects["Text"];

        //!!注意这里是fairygui.event.TextEvent而不是flash.events.TextEvent
        obj.GetChild("n12").asRichTextField.onClickLink.Add((EventContext context) =>
        {
            GRichTextField t = context.sender as GRichTextField;
            t.text           = "[img]ui://9leh0eyft9fj5f[/img][color=#FF0000]你点击了链接[/color]:" + context.data;
        });
    }
コード例 #14
0
        public override void ConstructFromXML(XML xml)
        {
            base.ConstructFromXML(xml);

            m_BaseWindow = (WindowFrame)this.GetChildAt(0);
            m_Next       = (OrangeButton)this.GetChildAt(1);
            m_RoleList   = (GList)this.GetChildAt(2);
            m_Detials    = (BasicText)this.GetChildAt(3);
            m_HintText   = (BasicText)this.GetChildAt(4);
            m_IconLoader = (IconLoader)this.GetChildAt(5);
            m_htmlText   = (GRichTextField)this.GetChildAt(6);
        }
コード例 #15
0
	//------------------------------
	private void PlayText()
	{
		GComponent obj = _demoObjects["Text"];
		obj.GetChild("n12").asRichTextField.onClickLink.Add((EventContext context) =>
		{
			GRichTextField t = context.sender as GRichTextField;
			t.text = "[img]ui://9leh0eyft9fj5f[/img][color=#FF0000]You click the link[/color]:" + context.data;
		});
		obj.GetChild("n25").onClick.Add(() =>
		{
			obj.GetChild("n24").text = obj.GetChild("n22").text;
		});
	}
コード例 #16
0
        public override void ConstructFromXML()
        {
            this.Owner = "FUI.Login";

            m_Text_Account_Input    = (GTextInput)this.GetChild("Text_Account_Input");
            m_Text_GD_Protocol_More = (GRichTextField)this.GetChild("Text_GD_Protocol_More");
            m_Text_Code_Input       = (GTextInput)this.GetChild("Text_Code_Input");
            m_Button_Guest          = (Button_Guest)this.GetChild("Button_Guest");
            m_Button_SendCode       = (Button_SendCode)this.GetChild("Button_SendCode");
            m_Button_Close_X3       = (GButton)this.GetChild("Button_Close_X3");
            m_Button_Choose         = (GButton)this.GetChild("Button_Choose");
            m_Button_OtherMethods   = (Button_OtherMethods)this.GetChild("Button_OtherMethods");
            m_CBox_SelectNumber     = (CBox_SelectNumber)this.GetChild("CBox_SelectNumber");
            m_CBox_NumberArea       = (CBox_NumberArea)this.GetChild("CBox_NumberArea");
        }
コード例 #17
0
ファイル: FUIStoryWin.cs プロジェクト: yzx4036/ET
        public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            base.Dispose();

            self.Remove();
            self = null;

            speakerTxt = null;
            btnList    = null;
        }
コード例 #18
0
    protected override void OnInit()
    {
        this.contentPane = UIPackage.CreateObject("UIMain", "GetNewItem").asCom;
        this.Center();
        this.modal = true;

        _new_item_list = this.contentPane.GetChild("list").asList;
        _new_item_list.EnsureBoundsCorrect();


        _confirm = this.contentPane.GetChild("confirm").asButton;
        _confirm.onClick.Add(chooseItem);
        _confirm.visible = false;

        _skip = this.contentPane.GetChild("skip").asRichTextField;
        _skip.onTouchBegin.Add(skip);
    }
コード例 #19
0
    void RenderListItem(int index, GObject obj)
    {
        GButton item = (GButton)obj;
        Message msg  = _messages[index];

        if (!msg.fromMe)
        {
            item.GetChild("name").text = msg.sender;
        }
        item.icon = UIPackage.GetItemURL("Emoji", msg.senderIcon);

        //Recaculate the text width
        GRichTextField tf = item.GetChild("msg").asRichTextField;

        tf.emojies = _emojies;
        tf.text    = EmojiParser.inst.Parse(msg.msg);
    }
コード例 #20
0
        private void SetTextContent(GComponent comp)
        {
            GImage TextBkg1 = comp.GetChild("n3").asImage;

            GImage TextBkg2 = comp.GetChild("n4").asImage;

            GRichTextField TextContent = comp.GetChild("n7").asRichTextField;

            TextBkg1.width = TextContent.textWidth + 50;

            TextBkg2.width = TextBkg1.width;

            TextContent.x = GRoot.inst.width / 2 - TextContent.textWidth / 2;

            TextBkg1.x = GRoot.inst.width / 2 - TextBkg1.width / 2;

            TextBkg2.x = GRoot.inst.width / 2 - TextBkg2.width / 2;
        }
コード例 #21
0
    void Start()
    {
        UIPackage.AddPackage("UI/EmojiDemo/EmojiDemo");
        GRoot.inst.SetContentScaleFactor(1080, 1920, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight);
        view = UIPackage.CreateObject("EmojiDemo", "EmojiDemo").asCom;
        view.SetSize(GRoot.inst.width, GRoot.inst.height);
        view.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(view);

        richTextField = view.GetChild("richtext").asRichTextField;

        string text = "An awesome string with a few 😉emojis!";

        EmojiTools.Parse(richTextField, text);

        textInput = view.GetChild("input").asTextInput;
        textInput.onFocusOut.Set(() => {
            SendInput();
        });
    }
コード例 #22
0
        protected override void StartFUI()
        {
            m_againBtn       = this.FUIComponent.Get("n10").GObject.asButton;
            m_leftList       = this.FUIComponent.Get("n32").Get("n1").GObject.asList;
            m_rightList      = this.FUIComponent.Get("n33").Get("n1").GObject.asList;
            m_leftSucOrFail  = this.FUIComponent.Get("n28").GObject.asLoader;
            m_rightSucOrFail = this.FUIComponent.Get("n29").GObject.asLoader;
            m_leftCampName   = this.FUIComponent.Get("n24").GObject.asRichTextField;
            m_rightCampName  = this.FUIComponent.Get("n25").GObject.asRichTextField;

            m_leftTopTitle = this.FUIComponent.Get("n32").GObject.asCom.GetChild("n2").asCom;

            m_rightTopTitle = this.FUIComponent.Get("n33").GObject.asCom.GetChild("n2").asCom;

            m_againBtn.onClick.Set(this.AgainBtn_OnClick);

            this.m_leftList.itemRenderer  = ItemRendererLeft;
            this.m_rightList.itemRenderer = ItemRendererRight;
            this.UI();
        }
コード例 #23
0
        public void SetGRichTextByCode(GRichTextField gTextField, string code)
        {
            string pjblock = Utility.Text.Format("{0}{1}", gTextField.Owner, gTextField.Block);

            DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, code);

            if (dictionaryInfo != null)
            {
                gTextField.text = dictionaryInfo.Value;
                if (dictionaryInfo.Size > 0)
                {
                    gTextField.textFormat.size = dictionaryInfo.Size;
                }

                if (dictionaryInfo.NewLine)
                {
                    gTextField.text = gTextField.text.Replace("**", System.Environment.NewLine);
                }
            }
        }
コード例 #24
0
ファイル: FUICard.cs プロジェクト: yzx4036/ET
        public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            base.Dispose();

            self.Remove();
            self = null;

            cost_bg    = null;
            cost_txt   = null;
            effect_txt = null;
            attack_txt = null;
            hp_txt     = null;
            size_bg    = null;
            size_txt   = null;
        }
コード例 #25
0
        // Use this for initialization
        public void Init()
        {
            panduanindex = 0;
            valueMonitorPool.Clear();
            gameObject.SetActive(false);
            ui       = gameObject.GetComponent <UIPanel>().ui;
            RestartG = ui.GetChildWithPath("n1").asButton;
            RestartG.GetChild("text").text = "重新开始";
            RestartG.onClick.Add(() =>
            {
                GameStart.Instance.ReloadGame();
            });


            GameOverChoiceframe = ui.GetChild("GameOverChoiceframe").asCom;
            swordchoice         = GameOverChoiceframe.GetChildWithPath("swordchoice").asCom;
            choice0             = GameOverChoiceframe.GetChild("n4").asRichTextField;
            choice1             = GameOverChoiceframe.GetChild("n5").asRichTextField;
            choicelist.Add(choice0);
            choicelist.Add(choice1);
            valueMonitorPool.AddMonitor(() =>
            {
                return(panduanindex);
            }, (int from, int to) =>
            {
                FocusIndex(panduanindex);
            });
            alphachoice(0);
            choice0.onClick.Add(() => { FocusIndex(0); Restart(); });
            choice1.onClick.Add(() => { FocusIndex(1); Debug.Log("out"); });

            #region //关闭you die界面

            UIManager.Instance.CreatSUIObj <SkeletonAnimation>("OverSpine01").gameObject.SetActive(false);
            UIManager.Instance.CreatSUIObj <SkeletonAnimation>("OverSpine02").gameObject.SetActive(false);

            #endregion
        }
コード例 #26
0
        public void AddEmitTip(string text, PopMessageType type)
        {
            EmitTip item = m_EmitTipPool.Alloc(NewEmitTip);

            item.Init(type);

            m_EmitTipItems.Add(item);

            this.FUIComponent.GObject.asCom.AddChild(item.m_comp);

            GRichTextField textContent = item.m_comp.GetChild("n7").asRichTextField;

            textContent.text = text;

            SetTextContent(item.m_comp);

            Transition anim = item.GetAnim();

            if (anim != null)
            {
                anim.Play();
            }
        }
コード例 #27
0
    void AddMsg(string sender, string senderIcon, string msg, bool fromMe)
    {
        bool isScrollBottom = _list.scrollPane.isBottomMost;

        GButton item = _list.AddItemFromPool(fromMe ? _itemURL2 : _itemURL1).asButton;

        if (!fromMe)
        {
            item.GetChild("name").text = sender;
        }
        item.icon = UIPackage.GetItemURL("Emoji", senderIcon);

        //Recaculate the text width
        GRichTextField tf = item.GetChild("msg").asRichTextField;

        tf.width = tf.initWidth;
        tf.text  = EmojiParser.inst.Parse(msg);
        tf.width = tf.textWidth;

        if (fromMe)
        {
            if (_list.numChildren == 1 || Random.Range(0f, 1f) < 0.5f)
            {
                AddMsg("FairyGUI", "r1", "Today is a good day. [:gz]", false);
            }
        }

        if (_list.numChildren > 30)
        {
            _list.RemoveChildrenToPool(0, _list.numChildren - 30);
        }

        if (isScrollBottom)
        {
            _list.scrollPane.ScrollBottom(true);
        }
    }
コード例 #28
0
ファイル: StoreUIController.cs プロジェクト: linxscc/bnyx
        public void Init()
        {
            storeController = this.gameObject.AddComponent <StoreController>();
            storeController.Init();
            ui              = GetComponent <UIPanel>().ui;
            storeup         = ui.GetChild("n5").asCom;            //选项"是"
            storedown       = ui.GetChild("n6").asCom;            //选项"否"
            storebuy        = ui.GetChild("n7").asCom;
            n1              = storeup.GetChild("left1").asLoader; //消耗品
            n2              = storeup.GetChild("left2").asLoader; //武器
            n3              = storeup.GetChild("left3").asLoader; //防具
            n4              = storeup.GetChild("left4").asLoader; //饰品
            t1              = storeup.GetChild("lefttext1").asRichTextField;
            t2              = storeup.GetChild("lefttext2").asRichTextField;
            t3              = storeup.GetChild("lefttext3").asRichTextField;
            t4              = storeup.GetChild("lefttext4").asRichTextField;
            tisheng         = storeup.GetChild("tisheng").asImage;
            namedown        = storedown.GetChild("n1").asTextField; //storedown物品名称
            descdown        = storedown.GetChild("n3").asTextField; //storedown物品描述
            buy1            = storebuy.GetChild("n5").asLoader;
            buy2            = storebuy.GetChild("n6").asLoader;
            buytext         = storebuy.GetChild("n2").asTextField;
            tisheng.visible = false;

            LeftList.Add(n1);
            LeftList.Add(n2);
            LeftList.Add(n3);
            LeftList.Add(n4);
            textlist.Add(t1);
            textlist.Add(t2);
            textlist.Add(t3);
            textlist.Add(t4);
            buylist.Add(buy1);
            buylist.Add(buy2);
            t1.onClick.Add(() =>
            {
                leftindex = 0;
                onclick();
            });
            t2.onClick.Add(() =>
            {
                leftindex = 1;
                onclick();
            });
            t3.onClick.Add(() =>
            {
                leftindex = 2;
                onclick();
            });
            t4.onClick.Add(() =>
            {
                leftindex = 3;
                onclick();
            });
            buy1.onClick.Add(() =>
            {
                storebuyindex = 0;
                buychoice(storebuyindex);
                leftright = 0;
                storeController.closechoice();
                openchoice();
                storeController.choice0();
                storebuy.visible = false;
                offFsm();
            });
            buy2.onClick.Add(() =>
            {
                storebuyindex = 1;
                buychoice(storebuyindex);
                leftright        = 1;
                storebuy.visible = false;
            });

            leftchoice = storeup.GetChild("Choice").asImage;

            leftright         = 0;
            leftindex         = 0;
            storedown.visible = false;
            storebuy.visible  = false;
            storeup.visible   = false;
            storebuyfirsty    = storeup.x;
            das = false;
            Hide();


            storeController.onoff = (int obj) =>
            {
                //leftright = obj;
                if (obj == 0)
                {
                    //openchoice();
                    choiceleftpos(leftindex);
                    AnimManager.Instance.Movesize(tisheng, leftchoice, storeController.choicevector2(), new Vector2(LeftList[leftindex].position.x + 1, LeftList[leftindex].position.y), 0.1f);
                }
                else
                {
                    if (obj != leftright)
                    {
                        closechoice();
                        AnimManager.Instance.Movesize(tisheng, storeController.choice, leftchoice.position, storeController.choicenow(), 0.1f);
                    }
                    showbuy();
                }
                leftright = obj;
            };
            storeController.show = (int index) =>
            {
                rightindex = index;

                BagData bagData;
                if (storeController.bagDataList.TryGet(index, out bagData))
                {
                    namedown.text = bagData.name;
                    descdown.text = bagData.desc;
                }
                if (storeController.leftright == 0)
                {
                    closestoredowntw();
                }
                else
                {
                    openstoredowntw();
                }
            };
            //iconchoice(0);
            choiceleftpos(leftindex);
            Import();
        }
コード例 #29
0
ファイル: RollText.cs プロジェクト: flyarong/qipai_client
 // Start is called before the first frame update
 void Start()
 {
     mainUI = GetComponent <UIPanel>().ui;
     roll   = mainUI.GetChild("rollText").asCom;
     text   = roll.GetChild("text").asRichTextField;
 }