public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_n2 = (GMovieClip)this.GetChild("n2"); m_n3 = (GImage)this.GetChild("n3"); }
public override void ConstructFromXML() { this.Owner = "FUI.Login"; m_Ctrl_Pup_5 = this.GetController("Ctrl_Pup_5"); m_Load_Wait = (GMovieClip)this.GetChild("Load_Wait"); }
void CreateCom() { GObject go = UIPackage.CreateObject("MainPack", "ImageExp"); if (go != null) { mShowImagetoUintyCom = go.asCom; GRoot.inst.AddChild(mShowImagetoUintyCom); mShowImagetoUintyCom.size = GRoot.inst.size; mShowImagetoUintyCom.Center(true); } else { Debug.LogError("创建对象失败"); } GMovieClip mv = mShowImagetoUintyCom.GetChild("n1").asMovieClip; mv.playing = false; GLoader load = mShowImagetoUintyCom.GetChild("gloader").asLoader; string url = UIPackage.GetItemURL("MainPack", "cd1_btn_normal"); //string url = "ui://MainPack/cd1_btn_normal"; load.url = url; //this.TestTextFieldAndInut(); }
// Use this for initialization void Start() { PlayerPrefs.DeleteAll(); UIPackage.AddPackage("FairyGUI/UIMain"); UIObjectFactory.SetPackageItemExtension("ui://UIMain/ClickShower", typeof(ShowClickMask)); hasSave = PlayerPrefs.GetInt("hasSave", 0); _main_menu = GetComponent <UIPanel> ().ui; _main_menu.GetController("c0").SetSelectedPage("unsave"); if (hasSave > 0) { _main_menu.GetController("c0").SetSelectedPage("save"); } _main_menu.GetChild("loadGame").onClick.Add(loadGame); _main_menu.GetChild("newGame").onClick.Add(newGame); _main_menu.GetChild("options").onClick.Add(options); _main_menu.GetChild("quit").onClick.Add(quit); //_main_menu.onClick.Add (OnClick); _main_menu.onClick.Add(OnClickShow); effect = _main_menu.GetChild("effect").asMovieClip; // ShowClickMask _maskLayer = (ShowClickMask)UIPackage.CreateObject ("UIMain", "ClickShower").asCom; // _maskLayer.SetSize(GRoot.inst.width, GRoot.inst.height); // _maskLayer.AddRelation(GRoot.inst, RelationType.Size); // // // // GRoot.inst.AddChild(_maskLayer); // _main_menu.AddChild (mask); // Debug.Log (_main_menu.numChildren); // Debug.Log (mask.position); _mask = _main_menu.GetChild("mask").asGraph; _newHeroPanel = _main_menu.GetChild("newHeroPanel").asCom; _info = _newHeroPanel.GetChild("info").asTextField; _desp = _newHeroPanel.GetChild("desp").asTextField; _start_game = _newHeroPanel.GetChild("startGame").asLoader; _start_game.onClick.Add(delegate(EventContext context) { PlayerData.getInstance().heroIdx = choosedHeroIdx; enterGame(); }); _hero_list = _newHeroPanel.GetChild("hero_list").asList; _hero_list.SetVirtualAndLoop(); _hero_list.itemRenderer = RenderHeroes; _hero_list.numItems = GameStaticData.getInstance().heroes.Count; _hero_list.scrollPane.onScroll.Add(doHeroScrollEffect); _hero_list.scrollPane.onScrollEnd.Add(changeHeroDetail); doHeroScrollEffect(); changeHeroDetail(); { _info.text = GameStaticData.getInstance().heroes[choosedHeroIdx].name; _desp.text = GameStaticData.getInstance().heroes [choosedHeroIdx].desp; } }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); t3 = (GTextField)this.GetChild("t3"); t1 = (GTextField)this.GetChild("t1"); cb = (GButton)this.GetChild("cb"); mc = (GMovieClip)this.GetChild("mc"); }
private void Awake() { GComponent gComponent = GetComponent <UIPanel>().ui; //Movie g_TimeNumber = gComponent.GetChild("TimeNumber").asMovieClip; //Icon g_PlayerIcon = gComponent.GetChild("PlayerIcon").asLoader; g_EnemyIcon = gComponent.GetChild("EnemyIcon").asLoader; //ActionText g_PlayerActionText = gComponent.GetChild("PlayerActionText").asTextField; g_EnemyActionText = gComponent.GetChild("EnemyActionText").asTextField; //Role g_CurRole = gComponent.GetChild("Role1Tmp").asButton; g_CurRole.visible = true; g_CurRole.selected = true; //SequenceSlot g_SequenceSlot = new GComponent[7]; g_SequenceSlot[0] = gComponent.GetChild("SequenceSlot1").asCom; g_SequenceSlot[1] = gComponent.GetChild("SequenceSlot2").asCom; g_SequenceSlot[2] = gComponent.GetChild("SequenceSlot3").asCom; g_SequenceSlot[3] = gComponent.GetChild("SequenceSlot4").asCom; g_SequenceSlot[4] = gComponent.GetChild("SequenceSlot5").asCom; g_SequenceSlot[5] = gComponent.GetChild("SequenceSlot6").asCom; g_SequenceSlot[6] = gComponent.GetChild("SequenceSlot7").asCom; //ActionSlot g_ActionSlot = new GComponent[10]; g_ActionSlot[0] = gComponent.GetChild("ActionSlot1").asCom; g_ActionSlot[1] = gComponent.GetChild("ActionSlot2").asCom; g_ActionSlot[2] = gComponent.GetChild("ActionSlot3").asCom; g_ActionSlot[3] = gComponent.GetChild("ActionSlot4").asCom; g_ActionSlot[4] = gComponent.GetChild("ActionSlot5").asCom; g_ActionSlot[5] = gComponent.GetChild("ActionSlot6").asCom; g_ActionSlot[6] = gComponent.GetChild("ActionSlot7").asCom; g_ActionSlot[7] = gComponent.GetChild("ActionSlot8").asCom; g_ActionSlot[8] = gComponent.GetChild("ActionSlot9").asCom; g_ActionSlot[9] = gComponent.GetChild("ActionSlot10").asCom; //Sequence g_Sequence = new List <GButton>(); //Action g_Action = new List <GButton>(); g_Health = gComponent.GetChild("Health").asTextField; g_Power = gComponent.GetChild("Power").asTextField; g_Movement = gComponent.GetChild("Movement").asTextField; }
public override void ConstructFromXML() { this.Owner = "FUI.Login"; m_Ctrl_Text = this.GetController("Ctrl_Text"); m_Text_Mseg = (GTextField)this.GetChild("Text_Mseg"); m_Text_NewVersion = (GTextField)this.GetChild("Text_NewVersion"); m_Text_Tips = (GTextField)this.GetChild("Text_Tips"); m_MCycle_LoadRes = (GMovieClip)this.GetChild("MCycle_LoadRes"); }
protected override void OnInitPanel() { if (!isDayNightPanel) { openAnimCom = contentPane.GetChild("EyeOpen").asCom; closeAnimCom = contentPane.GetChild("EyeClose").asCom; openEye = openAnimCom.GetChild("Anim_Eye").asMovieClip; closeEye = closeAnimCom.GetChild("Anim_Eye").asMovieClip; certainButton = contentPane.GetChild("Btn_Certain").asButton; } guideMessage = contentPane.GetChild("GuideMessage").asCom; messageController = guideMessage.GetController("c1"); controller = contentPane.GetController("c1"); }
// Use this for initialization void Start() { GComponent gComponent = GetComponent <UIPanel>().ui; //Movie g_Time = gComponent.GetChild("Time").asMovieClip; g_Time.playing = false; //Road g_Road = new GImage[6]; g_Road[0] = gComponent.GetChild("Road1").asImage; g_Road[1] = gComponent.GetChild("Road2").asImage; g_Road[2] = gComponent.GetChild("Road3").asImage; g_Road[3] = gComponent.GetChild("Road4").asImage; g_Road[4] = gComponent.GetChild("Road5").asImage; g_Road[5] = gComponent.GetChild("Road6").asImage; //Role g_Player = gComponent.GetChild("PlayerRole").asImage; g_Enemy = gComponent.GetChild("EnemyRole").asImage; g_PlayerText = gComponent.GetChild("PlayerText").asTextField; g_EnemyText = gComponent.GetChild("EnemyText").asTextField; //Action g_Action = new GImage[8]; g_Action[0] = UIPackage.CreateObject("Game", "picMove").asImage; g_Action[1] = UIPackage.CreateObject("Game", "picAttack").asImage; g_Action[2] = UIPackage.CreateObject("Game", "picDefance").asImage; g_Action[3] = UIPackage.CreateObject("Game", "picMagic").asImage; g_Action[4] = UIPackage.CreateObject("Game", "picMove").asImage; g_Action[5] = UIPackage.CreateObject("Game", "picAttack").asImage; g_Action[6] = UIPackage.CreateObject("Game", "picDefance").asImage; g_Action[7] = UIPackage.CreateObject("Game", "picMagic").asImage; for (int i = 0; i < 8; ++i) { g_Action[i].height = 32; g_Action[i].width = 32; g_Action[i].visible = false; gComponent.AddChild(g_Action[i]); } //RoleAction g_PlayerAction = new int[10]; g_EnemyAction = new int[10]; }
void Start() { mainUI = GetComponent <UIPanel>().ui; mainUI.GetChild("bactbt").onClick.Add(() => { SceneManager.LoadScene("select"); }); amovie = mainUI.GetChild("ready").asMovieClip; //amovie.SetPlaySettings(0,5,1,-1); amovie.visible = false; // music window musicwin = new musicWindow(amovie); musicwin.SetXY(Screen.width / 2 - 500, Screen.height / 10); mainUI.GetChild("musicbt").onClick.Add(() => { musicwin.Show(); }); // mode window modewin = new modeWindow(amovie); modewin.SetXY(Screen.width / 2 - 500, Screen.height / 10); restartwin = new restartWindow(); restartwin.SetXY(Screen.width / 2 - 500, Screen.height / 10); musicwin.Show(); mainUI.GetChild("modebt").onClick.Add(() => { modewin.Show(); }); }
public static GObject NewObject(string type, AppContext context) { GObject cls = null; switch (type) { case "image": cls = new GImage(); break; case "movieclip": cls = new GMovieClip(); break; case "swf": cls = new GSwfObject(); break; case "jta": cls = new GJtaObject(); break; case "component": cls = new GComponent(); break; case "text": cls = new GTextField(); break; case "group": cls = new GGroup(); break; case "list": cls = new GList(); break; case "graph": cls = new GGraph(); break; case "loader": cls = new GLoader(); break; //component derived case "Button": cls = new GButton(); break; case "Label": cls = new GLabel(); break; case "ProgressBar": cls = new GProgressBar(); break; case "Slider": cls = new GSlider(); break; case "ScrollBar": cls = new GScrollBar(); break; case "ComboBox": cls = new GComboBox(); break; } cls.OnCreate(context); return(cls); }
public void ShowIcon(string type, int count, GComponent par, Vector2 start, Vector2 point) { Dictionary <string, object> ccc = (Dictionary <string, object>)DataManager.inst.systemSimple ["show_ranimation"]; if (ccc == null || !ccc.ContainsKey(type)) { return; } object[] ddd = (object[])ccc [type]; int yuanshi = count; Vector2 end = new Vector2(); string imgUrl = Tools.GetIconMcName(type); int ran = Tools.GetRandom(10, 40); int f = 10; double b = Convert.ToDouble(ddd [1]); count = Convert.ToInt32(Math.Ceiling(Math.Pow(count, 1f / Convert.ToSingle(ddd [0])))); count = Convert.ToInt32(Math.Ceiling(count * b)); if (count > (int)ddd [2] || count < yuanshi) { count = (int)ddd [2] > yuanshi?yuanshi:(int)ddd[2]; } b = Convert.ToDouble(Convert.ToInt32(Math.Floor(Convert.ToSingle(yuanshi / count)))); int lestOne = (yuanshi + Convert.ToInt32(b)) - (Convert.ToInt32(b) * count); // Log.debug ("count=" + count + "|b=" + b + "|lestOne=" + lestOne + "|"); TextFormat tf; GTextField txt = new GTextField(); tf = txt.textFormat; tf.size = 30; txt.stroke = 2; txt.strokeColor = Color.white; Vector2 off = new Vector2(0, 0); float ff = 0f; if (type == Config.ASSET_REDBAGCOIN) { ff = 0.4f; } else { ff = 0; } switch (type) { case Config.ASSET_COIN: txt.color = Tools.GetColor("FF2E94"); end = ComGoldCoinExp.coinXY; off = new Vector2(30, 30); break; case Config.ASSET_GOLD: txt.color = Tools.GetColor("E18F00"); end = ComGoldCoinExp.goldXY; off = new Vector2(30, -30); break; case Config.ASSET_EXP: txt.color = Tools.GetColor("00B23B"); end = ComGoldCoinExp.expXY; off = new Vector2(-30, -30); break; case Config.ASSET_CARD: txt.color = Tools.GetColor("ABABAB"); end = ComGoldCoinExp.cardXY; break; case Config.ASSET_ELSCORE: txt.color = Tools.GetColor("00A7E5"); end = ComGoldCoinExp.el_scoreXY; break; case Config.ASSET_REDBAGCOIN: txt.color = Tools.GetColor("00A7E5"); //FB2900 end = ComGoldCoinExp.redbag_coinXY; break; } txt.textFormat = tf; for (int i = 0; i < count; i++) { if (type == Config.ASSET_ELSCORE) { ComGoldCoinExp.Elcount++; } else if (type == Config.ASSET_REDBAGCOIN) { ComGoldCoinExp.Redcount++; } else { ComGoldCoinExp.count++; } int indexxxx = i; // GComponent g = Tools.GetComponent (Config.COM_EFFECTICON).asCom; GMovieClip g = Tools.GetComponent(imgUrl).asMovieClip; par.AddChild(g); // g.GetChild ("n0").asLoader.url = imgUrl; g.x = start.x + off.x; g.y = start.y + off.y; g.TweenMove(new Vector2(start.x + Convert.ToSingle(Math.Cos(f * i) * ran) + off.x, start.y + Convert.ToSingle(Math.Sin(f * i) * ran) + off.y), 0.4f).SetDelay(i * 0.1f); g.alpha = 0; g.TweenFade(1f, (0.1f * i)); g.scale = new Vector2(0.7f, 0.7f); TimerManager.inst.Add((0.1f * i) + 0.5f, 1, (float time) => { g.TweenScale(new Vector2(1f, 1f), 0.5f).OnComplete(() => { g.TweenScale(new Vector2(0.7f, 0.7f), 0.4f); }); this.Bezier(g, 0.6f, new Vector2(g.x, g.y), point, end, () => { par.RemoveChild(g, true); if (type == Config.ASSET_ELSCORE) { if (indexxxx == (count - 1)) { DispatchManager.inst.Dispatch(new MainEvent(MainEvent.JUMP_ELSCORE, new String[] { type, lestOne.ToString() })); } else { DispatchManager.inst.Dispatch(new MainEvent(MainEvent.JUMP_ELSCORE, new String[] { type, b.ToString() })); } } else { if (indexxxx == (count - 1)) { DispatchManager.inst.Dispatch(new MainEvent(MainEvent.JUMP_COINGOLDEXPGET, new String[] { type, lestOne.ToString() })); } else { DispatchManager.inst.Dispatch(new MainEvent(MainEvent.JUMP_COINGOLDEXPGET, new String[] { type, b.ToString() })); } } }).SetDelay(ff); }); } par.AddChild(txt); txt.text = "+" + yuanshi.ToString(); txt.x = start.x + off.x; txt.y = start.y - 20 + off.y; txt.TweenMoveY(txt.y - 70f, 2f).OnUpdate(() => { txt.alpha -= 0.01f; }).OnComplete(() => { par.RemoveChild(txt); txt.Dispose(); }).SetEase(Ease.OutBack); }
public musicWindow(GMovieClip movie) { amovie = movie; }
public modeWindow(GMovieClip movie) { amovie = movie; }