Window class. 窗口使用前首先要设置窗口中需要显示的内容,这通常是在编辑器里制作好的,可以直接使用Window.contentPane进行设置。 建议把设置contentPane等初始化操作放置到Window.onInit方法中。 另外,FairyGUI还提供了一套机制用于窗口动态创建。动态创建是指初始时仅指定窗口需要使用的资源,等窗口需要显示时才实际开始构建窗口的内容。 首先需要在窗口的构造函数中调用Window.addUISource。这个方法需要一个IUISource类型的参数,而IUISource是一个接口, 用户需要自行实现载入相关UI包的逻辑。当窗口第一次显示之前,IUISource的加载方法将会被调用,并等待载入完成后才返回执行Window.OnInit,然后窗口才会显示。 如果你需要窗口显示时播放动画效果,那么覆盖doShowAnimation编写你的动画代码,并且在动画结束后调用onShown。覆盖onShown编写其他需要在窗口显示时处理的业务逻辑。 如果你需要窗口隐藏时播放动画效果,那么覆盖doHideAnimation编写你的动画代码,并且在动画结束时调用Window.hideImmediately(注意不是直接调用onHide!)。覆盖onHide编写其他需要在窗口隐藏时处理的业务逻辑。
Inheritance: GComponent
Exemplo n.º 1
0
    static int set_modal(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window obj  = (FairyGUI.Window)o;
            bool            arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.modal = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index modal on a nil value"));
        }
    }
Exemplo n.º 2
0
    static int get_modalWaitingPane(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window  obj = (FairyGUI.Window)o;
            FairyGUI.GObject ret = obj.modalWaitingPane;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index modalWaitingPane on a nil value" : e.Message));
        }
    }
Exemplo n.º 3
0
    static int get_bringToFontOnClick(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window obj = (FairyGUI.Window)o;
            bool            ret = obj.bringToFontOnClick;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bringToFontOnClick on a nil value" : e.Message));
        }
    }
Exemplo n.º 4
0
    static int get_modalWaiting(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window obj = (FairyGUI.Window)o;
            bool            ret = obj.modalWaiting;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index modalWaiting on a nil value"));
        }
    }
Exemplo n.º 5
0
    static int set_contentArea(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window  obj  = (FairyGUI.Window)o;
            FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject <FairyGUI.GObject>(L, 2);
            obj.contentArea = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index contentArea on a nil value"));
        }
    }
Exemplo n.º 6
0
    static int get_contentArea(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window  obj = (FairyGUI.Window)o;
            FairyGUI.GObject ret = obj.contentArea;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index contentArea on a nil value"));
        }
    }
Exemplo n.º 7
0
    static int get_frame(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window     obj = (FairyGUI.Window)o;
            FairyGUI.GComponent ret = obj.frame;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index frame on a nil value"));
        }
    }
    static int set_dragArea(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window  obj  = (FairyGUI.Window)o;
            FairyGUI.GObject arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject));
            obj.dragArea = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index dragArea on a nil value" : e.Message));
        }
    }
    static int set_bringToFontOnClick(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.Window obj  = (FairyGUI.Window)o;
            bool            arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.bringToFontOnClick = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bringToFontOnClick on a nil value" : e.Message));
        }
    }
Exemplo n.º 10
0
    static int _CreateFairyGUI_Window(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                FairyGUI.Window obj = new FairyGUI.Window();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.Window.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 11
0
 /// <summary>
 /// Display a window.
 /// </summary>
 /// <param name="win"></param>
 public void ShowWindow(Window win)
 {
     AddChild(win);
     AdjustModalLayer();
 }
Exemplo n.º 12
0
        /// <summary>
        /// Display a window.
        /// </summary>
        /// <param name="win"></param>
        public void ShowWindow(Window win)
        {
            AddChild(win);

            if (win.x > this.width)
                win.x = this.width - win.width;
            else if (win.x + win.width < 0)
                win.x = 0;
            if (win.y > this.height)
                win.y = this.height - win.height;
            else if (win.y + win.height < 0)
                win.y = 0;

            AdjustModalLayer();
        }
Exemplo n.º 13
0
        /// <summary>
        /// Remove a window from stage immediatelly. window.Hide/window.OnHide will never be called.
        /// 立刻关闭一个窗口。不会调用Window.Hide方法,Window.OnHide也不会被调用。
        /// </summary>
        /// <param name="win"></param>
        /// <param name="dispose">True to dispose the window.</param>
        public void HideWindowImmediately(Window win, bool dispose)
        {
            if (win.parent == this)
                RemoveChild(win, dispose);
            else if (dispose)
                win.Dispose();

            AdjustModalLayer();
        }
Exemplo n.º 14
0
 /// <summary>
 /// Remove a window from stage immediatelly. window.Hide/window.OnHide will never be called.
 ///立刻关闭一个窗口。不会调用Window.Hide方法,Window.OnHide也不会被调用。
 /// </summary>
 /// <param name="win"></param>
 public void HideWindowImmediately(Window win)
 {
     HideWindowImmediately(win, false);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Call window.Hide
 /// 关闭一个窗口。将调用Window.Hide方法。
 /// </summary>
 /// <param name="win"></param>
 public void HideWindow(Window win)
 {
     win.Hide();
 }
Exemplo n.º 16
0
        /// <summary>
        /// 将一个窗口提到所有窗口的最前面
        /// </summary>
        /// <param name="win"></param>
        public void BringToFront(Window win)
        {
            int cnt = this.numChildren;
            int i;
            if (this._modalLayer.parent != null && !win.modal)
                i = this.GetChildIndex(this._modalLayer) - 1;
            else
                i = cnt - 1;

            for (; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if (g == win)
                    return;
                if (g is Window)
                    break;
            }

            if (i >= 0)
                this.SetChildIndex(win, i);
        }
Exemplo n.º 17
0
 /// <summary>
 /// Call window.Hide
 /// 关闭一个窗口。将调用Window.Hide方法。
 /// </summary>
 /// <param name="win"></param>
 public void HideWindow(Window win)
 {
     win.Hide();
 }
Exemplo n.º 18
0
 /// <summary>
 /// Remove a window from stage immediatelly. window.Hide/window.OnHide will never be called.
 ///立刻关闭一个窗口。不会调用Window.Hide方法,Window.OnHide也不会被调用。
 /// </summary>
 /// <param name="win"></param>
 public void HideWindowImmediately(Window win)
 {
     HideWindowImmediately(win, false);
 }