Click or drag to resize
Controller Class
Controller class. 控制器类。控制器的创建和设计需通过编辑器完成,不建议使用代码创建。 最常用的方法是通过selectedIndex获得或改变控制器的活动页面。如果要获得控制器页面改变的通知,使用onChanged事件。
Inheritance Hierarchy
SystemObject
  FairyGUIEventDispatcher
    FairyGUIController

Namespace: FairyGUI
Assembly: FairyGUI (in FairyGUI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Controller : EventDispatcher

The Controller type exposes the following members.

Constructors
  NameDescription
Public methodController
Initializes a new instance of the Controller class
Top
Methods
  NameDescription
Public methodAddEventListener(String, EventCallback0)
(Inherited from EventDispatcher.)
Public methodAddEventListener(String, EventCallback1)
(Inherited from EventDispatcher.)
Public methodAddPage
Add a new page to this controller.
Public methodAddPageAt
Add a new page to this controller at a certain index.
Public methodBroadcastEvent
(Inherited from EventDispatcher.)
Public methodBubbleEvent
(Inherited from EventDispatcher.)
Public methodClearPages
Remove all pages.
Public methodDispatchEvent(String)
(Inherited from EventDispatcher.)
Public methodDispatchEvent(EventContext)
(Inherited from EventDispatcher.)
Public methodDispatchEvent(String, Object)
(Inherited from EventDispatcher.)
Public methodDispatchEvent(String, Object, Object) (Inherited from EventDispatcher.)
Public methodGetPageIdByName
Get page id by name
Public methodGetPageName
Get page name by an index. 通过页面索引获得页面名称。
Public methodHasPage
Check if the controller has a page.
Public methodRemoveEventListener(String, EventCallback0)
(Inherited from EventDispatcher.)
Public methodRemoveEventListener(String, EventCallback1)
(Inherited from EventDispatcher.)
Public methodRemoveEventListeners
(Inherited from EventDispatcher.)
Public methodRemoveEventListeners(String)
(Inherited from EventDispatcher.)
Public methodRemovePage
Remove a page.
Public methodRemovePageAt
Removes a page at a certain index.
Public methodSetSelectedIndex
Set current page index, no onChanged event. 通过索引设置当前活动页面,和selectedIndex的区别在于,这个方法不会触发onChanged事件。
Public methodSetSelectedPage
Set current page by name, no onChanged event. 通过页面名称设置当前活动页面,和selectedPage的区别在于,这个方法不会触发onChanged事件。
Public methodSetup
Top
Fields
  NameDescription
Public fieldname
Name of the controller 控制器名称。
Top
Properties
  NameDescription
Public propertyonChanged
When controller page changed. 当控制器活动页面改变时,此事件被触发。
Public propertypageCount
Page count of this controller. 获得页面数量。
Public propertypreviousPage
Previous page name. 获得上次活动页面名称。
Public propertyprevisousIndex
Previouse page index. 获得上次活动页面索引
Public propertyselectedIndex
Current page index. 获得或设置当前活动页面索引。
Public propertyselectedPage
Current page name. 获得当前活动页面名称
Top
See Also