新增windTransition例子
This commit is contained in:
@@ -4,6 +4,7 @@ module FUI.sc {
|
||||
|
||||
export class UI_View_sc extends fairygui.GComponent {
|
||||
public m_list_sc:fairygui.GList;
|
||||
public m_combo_transition:fairygui.GComboBox;
|
||||
public static URL:string = "ui://m4sln17ak7mf0";
|
||||
|
||||
public static createInstance():UI_View_sc {
|
||||
@@ -14,6 +15,7 @@ module FUI.sc {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_list_sc = <fairygui.GList>(this.getChildAt(0));
|
||||
this.m_combo_transition = <fairygui.GComboBox>(this.getChildAt(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
19
demo/src/Fgui/sc/UI_combo_sc_popup.ts
Normal file
19
demo/src/Fgui/sc/UI_combo_sc_popup.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.sc {
|
||||
|
||||
export class UI_combo_sc_popup extends fairygui.GComponent {
|
||||
public m_list:fairygui.GList;
|
||||
public static URL:string = "ui://m4sln17ajde14";
|
||||
|
||||
public static createInstance():UI_combo_sc_popup {
|
||||
return <UI_combo_sc_popup>(fairygui.UIPackage.createObject("sc", "combo_sc_popup"));
|
||||
}
|
||||
|
||||
protected constructFromXML(xml:any):void {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_list = <fairygui.GList>(this.getChildAt(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ module FUI.sc {
|
||||
|
||||
export class scBinder {
|
||||
public static bindAll():void {
|
||||
fairygui.UIObjectFactory.setPackageItemExtension(UI_combo_sc_popup.URL, UI_combo_sc_popup);
|
||||
fairygui.UIObjectFactory.setPackageItemExtension(UI_View_sc.URL, UI_View_sc);
|
||||
fairygui.UIObjectFactory.setPackageItemExtension(UI_btn_sc.URL, UI_btn_sc);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@ module sc {
|
||||
new SceneData("Ninja Adventure", samples.NinjaAdventureScene),
|
||||
];
|
||||
|
||||
private _transitionList: TransitionData[] = [
|
||||
new TransitionData("渐变", es.FadeTransition),
|
||||
new TransitionData("wind", es.WindTransition),
|
||||
];
|
||||
|
||||
constructor() {
|
||||
super("sc");
|
||||
}
|
||||
@@ -22,6 +27,11 @@ module sc {
|
||||
this._ui.m_list_sc.callbackThisObj = this;
|
||||
this._ui.m_list_sc.itemRenderer = this.scItemRender;
|
||||
this._ui.m_list_sc.numItems = this._sceneList.length;
|
||||
|
||||
for (let i = 0; i < this._transitionList.length; i ++){
|
||||
this._ui.m_combo_transition.items.push(this._transitionList[i].name);
|
||||
}
|
||||
this._ui.m_combo_transition.selectedIndex = 0;
|
||||
}
|
||||
|
||||
public scItemRender(index: number, item: FUI.sc.UI_btn_sc){
|
||||
@@ -33,7 +43,8 @@ module sc {
|
||||
|
||||
private scItemOnClick(evt: egret.Event){
|
||||
let data = evt.currentTarget.data;
|
||||
es.Core.startSceneTransition(new es.FadeTransition(()=>{
|
||||
let currentTransition = this._transitionList[this._ui.m_combo_transition.selectedIndex].type;
|
||||
es.Core.startSceneTransition(new currentTransition(()=>{
|
||||
es.Core.scene.camera.position = es.Vector2.zero;
|
||||
return new data();
|
||||
}));
|
||||
@@ -57,4 +68,14 @@ module sc {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
export class TransitionData {
|
||||
public name: string;
|
||||
public type: any;
|
||||
|
||||
constructor(name: string, type: any){
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user