C# Class FairyGUI.Window

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
Afficher le fichier Open project: fairygui/FairyGUI-unity Class Usage Examples

Protected Properties

Свойство Type Description
_requestingCmd int

Méthodes publiques

Méthode Description
AddUISource ( IUISource source ) : void

Set a UISource to this window. It must call before the window is shown. When the window is first time to show, UISource.Load is called. Only after all UISource is loaded, the window will continue to init. 为窗口添加一个源。这个方法建议在构造函数调用。当窗口第一次显示前,UISource的Load方法将被调用,然后只有所有的UISource 都ready后,窗口才会继续初始化和显示。

BringToFront ( ) : void

CenterOn ( GRoot r, bool restraint ) : void

Make the window be center of the screen.

CloseModalWait ( ) : bool

CloseModalWait ( int requestingCmd ) : bool

Close modal waiting. If rquestingCmd is equal to the value you transfer in ShowModalWait, mowal wait will be closed. Otherwise, this function has no effect. 关闭模式等待。如果requestingCmd和ShowModalWait传入的不相同,则这个函数没有任何动作,立即返回。

Dispose ( ) : void
Hide ( ) : void

HideImmediately ( ) : void

Hide window immediately, no OnHide will be called.

Init ( ) : void

Show ( ) : void

ShowModalWait ( ) : void

ShowModalWait ( int requestingCmd ) : void

Display a modal waiting sign in the front. 显示一个等待标志在最前面。等待标志的资源可以通过UIConfig.windowModalWaiting。等待标志组件会设置为屏幕大小,请内部做好关联。 还可以设定一个requestingCmd作为等待的命令字,在CloseModalWait里传入相同的命令字ModalWait将结束,否则CloseModalWait无效。

ShowOn ( GRoot r ) : void

ToggleStatus ( ) : void

Switch show and hide status.

Window ( ) : System.Collections.Generic

Méthodes protégées

Méthode Description
DoHideAnimation ( ) : void

DoShowAnimation ( ) : void

LayoutModalWaitPane ( ) : void
OnHide ( ) : void

OnInit ( ) : void

OnShown ( ) : void

__onHide ( ) : void
__onShown ( ) : void
__uiLoadComplete ( ) : void
_init ( ) : void
closeEventHandler ( ) : void

Private Methods

Méthode Description
__dragStart ( EventContext context ) : void
__touchBegin ( EventContext context ) : void

Method Details

AddUISource() public méthode

Set a UISource to this window. It must call before the window is shown. When the window is first time to show, UISource.Load is called. Only after all UISource is loaded, the window will continue to init. 为窗口添加一个源。这个方法建议在构造函数调用。当窗口第一次显示前,UISource的Load方法将被调用,然后只有所有的UISource 都ready后,窗口才会继续初始化和显示。
public AddUISource ( IUISource source ) : void
source IUISource
Résultat void

BringToFront() public méthode

public BringToFront ( ) : void
Résultat void

CenterOn() public méthode

Make the window be center of the screen.
public CenterOn ( GRoot r, bool restraint ) : void
r GRoot
restraint bool Add relations to ensure keeping center on screen size changed.
Résultat void

CloseModalWait() public méthode

public CloseModalWait ( ) : bool
Résultat bool

CloseModalWait() public méthode

Close modal waiting. If rquestingCmd is equal to the value you transfer in ShowModalWait, mowal wait will be closed. Otherwise, this function has no effect. 关闭模式等待。如果requestingCmd和ShowModalWait传入的不相同,则这个函数没有任何动作,立即返回。
public CloseModalWait ( int requestingCmd ) : bool
requestingCmd int
Résultat bool

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DoHideAnimation() protected méthode

protected DoHideAnimation ( ) : void
Résultat void

DoShowAnimation() protected méthode

protected DoShowAnimation ( ) : void
Résultat void

Hide() public méthode

public Hide ( ) : void
Résultat void

HideImmediately() public méthode

Hide window immediately, no OnHide will be called.
public HideImmediately ( ) : void
Résultat void

Init() public méthode

public Init ( ) : void
Résultat void

LayoutModalWaitPane() protected méthode

protected LayoutModalWaitPane ( ) : void
Résultat void

OnHide() protected méthode

protected OnHide ( ) : void
Résultat void

OnInit() protected méthode

protected OnInit ( ) : void
Résultat void

OnShown() protected méthode

protected OnShown ( ) : void
Résultat void

Show() public méthode

public Show ( ) : void
Résultat void

ShowModalWait() public méthode

public ShowModalWait ( ) : void
Résultat void

ShowModalWait() public méthode

Display a modal waiting sign in the front. 显示一个等待标志在最前面。等待标志的资源可以通过UIConfig.windowModalWaiting。等待标志组件会设置为屏幕大小,请内部做好关联。 还可以设定一个requestingCmd作为等待的命令字,在CloseModalWait里传入相同的命令字ModalWait将结束,否则CloseModalWait无效。
public ShowModalWait ( int requestingCmd ) : void
requestingCmd int
Résultat void

ShowOn() public méthode

public ShowOn ( GRoot r ) : void
r GRoot
Résultat void

ToggleStatus() public méthode

Switch show and hide status.
public ToggleStatus ( ) : void
Résultat void

Window() public méthode

public Window ( ) : System.Collections.Generic
Résultat System.Collections.Generic

__onHide() protected méthode

protected __onHide ( ) : void
Résultat void

__onShown() protected méthode

protected __onShown ( ) : void
Résultat void

__uiLoadComplete() protected méthode

protected __uiLoadComplete ( ) : void
Résultat void

_init() protected méthode

protected _init ( ) : void
Résultat void

closeEventHandler() protected méthode

protected closeEventHandler ( ) : void
Résultat void

Property Details

_requestingCmd protected_oe property

protected int _requestingCmd
Résultat int