void Start() { Application.targetFrameRate = 60; GRoot.inst.SetContentScaleFactor(1136, 640); Stage.inst.onKeyDown.Add(OnKeyDown); UIPackage.AddPackage("UI/Emoji"); UIConfig.verticalScrollBar = UIPackage.GetItemURL("Emoji", "ScrollBar_VT"); UIConfig.defaultScrollBarDisplay = ScrollBarDisplayType.Auto; _mainView = UIPackage.CreateObject("Emoji", "Main").asCom; _mainView.fairyBatching = true; _mainView.SetSize(GRoot.inst.width, GRoot.inst.height); _mainView.AddRelation(GRoot.inst, RelationType.Size); GRoot.inst.AddChild(_mainView); _list = _mainView.GetChild("list").asList; _list.RemoveChildrenToPool(); _input = _mainView.GetChild("input").asTextInput; _input.onKeyDown.Add(__inputKeyDown); _itemURL1 = UIPackage.GetItemURL("Emoji", "chatLeft"); _itemURL2 = UIPackage.GetItemURL("Emoji", "chatRight"); _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn); _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn); _emojiSelectUI = UIPackage.CreateObject("Emoji", "EmojiSelectUI").asCom; _emojiSelectUI.fairyBatching = true; _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji); }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); _mainView = this.GetComponent<UIPanel>().ui; _list = _mainView.GetChild("mailList").asList; for (int i = 0; i < 10; i++) { MailItem item = (MailItem)_list.AddItemFromPool(); item.setFetched(i % 3 == 0); item.setRead(i % 2 == 0); item.setTime("5 Nov 2015 16:24:33"); item.title = "Mail title here"; } _list.EnsureBoundsCorrect(); float delay = 0f; for (int i = 0; i < 10; i++) { MailItem item = (MailItem)_list.GetChildAt(i); if (_list.IsChildInView(item)) { item.PlayEffect(delay); delay += 0.2f; } else break; } }
protected override void OnInit() { this.contentPane = UIPackage.CreateObject("Bag", "BagWin").asCom; this.Center(); _list = this.contentPane.GetChild("list").asList; _list.onClickItem.Add(__clickItem); }
protected override void OnInit() { this.contentPane = UIPackage.CreateObject("Bag", "BagWin").asCom; this.Center(); _list = this.contentPane.GetChild("list").asList; _list.onClickItem.Add(__clickItem); //弹出窗口的动效已中心为轴心 this.SetPivot(this.width / 2, this.height / 2); }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); //GComponent g1 = GameObject.Find("UIPanel1").GetComponent<UIPanel>().ui; GComponent g2 = GameObject.Find("UIPanel2").GetComponent<UIPanel>().ui; _list = g2.GetChild("mailList").asList; _list.SetVirtual(); _list.itemRenderer = (int index, GObject obj) => { obj.text = index + " Mail title here"; }; _list.numItems = 20; }
protected override void OnInit() { this.contentPane = UIPackage.CreateObject("Bag", "BagWin").asCom; this.Center(); this.modal = true; _page = this.contentPane.GetController("page"); _list = this.contentPane.GetChild("list").asList; _list.onClickItem.Add(__clickItem); _list.itemRenderer = RenderListItem; _list.scrollPane.onScroll.Add(OnScroll); _list.numItems = 45; }
/// <summary> /// /// </summary> /// <param name="list"></param> public TreeView(GList list) { this.list = list; list.onClickItem.Add(__clickItem); list.RemoveChildrenToPool(); root = new TreeNode(true); root.SetTree(this); root.cell = list; root.expanded = true; indent = 30; onClickNode = new EventListener(this, "onClickNode"); }
static int Setup_BeforeAdd(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); FairyGUI.Utils.XML arg0 = (FairyGUI.Utils.XML)ToLua.CheckObject(L, 2, typeof(FairyGUI.Utils.XML)); obj.Setup_BeforeAdd(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveSelection(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.RemoveSelection(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int GetFromPool(IntPtr l) { try { FairyGUI.GList self = (FairyGUI.GList)checkSelf(l); System.String a1; checkType(l, 2, out a1); var ret = self.GetFromPool(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int RemoveChildToPoolAt(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.RemoveChildToPoolAt(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetSelection(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); System.Collections.Generic.List <int> o = obj.GetSelection(); ToLua.PushSealed(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); _mainView = this.GetComponent<UIPainter>().ui; _list = _mainView.GetChild("list").asList; _list.SetVirtualAndLoop(); _list.itemRenderer = RenderListItem; _list.numItems = 5; _list.scrollPane.onScroll.Add(DoSpecialEffect); DoSpecialEffect(); }
static int RemoveChildToPool(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject)); obj.RemoveChildToPool(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetFirstChildInView(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); int o = obj.GetFirstChildInView(); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int HandleControllerChanged(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); FairyGUI.Controller arg0 = (FairyGUI.Controller)ToLua.CheckObject <FairyGUI.Controller>(L, 2); obj.HandleControllerChanged(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int HandleArrowKey(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.HandleArrowKey(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); _mainView = this.GetComponent<UIPanel>().ui; _mainView.GetChild("n6").onClick.Add(() => { _list.AddSelection(500, true); }); _mainView.GetChild("n7").onClick.Add(() => { _list.scrollPane.ScrollTop(); }); _mainView.GetChild("n8").onClick.Add(() => { _list.scrollPane.ScrollBottom(); }); _list = _mainView.GetChild("mailList").asList; _list.SetVirtual(); _list.itemRenderer = RenderListItem; _list.numItems = 1000; }
static public int AddSelection(IntPtr l) { try { FairyGUI.GList self = (FairyGUI.GList)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); self.AddSelection(a1, a2); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int AddSelection(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); obj.AddSelection(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetFromPool(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); string arg0 = ToLua.CheckString(L, 2); FairyGUI.GObject o = obj.GetFromPool(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ItemIndexToChildIndex(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int o = obj.ItemIndexToChildIndex(arg0); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Setup_AfterAdd(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject <FairyGUI.GList>(L, 1); FairyGUI.Utils.ByteBuffer arg0 = (FairyGUI.Utils.ByteBuffer)ToLua.CheckObject <FairyGUI.Utils.ByteBuffer>(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.Setup_AfterAdd(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
override protected void ConstructExtension(ByteBuffer buffer) { buffer.Seek(0, 6); _buttonController = GetController("button"); _titleObject = GetChild("title"); _iconObject = GetChild("icon"); string str = buffer.ReadS(); if (str != null) { dropdown = UIPackage.CreateObjectFromURL(str) as GComponent; if (dropdown == null) { Debug.LogWarning("FairyGUI: " + this.resourceURL + " should be a component."); return; } if (string.IsNullOrEmpty(dropdown.name)) { var itemName = dropdown.packageItem.name; itemName = itemName.Split("_LTR".ToCharArray())[0]; dropdown.name = string.Format("{0}_{1}", dropdown.packageItem.owner.name, itemName); } _list = dropdown.GetChild("list") as GList; if (_list == null) { Debug.LogWarning("FairyGUI: " + this.resourceURL + ": should container a list component named list."); return; } _list.onClickItem.Add(__clickItem); _list.AddRelation(dropdown, RelationType.Width); _list.RemoveRelation(dropdown, RelationType.Height); dropdown.AddRelation(_list, RelationType.Height); dropdown.RemoveRelation(_list, RelationType.Width); dropdown.SetHome(this); } displayObject.onRollOver.Add(__rollover); displayObject.onRollOut.Add(__rollout); displayObject.onTouchBegin.Add(__touchBegin); displayObject.onTouchEnd.Add(__touchEnd); }
/// <summary> /// /// </summary> /// <param name="list"></param> public TreeView(GList list) { this.list = list; list.onClickItem.Add(__clickItem); list.onRightClickItem.Add(__clickItem); list.RemoveChildrenToPool(); root = new TreeNode(true); root.SetTree(this); root.cell = list; root.expanded = true; indent = 30; onClickNode = new EventListener(this, "onClickNode"); onRightClickNode = new EventListener(this, "onRightClickNode"); }
static int get_isVirtual(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; bool ret = obj.isVirtual; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isVirtual on a nil value" : e.Message)); } }
static int get_numItems(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; int ret = obj.numItems; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index numItems on a nil value" : e.Message)); } }
static int set_autoResizeItem(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.autoResizeItem = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index autoResizeItem on a nil value" : e.Message)); } }
static int get_itemPool(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; FairyGUI.GObjectPool ret = obj.itemPool; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index itemPool on a nil value" : e.Message)); } }
static int get_onRightClickItem(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; FairyGUI.EventListener ret = obj.onRightClickItem; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onRightClickItem on a nil value" : e.Message)); } }
static int get_layout(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; FairyGUI.ListLayoutType ret = obj.layout; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index layout on a nil value" : e.Message)); } }
static int get_selectionMode(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; FairyGUI.ListSelectionMode ret = obj.selectionMode; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index selectionMode on a nil value" : e.Message)); } }
static int get_scrollItemToViewOnClick(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; bool ret = obj.scrollItemToViewOnClick; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index scrollItemToViewOnClick on a nil value" : e.Message)); } }
static int AddChildAt(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); FairyGUI.GList obj = (FairyGUI.GList)ToLua.CheckObject(L, 1, typeof(FairyGUI.GList)); FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject)); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); FairyGUI.GObject o = obj.AddChildAt(arg0, arg1); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_defaultItem(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; string ret = obj.defaultItem; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index defaultItem on a nil value" : e.Message)); } }
static int set_numItems(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.numItems = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index numItems on a nil value" : e.Message)); } }
static public int AddChildAt(IntPtr l) { try { FairyGUI.GList self = (FairyGUI.GList)checkSelf(l); FairyGUI.GObject a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); var ret = self.AddChildAt(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int set_defaultItem(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; string arg0 = ToLua.CheckString(L, 2); obj.defaultItem = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index defaultItem on a nil value" : e.Message)); } }
static int get_verticalAlign(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.GList obj = (FairyGUI.GList)o; FairyGUI.VertAlignType ret = obj.verticalAlign; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index verticalAlign on a nil value" : e.Message)); } }
void Start() { Application.targetFrameRate = 60; GRoot.inst.SetContentScaleFactor(1136, 640); Stage.inst.onKeyDown.Add(OnKeyDown); UIPackage.AddPackage("UI/Perspective"); _mainView = UIPackage.CreateObject("Perspective", "Main").asCom; _mainView.AddRelation(GRoot.inst, RelationType.Size); GRoot.inst.AddChild(_mainView); //GComponent g1 = GameObject.Find("UIPanel1").GetComponent<UIPanel>().ui; GComponent g2 = GameObject.Find("UIPanel2").GetComponent<UIPanel>().ui; _list = g2.GetChild("mailList").asList; _list.SetVirtual(); _list.itemRenderer = (int index, GObject obj) => { obj.text = index + " Mail title here"; }; _list.numItems = 20; }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); _mainView = this.GetComponent<UIPanel>().ui; _list = _mainView.GetChild("list").asList; _list.RemoveChildrenToPool(); _input = _mainView.GetChild("input").asTextInput; _input.onKeyDown.Add(__inputKeyDown); _itemURL1 = UIPackage.GetItemURL("Emoji", "chatLeft"); _itemURL2 = UIPackage.GetItemURL("Emoji", "chatRight"); _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn); _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn); _emojiSelectUI = UIPackage.CreateObject("Emoji", "EmojiSelectUI").asCom; _emojiSelectUI.fairyBatching = true; _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji); }
void Start() { Application.targetFrameRate = 60; GRoot.inst.SetContentScaleFactor(1136, 640); Stage.inst.onKeyDown.Add(OnKeyDown); UIPackage.AddPackage("UI/Extension"); UIObjectFactory.SetPackageItemExtension(UIPackage.GetItemURL("Extension", "mailItem"), typeof(MailItem)); _mainView = UIPackage.CreateObject("Extension", "Main").asCom; _mainView.fairyBatching = true; _mainView.SetSize(GRoot.inst.width, GRoot.inst.height); _mainView.AddRelation(GRoot.inst, RelationType.Size); GRoot.inst.AddChild(_mainView); _list = _mainView.GetChild("mailList").asList; for (int i = 0; i < 10; i++) { MailItem item = (MailItem)_list.AddItemFromPool(); item.setFetched(i % 3 == 0); item.setRead(i % 2 == 0); item.setTime("5 Nov 2015 16:24:33"); item.title = "Mail title here"; } _list.EnsureBoundsCorrect(); float delay = 0f; for (int i = 0; i < 10; i++) { MailItem item = (MailItem)_list.GetChildAt(i); if (_list.IsChildInView(item)) { item.PlayEffect(delay); delay += 0.2f; } else break; } }
void Start() { Application.targetFrameRate = 60; GRoot.inst.SetContentScaleFactor(1136, 640); Stage.inst.onKeyDown.Add(OnKeyDown); UIPackage.AddPackage("UI/LoopList"); _mainView = UIPackage.CreateObject("LoopList", "Main").asCom; _mainView.fairyBatching = true; _mainView.SetSize(GRoot.inst.width, GRoot.inst.height); _mainView.AddRelation(GRoot.inst, RelationType.Size); GRoot.inst.AddChild(_mainView); _list = _mainView.GetChild("list").asList; _list.SetVirtualAndLoop(); _list.itemRenderer = RenderListItem; _list.numItems = 5; _list.scrollPane.onScroll.Add(DoSpecialEffect); DoSpecialEffect(); }
void Start() { Application.targetFrameRate = 60; DontDestroyOnLoad(this.gameObject); Stage.Instantiate(5); Stage.inst.AddChild(new GRoot().displayObject); Stage.inst.camera.clearFlags = CameraClearFlags.Depth; Stage.inst.onKeyDown.Add(OnKeyDown); GRoot.inst.SetContentScaleFactor(1136, 640); UIPackage.AddPackage("UI/EmojiDemo"); UIConfig.verticalScrollBar = UIPackage.GetItemURL("Demo", "ScrollBar_VT"); UIConfig.defaultScrollBarDisplay = ScrollBarDisplayType.Auto; _mainView = UIPackage.CreateObject("Demo", "Main").asCom; _mainView.SetSize(GRoot.inst.width, GRoot.inst.height); _mainView.AddRelation(GRoot.inst, RelationType.Size); GRoot.inst.AddChild(_mainView); _list = _mainView.GetChild("list").asList; _list.RemoveChildrenToPool(); _input = _mainView.GetChild("input").asTextInput; _input.onKeyDown.Add(__inputKeyDown); _itemURL1 = UIPackage.GetItemURL("Demo", "chatLeft"); _itemURL2 = UIPackage.GetItemURL("Demo", "chatRight"); _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn); _mainView.GetChild("btnEmoji").onClick.Add(__clickEmojiBtn); _emojiSelectUI = UIPackage.CreateObject("Demo", "EmojiSelectUI").asCom; _emojiSelectUI.GetChild("list").asList.onClickItem.Add(__clickEmoji); }
public override void ConstructFromXML(XML cxml) { base.ConstructFromXML(cxml); XML xml = cxml.GetNode("ComboBox"); string str; _buttonController = GetController("button"); _titleObject = GetChild("title") as GTextField; str = xml.GetAttribute("dropdown"); if (str != null && str.Length > 0) { dropdown = UIPackage.CreateObjectFromURL(str) as GComponent; if (dropdown == null) { Debug.LogWarning("FairyGUI: " + this.resourceURL + " should be a component."); return; } _list = dropdown.GetChild("list") as GList; if (_list == null) { Debug.LogWarning("FairyGUI: " + this.resourceURL + ": should container a list component named list."); return; } _list.onClickItem.Add(__clickItem); _list.AddRelation(dropdown, RelationType.Width); _list.RemoveRelation(dropdown, RelationType.Height); dropdown.AddRelation(_list, RelationType.Height); dropdown.RemoveRelation(_list, RelationType.Width); } displayObject.onRollOver.Add(__rollover); displayObject.onRollOut.Add(__rollout); displayObject.onTouchBegin.Add(__touchBegin); displayObject.onTouchEnd.Add(__touchEnd); }
void Create(string resourceURL) { if (resourceURL == null) { resourceURL = UIConfig.popupMenu; if (resourceURL == null) { Debug.LogError("FairyGUI: UIConfig.popupMenu not defined"); return; } } _contentPane = UIPackage.CreateObjectFromURL(resourceURL).asCom; _contentPane.onAddedToStage.Add(__addedToStage); _list = _contentPane.GetChild("list").asList; _list.RemoveChildrenToPool(); _list.AddRelation(_contentPane, RelationType.Width); _list.RemoveRelation(_contentPane, RelationType.Height); _contentPane.AddRelation(_list, RelationType.Height); _list.onClickItem.Add(__clickItem); }
void Start() { Application.targetFrameRate = 60; Stage.inst.onKeyDown.Add(OnKeyDown); _itemURL1 = UIPackage.GetItemURL("EmojiPro", "chatLeft"); _itemURL2 = UIPackage.GetItemURL("EmojiPro", "chatRight"); _messages = new List<Message>(); _mainView = this.GetComponent<UIPanel>().ui; _list = _mainView.GetChild("list").asList; _list.defaultItem = _itemURL1; _list.SetVirtual(); _list.itemProvider = GetListItemResource; _list.itemRenderer = RenderListItem; _input = _mainView.GetChild("input").asTextInput; _input.onKeyDown.Add(__inputKeyDown); //作为demo,这里只添加了部分表情素材 _emojies = new Dictionary<uint, Emoji>(); for (uint i = 0x1f600; i < 0x1f637; i++) { string url = UIPackage.GetItemURL("EmojiPro", Convert.ToString(i, 16)); if (url != null) _emojies.Add(i, new Emoji(url)); } _input.emojies = _emojies; _mainView.GetChild("btnSend").onClick.Add(__clickSendBtn); }
void Start() { _mainView = this.GetComponent<UIPanel>().ui; _list = _mainView.GetChild("list").asList; _list.itemRenderer = RenderListItem; _list.SetVirtual(); _list.numItems = 1000; _list.onTouchBegin.Add(OnClickList); _mainView.GetChild("box").asCom.onDrop.Add(OnDrop); LongPressGesture gesture = new LongPressGesture(_list); gesture.once = true; gesture.trigger = 1f; gesture.onAction.Add(OnLongPress); }