当前位置: 首页 > 工具软件 > CanTK > 使用案例 >

GameBuilder开发游戏应用系列之Cantk窗口生命周期

舒博雅
2023-12-01

Cantk中的窗口(UIWindow/UIScene)与Android的Activity等组件一样有完整的生命周期,假设我的Web应用有两个窗口:FirstWindow,SecondWindow,整个应用的生命应该如下图所示:

Created with Raphaël 2.1.2 FirstWindow FirstWindow SecondWindow SecondWindow 1、FirstWindow's onSystemInit called 2、SecondWindow's onSystemInit called 3、FirstWindow's onLoad called 4、SecondWindow's onLoad called 5、FirstWindow's onBeforeOpen called 6、FirstWindow's onOpen called switch to SecondWindow 7、SecondWindow's onBeforeOpen called 8、FirstWindow's onSwitchToBack called 9、SecondWindow's onOpen called switch back to FirstWindow 10、FirstWindow's onSwitchToFront called 11、SecondWindow's onClose called 12、FirstWindow's onClose called 13、FirstWindow's onUnload called 14、SecondWindow's onUnload called

流程相关事件的连接:

生命周期的在线demo:

 类似资料: