diff --git a/assets/Script/example/UIExample.ts b/assets/Script/example/UIExample.ts new file mode 100644 index 0000000..1d55cd2 --- /dev/null +++ b/assets/Script/example/UIExample.ts @@ -0,0 +1,31 @@ +// Learn TypeScript: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html +// Learn Attribute: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html +// Learn life-cycle callbacks: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html + +const {ccclass, property} = cc._decorator; + +@ccclass +export default class NewClass extends cc.Component { + + @property(cc.Label) + label: cc.Label = null; + + @property + text: string = 'hello'; + + // LIFE-CYCLE CALLBACKS: + + // onLoad () {} + + start () { + + } + + // update (dt) {} +} diff --git a/assets/Script/example/UIExample.ts.meta b/assets/Script/example/UIExample.ts.meta new file mode 100644 index 0000000..cb8b47c --- /dev/null +++ b/assets/Script/example/UIExample.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "1ac134aa-f1cc-4b29-9b50-7b5842828af4", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/example/uiviews.meta b/assets/Script/example/uiviews.meta new file mode 100644 index 0000000..f7bf95d --- /dev/null +++ b/assets/Script/example/uiviews.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "617085ba-564f-4bee-8dcd-8b6f47e9e5c0", + "isSubpackage": false, + "subpackageName": "", + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/example/uiviews/UIBag.ts b/assets/Script/example/uiviews/UIBag.ts new file mode 100644 index 0000000..dd9c4bd --- /dev/null +++ b/assets/Script/example/uiviews/UIBag.ts @@ -0,0 +1,30 @@ +import { UIView } from "../../ui/UIView"; + +// Learn TypeScript: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html +// Learn Attribute: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html +// Learn life-cycle callbacks: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html + +const {ccclass, property} = cc._decorator; + +@ccclass +export default class UIBag extends UIView { + private selectItem: number = 0; + + public init() { + + } + + public onClick(event) { + this.selectItem = event.node.getTag(); + } + + public onClose(): any { + return this.selectItem; + } +} diff --git a/assets/Script/example/uiviews/UIBag.ts.meta b/assets/Script/example/uiviews/UIBag.ts.meta new file mode 100644 index 0000000..86e73f7 --- /dev/null +++ b/assets/Script/example/uiviews/UIBag.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "fca32edd-d4a8-4b8a-aea7-cc894b82d0a3", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/example/uiviews/UIHall.ts b/assets/Script/example/uiviews/UIHall.ts new file mode 100644 index 0000000..1d55cd2 --- /dev/null +++ b/assets/Script/example/uiviews/UIHall.ts @@ -0,0 +1,31 @@ +// Learn TypeScript: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html +// Learn Attribute: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html +// Learn life-cycle callbacks: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html + +const {ccclass, property} = cc._decorator; + +@ccclass +export default class NewClass extends cc.Component { + + @property(cc.Label) + label: cc.Label = null; + + @property + text: string = 'hello'; + + // LIFE-CYCLE CALLBACKS: + + // onLoad () {} + + start () { + + } + + // update (dt) {} +} diff --git a/assets/Script/example/uiviews/UIHall.ts.meta b/assets/Script/example/uiviews/UIHall.ts.meta new file mode 100644 index 0000000..78700ab --- /dev/null +++ b/assets/Script/example/uiviews/UIHall.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "f33533b6-6dcf-44b1-b345-90d71f0f9fcc", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/example/uiviews/UILogin.ts b/assets/Script/example/uiviews/UILogin.ts new file mode 100644 index 0000000..1d55cd2 --- /dev/null +++ b/assets/Script/example/uiviews/UILogin.ts @@ -0,0 +1,31 @@ +// Learn TypeScript: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html +// Learn Attribute: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html +// Learn life-cycle callbacks: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html + +const {ccclass, property} = cc._decorator; + +@ccclass +export default class NewClass extends cc.Component { + + @property(cc.Label) + label: cc.Label = null; + + @property + text: string = 'hello'; + + // LIFE-CYCLE CALLBACKS: + + // onLoad () {} + + start () { + + } + + // update (dt) {} +} diff --git a/assets/Script/example/uiviews/UILogin.ts.meta b/assets/Script/example/uiviews/UILogin.ts.meta new file mode 100644 index 0000000..f04091a --- /dev/null +++ b/assets/Script/example/uiviews/UILogin.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "969accd6-77d9-473a-95f7-c28bb820df79", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/example/uiviews/UINotice.ts b/assets/Script/example/uiviews/UINotice.ts new file mode 100644 index 0000000..1d55cd2 --- /dev/null +++ b/assets/Script/example/uiviews/UINotice.ts @@ -0,0 +1,31 @@ +// Learn TypeScript: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html +// Learn Attribute: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html +// Learn life-cycle callbacks: +// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html +// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html + +const {ccclass, property} = cc._decorator; + +@ccclass +export default class NewClass extends cc.Component { + + @property(cc.Label) + label: cc.Label = null; + + @property + text: string = 'hello'; + + // LIFE-CYCLE CALLBACKS: + + // onLoad () {} + + start () { + + } + + // update (dt) {} +} diff --git a/assets/Script/example/uiviews/UINotice.ts.meta b/assets/Script/example/uiviews/UINotice.ts.meta new file mode 100644 index 0000000..e265588 --- /dev/null +++ b/assets/Script/example/uiviews/UINotice.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "db8814dd-4cb8-4cd1-9fce-d9743f13d99c", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/resources/Prefab/Hall.prefab b/assets/resources/Prefab/Hall.prefab index 39ca3d1..2eed915 100644 --- a/assets/resources/Prefab/Hall.prefab +++ b/assets/resources/Prefab/Hall.prefab @@ -60,8 +60,8 @@ }, "_position": { "__type__": "cc.Vec3", - "x": 0, - "y": 0, + "x": 480, + "y": 320, "z": 0 }, "_scale": { @@ -184,7 +184,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "73jYudLNhCiY+y6aMxHNv1", "sync": false @@ -422,7 +422,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "35Gt4sMgRIIaG5dLN24mul", "sync": false @@ -492,7 +492,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "d4C43iXz5BO4Xh0AKF6HVr", "sync": false @@ -583,7 +583,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "2dYnb9xf9Mb4YnhV8B6/t4", "sync": false @@ -821,7 +821,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "5eX104gY1PFKNAtPiq0L3C", "sync": false @@ -891,7 +891,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "1efz1WAbpHxJnYEY22Y89m", "sync": false @@ -982,7 +982,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "67+z6g6uRAdre96hz/YT0k", "sync": false @@ -1052,7 +1052,7 @@ "__id__": 1 }, "asset": { - "__id__": 0 + "__uuid__": "cb6fb71a-9a7f-4197-b686-362c0521d8a1" }, "fileId": "cfy5RHHVZC6bfge/nxZ/9w", "sync": false