Commit 44a290e9 authored by Edwise's avatar Edwise 🍷

123

parent 232ff81b
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
background-color: #f5cccd; background-color: #fff;
/* background: linear-gradient(#93dbb7,#ff0,#b5d89a); */ /* background: linear-gradient(#93dbb7,#ff0,#b5d89a); */
/* background: linear-gradient(#93dbb7,#b5d89a); */ /* background: linear-gradient(#93dbb7,#b5d89a); */
} }
......
This diff is collapsed.
This diff is collapsed.
import { promises } from "fs";
interface ResData { interface ResData {
...@@ -138,7 +139,6 @@ export namespace RES { ...@@ -138,7 +139,6 @@ export namespace RES {
return p; return p;
} }
/** /**
* 根据组名加载一组资源,通常用于加载一个视图的的所有资源 * 根据组名加载一组资源,通常用于加载一个视图的的所有资源
* 里的promise的resolve并没有返回值 * 里的promise的resolve并没有返回值
......
...@@ -1683,10 +1683,12 @@ var StartScene = (function (_super) { ...@@ -1683,10 +1683,12 @@ var StartScene = (function (_super) {
return _super !== null && _super.apply(this, arguments) || this; return _super !== null && _super.apply(this, arguments) || this;
} }
StartScene.prototype.initUi = function () { StartScene.prototype.initUi = function () {
var _this = this;
_super.prototype.initUi.call(this); _super.prototype.initUi.call(this);
var canvas = new FYGE.Container(); var canvas = new FYGE.Container();
canvas.position.set(0, 0); canvas.position.set(0, 0);
this.addChild(canvas); this.addChild(canvas);
SvgaParser.loadSvga("//yun.duiba.com.cn/spark/assets/yuyu1.6473bb2ef640b556f35096428847216e72499d90.svga", function (e) { _this.addChild(new FYGE.MovieClip(e)); });
}; };
StartScene.prototype.start = function () { StartScene.prototype.start = function () {
this.addChild(new Root_1.default()); this.addChild(new Root_1.default());
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
"uglifyjs-webpack-plugin": "^2.1.2", "uglifyjs-webpack-plugin": "^2.1.2",
"psd": "^3.2.0" "psd": "^3.2.0"
}, },
"dependencies": {}, "dependencies": {
"tans_lottie": "^1.0.4"
},
"scripts": { "scripts": {
"psd": "node scripts/psdH.js && node scripts/flushRes", "psd": "node scripts/psdH.js && node scripts/flushRes",
"createModule": "node scripts/createModule", "createModule": "node scripts/createModule",
......
import * as FYGE from "fyge-tbmini"; import * as FYGE from "fyge-tbmini";
import * as SvgaParser from "svga-parser";
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(); module.exports = factory();
...@@ -1684,10 +1685,12 @@ var StartScene = (function (_super) { ...@@ -1684,10 +1685,12 @@ var StartScene = (function (_super) {
return _super !== null && _super.apply(this, arguments) || this; return _super !== null && _super.apply(this, arguments) || this;
} }
StartScene.prototype.initUi = function () { StartScene.prototype.initUi = function () {
var _this = this;
_super.prototype.initUi.call(this); _super.prototype.initUi.call(this);
var canvas = new FYGE.Container(); var canvas = new FYGE.Container();
canvas.position.set(0, 0); canvas.position.set(0, 0);
this.addChild(canvas); this.addChild(canvas);
SvgaParser.loadSvga("//yun.duiba.com.cn/spark/assets/yuyu1.6473bb2ef640b556f35096428847216e72499d90.svga", function (e) { _this.addChild(new FYGE.MovieClip(e)); });
}; };
StartScene.prototype.start = function () { StartScene.prototype.start = function () {
this.addChild(new Root_1.default()); this.addChild(new Root_1.default());
......
...@@ -16,6 +16,198 @@ const resCanvasList = { ...@@ -16,6 +16,198 @@ const resCanvasList = {
ext: '.png', ext: '.png',
uuid: '593e9d74-4944-496a-b6c1-8316756f8bf7', uuid: '593e9d74-4944-496a-b6c1-8316756f8bf7',
url: '//yun.duiba.com.cn/spark/assets/022e25a3984ff122fbf960bd0cb87bff48f8c3bf.png' url: '//yun.duiba.com.cn/spark/assets/022e25a3984ff122fbf960bd0cb87bff48f8c3bf.png'
},
'3a105062-4474-4f37-abd2-fa9471e2536f': {
name: 'blueCatHand',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/blueCatHand.ebb0e7dfe53c3a347d8e1f118367eed31e0b486e.png',
uuid: '3a105062-4474-4f37-abd2-fa9471e2536f'
},
'ceb650c2-9620-4b5b-ad34-c95af25d77ce': {
name: '寝室',
ext: '.png',
uuid: 'ceb650c2-9620-4b5b-ad34-c95af25d77ce',
url: '//yun.duiba.com.cn/spark/assets/5b641238d5b0c00f8740b355cc0f1130446c8b1c.png'
},
'52c9cc35-c220-4dac-9c26-639b88a043b3': {
name: '操场',
ext: '.png',
uuid: '52c9cc35-c220-4dac-9c26-639b88a043b3',
url: '//yun.duiba.com.cn/spark/assets/9c1601507f8730bcb0faf70316feec41bd73cb9b.png'
},
'3ebdda49-754c-42e5-bfb3-daefa9835fb5': {
name: '教室',
ext: '.png',
uuid: '3ebdda49-754c-42e5-bfb3-daefa9835fb5',
url: '//yun.duiba.com.cn/spark/assets/afd87964074d1773e12fe5cb8745dcccdf33dcbe.png'
},
'483dbc34-2962-4483-8968-71e3cc5182b9': {
name: '玩耍猫',
ext: '.png',
uuid: '483dbc34-2962-4483-8968-71e3cc5182b9',
url: '//yun.duiba.com.cn/spark/assets/22dadf423774977a16f9dd59268e9881497fa14d.png'
},
'42c18212-4b77-4374-9f6f-85dd3a51231b': {
name: '摸头猫',
ext: '.png',
uuid: '42c18212-4b77-4374-9f6f-85dd3a51231b',
url: '//yun.duiba.com.cn/spark/assets/5f3fdef50db2c5e8c1ca055c40e64264e2475482.png'
},
'8177c25e-479a-4159-89c5-19553dfed48c': {
name: '睡觉猫',
ext: '.png',
uuid: '8177c25e-479a-4159-89c5-19553dfed48c',
url: '//yun.duiba.com.cn/spark/assets/e34dbe47443a53364675d78fa75fffd9d49dd015.png'
},
'23c9550c-72a6-427f-aa1b-50373559a485': {
name: '说话猫',
ext: '.png',
uuid: '23c9550c-72a6-427f-aa1b-50373559a485',
url: '//yun.duiba.com.cn/spark/assets/e9a8b57d70cdc67dbb63baadb155e766b7bad74c.png'
},
'f33f7958-d257-4908-9ec1-a2da61d964ae': {
name: '梳毛猫',
ext: '.png',
uuid: 'f33f7958-d257-4908-9ec1-a2da61d964ae',
url: '//yun.duiba.com.cn/spark/assets/8db9f39eb8157ce516b87ea0ce53175973d0d78b.png'
},
'90cfa014-f89b-4bea-9f47-f44d4c1b6389': {
name: '撸猫猫',
ext: '.png',
uuid: '90cfa014-f89b-4bea-9f47-f44d4c1b6389',
url: '//yun.duiba.com.cn/spark/assets/a809cc5d843c40565f25a6f599b26c7332a0c91f.png'
},
'a2b95a3b-6e0a-492a-9a86-d01a6faf8cb4': {
name: '下',
ext: '.png',
uuid: 'a2b95a3b-6e0a-492a-9a86-d01a6faf8cb4',
url: '//yun.duiba.com.cn/spark/assets/7c52dc20259200e82e0a6150f11726dda5694592.png'
},
'e4dbd57c-f431-42e7-bbab-c12f09077d73': {
name: '矩形3591',
ext: '.png',
uuid: 'e4dbd57c-f431-42e7-bbab-c12f09077d73',
url: '//yun.duiba.com.cn/spark/assets/31a0b0b62efffc3e35b387e611a66f244ae58137.png'
},
'9b4f0172-309b-46b4-aabe-a05c1559953d': {
name: '椭圆753',
ext: '.png',
uuid: '9b4f0172-309b-46b4-aabe-a05c1559953d',
url: '//yun.duiba.com.cn/spark/assets/35dd19b79ce826fed591d4478fe01c1400c92bcd.png'
},
'a8495fbc-0762-4995-94d6-ea26bb272c8c': {
name: '矩形3590',
ext: '.png',
uuid: 'a8495fbc-0762-4995-94d6-ea26bb272c8c',
url: '//yun.duiba.com.cn/spark/assets/16ac72b3417eb5dcea995c0f5c015399a61479f9.png'
},
'4399e878-934c-41e6-bada-a886ebedb7fe': {
name: '形状3593',
ext: '.png',
uuid: '4399e878-934c-41e6-bada-a886ebedb7fe',
url: '//yun.duiba.com.cn/spark/assets/493b635d7b64444eee99431feb65e630e86344aa.png'
},
'aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8': {
name: '梳毛icon',
ext: '.png',
uuid: 'aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8',
url: '//yun.duiba.com.cn/spark/assets/615ae52ccf5e888d50002e1861e143ae53deb5c3.png'
},
'0b44efa9-1e8a-4c43-a2a5-93852d88918c': {
name: '撸猫icon',
ext: '.png',
uuid: '0b44efa9-1e8a-4c43-a2a5-93852d88918c',
url: '//yun.duiba.com.cn/spark/assets/430c639158ab024403221ea027e33cf023ffc362.png'
},
'b7ec0f16-ea48-4e41-8def-7cc660fa93d7': {
name: '摸头杀icon',
ext: '.png',
uuid: 'b7ec0f16-ea48-4e41-8def-7cc660fa93d7',
url: '//yun.duiba.com.cn/spark/assets/b8b3c5dacb6ff84465a5310081f776d41eef04a4.png'
},
'922deced-62d2-4995-9dd6-82bc7913f362': {
name: '玩耍icon',
ext: '.png',
uuid: '922deced-62d2-4995-9dd6-82bc7913f362',
url: '//yun.duiba.com.cn/spark/assets/a3ae99684afa9a1f8d94f4c95ee6f1ed81de9996.png'
},
'55f703cd-f0d2-4ec1-9430-6193c1cbc1cb': {
name: '返回icon',
ext: '.png',
uuid: '55f703cd-f0d2-4ec1-9430-6193c1cbc1cb',
url: '//yun.duiba.com.cn/spark/assets/2a914b62b4f3144b1d8aa6c67e4bd03221b2d8ff.png'
},
'e8b083c7-307a-4446-9bc9-99f75c3573e5': {
name: '奖品icon',
ext: '.png',
uuid: 'e8b083c7-307a-4446-9bc9-99f75c3573e5',
url: '//yun.duiba.com.cn/spark/assets/43567fa8a14c4dbf30e5c143c07817ef1336f0e7.png'
},
'e636bd22-361f-442a-8684-ccfe1141485a': {
name: '攻略icon',
ext: '.png',
uuid: 'e636bd22-361f-442a-8684-ccfe1141485a',
url: '//yun.duiba.com.cn/spark/assets/05d5ad2bfa2fc3a42912749e87f74d48ec2e72dc.png'
},
'cdb8e186-9872-442e-b71e-bba0a9ce5846': {
name: '补充精力icon',
ext: '.png',
uuid: 'cdb8e186-9872-442e-b71e-bba0a9ce5846',
url: '//yun.duiba.com.cn/spark/assets/290759639ce4ccb9520fa627232e5e898f30a9f7.png'
},
'af4b699e-5152-4571-8c54-1c06eabf19e9': {
name: '底8',
ext: '.png',
uuid: 'af4b699e-5152-4571-8c54-1c06eabf19e9',
url: '//yun.duiba.com.cn/spark/assets/5e7035da3f797f1c21f519db0400863333e1461e.png'
},
'da6cd2f6-d145-40eb-a3a4-8063452101a7': {
name: '椭圆591',
ext: '.png',
uuid: 'da6cd2f6-d145-40eb-a3a4-8063452101a7',
url: '//yun.duiba.com.cn/spark/assets/f8705af0bdd35b9e0fb6c08550579cf8eba55e15.png'
},
'f13fb0bb-6ad4-4494-bc78-bdf5cbaf8b0d': {
name: '图层592',
ext: '.png',
uuid: 'f13fb0bb-6ad4-4494-bc78-bdf5cbaf8b0d',
url: '//yun.duiba.com.cn/spark/assets/1ebdca4f441302b659a1f7617e4b78e61eee5e2c.png'
},
'f0810375-c8f1-4939-9b11-1cbde6840e2a': {
name: '底5',
ext: '.png',
uuid: 'f0810375-c8f1-4939-9b11-1cbde6840e2a',
url: '//yun.duiba.com.cn/spark/assets/11928fe3fc40256b4cf7babccd684f4cc94cf2d5.png'
},
'fa59e617-f1d9-4065-85e1-6f6ebefb230f': {
name: '底4',
ext: '.png',
uuid: 'fa59e617-f1d9-4065-85e1-6f6ebefb230f',
url: '//yun.duiba.com.cn/spark/assets/b0fc1384f16116f94c8a99079366558e142180a7.png'
},
'e00aee6d-2a90-4e92-b365-f031320d582c': {
name: '进度条3',
ext: '.png',
uuid: 'e00aee6d-2a90-4e92-b365-f031320d582c',
url: '//yun.duiba.com.cn/spark/assets/0406ae0347a82215f9fd346ef0bda4b840fd4708.png'
},
'0eb9c19f-248e-4bf1-bffb-ea694a94b16f': {
name: '猫爪',
ext: '.png',
uuid: '0eb9c19f-248e-4bf1-bffb-ea694a94b16f',
url: '//yun.duiba.com.cn/spark/assets/d06362412a282f15f62a7678fdc130b44df76af3.png'
},
'74c7c0ac-885c-4dc3-b72d-d2ec32a53558': {
name: '对话框',
ext: '.png',
uuid: '74c7c0ac-885c-4dc3-b72d-d2ec32a53558',
url: '//yun.duiba.com.cn/spark/assets/591d3459eef49df923d89c46cc587261d962ba98.png'
},
'bcaf3af2-5ac6-4169-90ed-4333858e2521': {
name: '提示',
ext: '.png',
uuid: 'bcaf3af2-5ac6-4169-90ed-4333858e2521',
url: '//yun.duiba.com.cn/spark/assets/f9312f11884d17c5a50d5f301813ffd7574e2097.png'
} }
}; };
export default resCanvasList; export default resCanvasList;
const resloadingList = {
'42084cc4-390d-4eee-8392-fbbe2e59455e': {
name: 'loading底',
ext: '.png',
uuid: '42084cc4-390d-4eee-8392-fbbe2e59455e',
url: '//yun.duiba.com.cn/spark/assets/a1e89704a94ef7b5f3d6e612bc21d234525c7e86.png'
},
'1857a043-27d7-4925-9535-acb70ae3e90e': {
name: 'loading对话框',
ext: '.png',
uuid: '1857a043-27d7-4925-9535-acb70ae3e90e',
url: '//yun.duiba.com.cn/spark/assets/d3c5ce01e28ed1de56b019e55119bf7a93217e7b.png'
},
'bd699d4f-af43-463f-b2ba-43e2803228a1': {
name: 'loding条底',
ext: '.png',
uuid: 'bd699d4f-af43-463f-b2ba-43e2803228a1',
url: '//yun.duiba.com.cn/spark/assets/8e0533f29853ccb5179cbc8f3b9bde4b89ea186a.png'
},
'efc21755-0441-41d5-b56f-d177026342d4': {
name: '进度条4',
ext: '.png',
uuid: 'efc21755-0441-41d5-b56f-d177026342d4',
url: '//yun.duiba.com.cn/spark/assets/cb28f449fab3a7a88b4058d6d19119a9b3b7f7ed.png'
},
'd01a19e5-fa4f-40b9-a6dc-9d21e0cc756e': {
name: '爪子',
ext: '.png',
uuid: 'd01a19e5-fa4f-40b9-a6dc-9d21e0cc756e',
url: '//yun.duiba.com.cn/spark/assets/57784d76f734ce9accf6006dcd40972292e3d22f.png'
},
'4e3c6e09-0593-4818-976a-d73fe588580b': {
name: '摸头猫2',
ext: '.png',
uuid: '4e3c6e09-0593-4818-976a-d73fe588580b',
url: '//yun.duiba.com.cn/spark/assets/25b18893820ee0b6998c527c41a8b58ee516ac31.png'
}
}
export default resloadingList;
\ No newline at end of file
/**当前场景对应的主ui类型 */
export enum UITYPE{
/**教室 */
CLASSROOM,
/**操场 */
PLAYGROUND,
/**寝室 */
BEADROOM
}
/** */
export enum MSG{
}
\ No newline at end of file
import { RES } from "../module/RES";
import resCanvasList from "../resCanvasList"
/**记录全局信息与全局方法 */
export class Ins {
/**舞台宽高 */
public static stageW:number;
public static stageH:number;
/**根据uuid获取资源 */
public static getRes(uuid:string){
return RES.getRes(resCanvasList[uuid].url)
}
/**生成一个Sprite */
public static initSprite(uuid?:string,x=0,y=0){
let btn = new FYGE.Sprite();
if(uuid){
btn.texture = this.getRes(uuid);
}
btn.x = x;
btn.y = y;
return btn;
}
/**生成一个文本
* data:{color?:string,size?:number,x?:number,y?:number,text?:string}
*/
public static initLabel(data:any){
let label = new FYGE.TextField();
label.fillColor = data.color?data.color:"";
label.size = data.size?data.size:24;
label.x = data.x?data.x:0,
label.y = data.y?data.y:0,
label.text = data.text?data.text:"";
return label;
}
}
\ No newline at end of file
...@@ -8,7 +8,10 @@ import { destroyNetData } from "./TaoBaoNet"; ...@@ -8,7 +8,10 @@ import { destroyNetData } from "./TaoBaoNet";
import resCanvasList from '../resCanvasList'; import resCanvasList from '../resCanvasList';
import resloadingList from '../resloadingList'
import { setStage } from "./scenes/stage"; import { setStage } from "./scenes/stage";
import { LoadingScene } from "./scenes/LoadingScene";
import { Ins } from "./Ins";
/** /**
...@@ -75,10 +78,15 @@ export class Main { ...@@ -75,10 +78,15 @@ export class Main {
// RES.loadSkinConfig(SkinJson); // RES.loadSkinConfig(SkinJson);
//加载通用资源 //加载通用资源
// await RES.loadGroup("common"); // await RES.loadGroup("common");
Ins.stageW = this.stage.viewRect.width;
Ins.stageH = this.stage.viewRect.height;
await RES.loadSparkAssets(resloadingList);
changeScene(LoadingScene);
await RES.loadSparkAssets(resCanvasList); await RES.loadSparkAssets(resCanvasList);
console.log("通用资源加载完成") console.log("通用资源加载完成")
FYGE.GDispatcher.dispatchEvent("loadEnd");
//打开开始场景 //打开开始场景
changeScene(StartScene); // changeScene(StartScene);
// changeScene(LoadingScene); // changeScene(LoadingScene);
// changeScene(SStartScene); // changeScene(SStartScene);
// changeScene(StoryScene); // changeScene(StoryScene);
......
{
"9f61bbde-1ff1-4f91-ad99-a720fca4c92c.png": {
"x": 2,
"y": 2,
"w": 245,
"h": 81,
"ox": 0,
"oy": 0,
"sw": 245,
"sh": 81,
"ro": false
},
"ebf17373-7680-455e-8cd4-15e54c0c95f3.png": {
"x": 2,
"y": 85,
"w": 235,
"h": 195,
"ox": 0,
"oy": 0,
"sw": 235,
"sh": 195,
"ro": false
},
"2239a946-9ede-4dbe-8c94-6699b41f7794.png": {
"x": 2,
"y": 282,
"w": 67,
"h": 215,
"ox": 1,
"oy": 0,
"sw": 69,
"sh": 215,
"ro": false
},
"4500dc10-6a8c-4d8c-972a-ac249cff37a3.png": {
"x": 71,
"y": 282,
"w": 200,
"h": 55,
"ox": 0,
"oy": 0,
"sw": 200,
"sh": 55,
"ro": true
},
"490dd50b-f5dd-49ac-8534-f6f8f0365c0c.png": {
"x": 128,
"y": 282,
"w": 199,
"h": 176,
"ox": 0,
"oy": 0,
"sw": 199,
"sh": 176,
"ro": true
},
"698cfa31-03e6-4b86-98aa-ead05f69c2ad.png": {
"x": 239,
"y": 85,
"w": 167,
"h": 120,
"ox": 0,
"oy": 0,
"sw": 167,
"sh": 120,
"ro": true
},
"8d1870e0-4416-4c90-a003-8f00987c2596.png": {
"x": 306,
"y": 254,
"w": 161,
"h": 101,
"ox": 2,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": false
},
"c5efd874-f8ff-4156-a9dc-d044fed8e9c0.png": {
"x": 306,
"y": 357,
"w": 161,
"h": 102,
"ox": 3,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": false
},
"d02e2718-08d9-43fd-8058-439e8aa0f74c.png": {
"x": 361,
"y": 2,
"w": 161,
"h": 102,
"ox": 2,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"f9a0a322-4a62-4d7d-a553-276e363c0782.png": {
"x": 465,
"y": 2,
"w": 161,
"h": 103,
"ox": 3,
"oy": 1,
"sw": 164,
"sh": 106,
"ro": true
},
"25839190-3647-4313-80f5-344f4c15f34f.png": {
"x": 469,
"y": 165,
"w": 160,
"h": 102,
"ox": 4,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"754d7ce4-ff88-4722-b8f3-e00e6f05b6bc.png": {
"x": 570,
"y": 2,
"w": 160,
"h": 103,
"ox": 4,
"oy": 1,
"sw": 164,
"sh": 106,
"ro": true
},
"8724305b-2983-453a-9788-c8bde8a85613.png": {
"x": 469,
"y": 327,
"w": 160,
"h": 102,
"ox": 4,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"acb93b89-de7d-47f7-bb54-c5a3d471b474.png": {
"x": 573,
"y": 164,
"w": 160,
"h": 102,
"ox": 3,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"eb70f7a6-bbe3-42cc-a6c7-2661edac9c8f.png": {
"x": 675,
"y": 2,
"w": 160,
"h": 102,
"ox": 3,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"3f566e6a-81d1-4614-b6b1-db1104f4a112.png": {
"x": 573,
"y": 326,
"w": 159,
"h": 101,
"ox": 5,
"oy": 3,
"sw": 164,
"sh": 106,
"ro": true
},
"f62c160e-9e59-472c-b7ab-ed2ef8e5d8d0.png": {
"x": 676,
"y": 326,
"w": 159,
"h": 102,
"ox": 5,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"067a824a-ed69-44f3-b485-173922af187b.png": {
"x": 677,
"y": 164,
"w": 157,
"h": 102,
"ox": 5,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"ace17cfc-09da-429b-9bee-fbe3ba64e134.png": {
"x": 779,
"y": 2,
"w": 157,
"h": 102,
"ox": 5,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"c07fa7c7-f4b6-4517-97ef-b080cf03701d.png": {
"x": 780,
"y": 323,
"w": 155,
"h": 102,
"ox": 7,
"oy": 2,
"sw": 164,
"sh": 106,
"ro": true
},
"d85dfac7-43b1-4e4f-8efb-35a7e745f003.png": {
"x": 781,
"y": 161,
"w": 155,
"h": 101,
"ox": 7,
"oy": 3,
"sw": 164,
"sh": 106,
"ro": true
},
"031df36f-490c-4799-b5dc-245132cc7bf7.png": {
"x": 883,
"y": 2,
"w": 154,
"h": 101,
"ox": 8,
"oy": 3,
"sw": 164,
"sh": 106,
"ro": true
},
"98e9166b-f26c-4b0b-b461-87b338be4069.png": {
"x": 884,
"y": 158,
"w": 154,
"h": 101,
"ox": 8,
"oy": 3,
"sw": 164,
"sh": 106,
"ro": true
},
"6d1fe15b-713d-4e6f-92fa-30b63fe6aa72.png": {
"x": 249,
"y": 2,
"w": 72,
"h": 89,
"ox": 0,
"oy": 0,
"sw": 72,
"sh": 89,
"ro": true
},
"1de192ae-30ea-41bd-9c25-0fcb8e883144.png": {
"x": 361,
"y": 165,
"w": 74,
"h": 75,
"ox": 0,
"oy": 0,
"sw": 74,
"sh": 75,
"ro": false
},
"4291e7b3-0d33-4a37-a4f4-9668e35248a8.png": {
"x": 987,
"y": 2,
"w": 59,
"h": 33,
"ox": 0,
"oy": 0,
"sw": 59,
"sh": 33,
"ro": true
},
"615fe49b-82a7-4add-a445-094e529e907c.png": {
"x": 987,
"y": 63,
"w": 59,
"h": 33,
"ox": 0,
"oy": 0,
"sw": 59,
"sh": 33,
"ro": true
},
"d34053ad-2392-466e-86cf-4242dd825e6a.png": {
"x": 340,
"y": 2,
"w": 39,
"h": 12,
"ox": 0,
"oy": 0,
"sw": 39,
"sh": 12,
"ro": true
},
"a7f6f221-4374-4e77-abae-ec7b6076e5d4.png": {
"x": 340,
"y": 43,
"w": 38,
"h": 13,
"ox": 0,
"oy": 0,
"sw": 38,
"sh": 13,
"ro": true
},
"745a8a8f-1075-40ef-b95d-b413a2c3f6c5.png": {
"x": 987,
"y": 124,
"w": 35,
"h": 22,
"ox": 0,
"oy": 0,
"sw": 35,
"sh": 22,
"ro": false
},
"e213d790-8a45-4a8a-8816-fab82903382e.png": {
"x": 239,
"y": 254,
"w": 30,
"h": 26,
"ox": 0,
"oy": 0,
"sw": 30,
"sh": 26,
"ro": false
}
}
\ No newline at end of file
This diff is collapsed.
import { Scene } from "../../module/views/Scene";
import resCanvasList from "../../../game/resCanvasList";
import { RES } from "../../module/RES";
import { Ins } from "../Ins";
import { MainSceneBtnUi } from "../ui/mainSceneBtnUi";
import { UITYPE } from "../Enum";
export class ClassRoomScene extends Scene{
private sceneBg:FYGE.Sprite;
initUi(){
var that = this;
that.initSceneEle();
}
/**初始化场景元素 */
initSceneEle(){
var that = this;
that.x = (Ins.stageW - 750)>>1;
that.y = (Ins.stageH - 1624)>>1;
that.sceneBg = new FYGE.Sprite(RES.getRes(resCanvasList["3ebdda49-754c-42e5-bfb3-daefa9835fb5"].url));
that.addChild(that.sceneBg);
that.addChild(new MainSceneBtnUi({uiType:UITYPE.CLASSROOM}))
}
}
\ No newline at end of file
import { RES } from "../../module/RES";
import { Scene } from "../../module/views/Scene";
import { Ins } from "../Ins";
import resloadingList from "../../../game/resloadingList";
import { truncateSync } from "fs";
import { changeScene } from "../../module/ctrls";
import { StartScene } from "./StartScene";
export class LoadingScene extends Scene{
private bg:FYGE.Sprite;
private cat:FYGE.Sprite;
private dialogBox:FYGE.Sprite;
private loadingGroup:FYGE.Sprite;
private loadingBg:FYGE.Sprite;
private loading:FYGE.Sprite;
private zhuazi:FYGE.Sprite;
private notice:FYGE.TextField;
private loadingMask:FYGE.Shape;
private isEnd = false;
private tweenEnd = false;
initUi(){
var that = this;
that.x = (Ins.stageW - 750)>>1;
that.y = (Ins.stageH - 1624)>>1;
that.bg = new FYGE.Sprite(RES.getRes(resloadingList["42084cc4-390d-4eee-8392-fbbe2e59455e"].url));
that.addChild(that.bg);
that.cat = new FYGE.Sprite(RES.getRes(resloadingList["4e3c6e09-0593-4818-976a-d73fe588580b"].url));
that.addChild(that.cat);
that.cat.x = 91;
that.cat.y = 792;
that.dialogBox = new FYGE.Sprite(RES.getRes(resloadingList["1857a043-27d7-4925-9535-acb70ae3e90e"].url));
that.dialogBox.x = 268;
that.dialogBox.y = 695;
that.addChild(that.dialogBox);
that.notice = new FYGE.TextField();
that.notice.fillColor = "black";
that.notice.size = 28;
that.notice.x = 150;
that.notice.y = 1134;
that.notice.text = "猫咪精力条恢复满后就不再恢复了哦~";
that.addChild(that.notice);
that.loadingGroup = new FYGE.Sprite(RES.getRes(resloadingList["bd699d4f-af43-463f-b2ba-43e2803228a1"].url));
that.loadingGroup.x = 65;
that.loadingGroup.y = 1043;
that.addChild(that.loadingGroup);
that.loading = new FYGE.Sprite(RES.getRes(resloadingList["efc21755-0441-41d5-b56f-d177026342d4"].url));
that.loading.x = 9;
that.loading.y = 9;
that.loading.anchorY = that.loading.height>>1;
that.loading.x = -that.loading.width;
that.loadingGroup.addChild(that.loading);
that.loadingMask = new FYGE.Shape();
that.loadingMask.x = 9;
that.loadingMask.y = 9;
that.loadingGroup.addChild(that.loadingMask);
that.loadingMask.beginFill(6,1);
that.loadingMask.drawRoundedRect(0,0,that.loading.width,that.loading.height,38,38,38,38);
that.loadingMask.endFill();
that.loading.mask = that.loadingMask;
that.zhuazi = new FYGE.Sprite();
that.loadingGroup.addChild(that.zhuazi);
FYGE.Tween.get(this.loading).to({x:-80},2000).call(()=>{
that.tweenEnd = true;
if(that.isEnd){
FYGE.Tween.get(that.loading).to({x:9},600).call(()=>{changeScene(StartScene)});
}
})
FYGE.GDispatcher.addEventListener("loadEnd",()=>{
that.isEnd = true;
if(that.tweenEnd){
FYGE.Tween.get(that.loading).to({x:9},600);
}
},that)
}
}
\ No newline at end of file
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import Root from "./Root"; import Root from "./Root";
// import res from "../../test/output.json"
import resCanvasList from "../../../game/resCanvasList"
import {lanmao06motou} from "../lottieSrc/lottieTs/buleCatHand"
import { ClassRoomScene } from "./ClassRoomScene";
import { Ins } from "../Ins";
const buleCatHand = require("../lottieSrc/lottieTextureJson/blueCatHand.json")
export class StartScene extends Scene { export class StartScene extends Scene {
initUi() { initUi() {
super.initUi(); super.initUi();
var canvas: FYGE.Container = new FYGE.Container(); var canvas: FYGE.Container = new FYGE.Container();
canvas.position.set(0, 0); canvas.position.set(0, 0);
this.addChild(canvas); this.addChild(canvas);
SvgaParser.loadSvga("//yun.duiba.com.cn/spark/assets/yuyu1.6473bb2ef640b556f35096428847216e72499d90.svga",(e)=>{this.addChild(new FYGE.MovieClip(e))}) this.addChild(new ClassRoomScene());
// FYGE.GlobalLoader.loadImage((s,image)=>{
// if(s){
// // console.log(new FYGE.BaseTexture(image));
// FYGE.createTextureSheet(new FYGE.BaseTexture(image),buleCatHand);
// var a = new FYGE.Lottie(lanmao06motou)
// this.addChild(a);
// a.play()
// }else{
// }
// },resCanvasList["3a105062-4474-4f37-abd2-fa9471e2536f"].url)
} }
start() { start() {
this.addChild(new Root()); // this.addChild(new Root());
} }
} }
import { Module } from "../../module/views/Module";
import { UITYPE } from "../Enum";
import resCanvasList from "../../../game/resCanvasList"
import { RES } from "../../module/RES";
import { Ins } from "../Ins";
export class MainSceneBtnUi extends Module{
/**主场景ui
* @param uiType:UITYPE枚举类型区分
*/
constructor(data?:any){
super(data);
this.uiType = data.uiType;
// this.once(FYGE.Event.ADDED_TO_STAGE,this.start,this);
this.once(FYGE.Event.REMOVED_FROM_STAGE,this.destroy,this);
}
/**ui类型 */
private uiType:UITYPE;
/**返回按钮 */
private returnBtn:FYGE.Sprite;
/**攻略按钮 */
private strategyBtn:FYGE.Sprite;
/**奖品按钮 */
private prizeBtn:FYGE.Sprite;
/**梳毛按钮 */
private combingBtn:FYGE.Sprite;
/**撸猫按钮 */
private catBtn:FYGE.Sprite;
/**摸头杀按钮 */
private touchHeadBtn:FYGE.Sprite;
/**玩耍按钮 */
private playBtn:FYGE.Sprite;
/**补充精力按钮 */
private energyBtn:FYGE.Sprite;
/**猫猫信息组 */
private catInfoGroup:FYGE.Sprite;
private catAvatar:FYGE.Sprite; //猫猫头像
private catNameLabel:FYGE.TextField; //猫猫名称文本
private catLevelLabel:FYGE.TextField; //猫猫等级文本
/**鱼鱼积分组 */
private fishPointGroup:FYGE.Sprite;
private fishPointLabel:FYGE.TextField; //鱼鱼积分文本
initUi(){
var that = this;
that.initUniversalUi();
}
/**生成通用ui */
initUniversalUi(){
var that = this;
that.mouseEnable = false;
that.mouseChildren = true;
that.strategyBtn = Ins.initSprite("e636bd22-361f-442a-8684-ccfe1141485a",579,332);
that.addChild(that.strategyBtn);
that.prizeBtn = Ins.initSprite("e8b083c7-307a-4446-9bc9-99f75c3573e5",579,457);
that.addChild(that.prizeBtn);
that.energyBtn = Ins.initSprite("cdb8e186-9872-442e-b71e-bba0a9ce5846",539,1233);
that.addChild(that.energyBtn);
that.initCatInfoGroup();
that.initFishPointGroup();
that.initActBtn();
that.start();
}
/**初始化猫猫信息 */
initCatInfoGroup(){
var that = this;
that.catInfoGroup = Ins.initSprite("af4b699e-5152-4571-8c54-1c06eabf19e9",69,220),
that.addChild(that.catInfoGroup);
that.catAvatar = new FYGE.Sprite();
that.catInfoGroup.addChild(that.catAvatar);
that.catNameLabel = Ins.initLabel({color:"black",size:24,text:"喵喵喵",x:(95-19),y:(167-145)})
that.catInfoGroup.addChild(that.catNameLabel);
that.catLevelLabel = Ins.initLabel({color:"black",size:24,text:"Lv.1",x:(192-19),y:(167-145)})
that.catInfoGroup.addChild(that.catLevelLabel);
}
/**初始化鱼鱼积分组 */
initFishPointGroup(){
var that = this;
that.fishPointGroup = Ins.initSprite("f0810375-c8f1-4939-9b11-1cbde6840e2a",465,220);
that.addChild(that.fishPointGroup);
that.fishPointLabel = Ins.initLabel({color:"black",size:24,text:"111111",x:99,y:24})
that.fishPointGroup.addChild(that.fishPointLabel);
}
/**初始化互动按钮 */
initActBtn(){
var that = this;
switch(that.uiType){
case UITYPE.BEADROOM:
that.combingBtn = Ins.initSprite("aa17cfa9-f1db-47eb-9eeb-f5947b7f47a8",62,1240);
that.addChild(that.combingBtn);
that.catBtn = Ins.initSprite("0b44efa9-1e8a-4c43-a2a5-93852d88918c",210,1240);
that.addChild(that.catBtn);
break;
case UITYPE.CLASSROOM:
that.returnBtn = Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb",62,1240);
that.addChild(that.returnBtn);
that.touchHeadBtn = Ins.initSprite("b7ec0f16-ea48-4e41-8def-7cc660fa93d7",210,1240);
that.addChild(that.touchHeadBtn);
break;
case UITYPE.PLAYGROUND:
that.returnBtn = Ins.initSprite("55f703cd-f0d2-4ec1-9430-6193c1cbc1cb",62,1240);
that.addChild(that.returnBtn);
that.playBtn = Ins.initSprite("922deced-62d2-4995-9dd6-82bc7913f362",210,1240);
that.addChild(that.playBtn);
break;
default:console.log("创建场景ui时设置uiType错误");
break;
}
}
/**补充精力 */
getEnergy(){
console.log("补充精力");
}
/**返回到寝室 */
returnBedRoom(){
console.log("返回到寝室");
}
/**玩耍 */
catPlay(){
console.log("玩耍");
}
/**打开攻略 */
openStrategy(){
console.log("打开攻略");
}
/**打开奖品页面 */
openPrizePage(){
console.log("打开奖品页面")
}
initEvents(){
var that = this;
that.addEvent(that.energyBtn,FYGE.MouseEvent.CLICK,that.getEnergy)
that.addEvent(that.returnBtn,FYGE.MouseEvent.CLICK,that.returnBedRoom)
}
/**添加事件,为了防止obj没有被创建封装 */
addEvent(obj:FYGE.Container,type, listener){
if(obj){
obj.addEventListener(type,listener,this);
}
}
/*移除事件,为了防止obj没有被创建封装 */
removeEvent(obj:FYGE.Container,type,listener){
if(obj){
obj.removeEventListener(type,listener,this);
}
}
removeEvents(){
}
start(){
super.start();
}
destroy(){
super.destroy();
}
}
\ No newline at end of file
const tansLottie = require("tans_lottie")
\ No newline at end of file
This diff is collapsed.
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@tbmp/mp-cloud-sdk": "*", "@tbmp/mp-cloud-sdk": "*",
"fyge-tbmini": "^1.3.7" "fyge-tbmini": "^1.3.7",
"svga-parser": "^1.1.0",
"tans_lottie": "^1.0.4"
} }
} }
import * as FYGE from "fyge-tbmini"; import * as FYGE from "fyge-tbmini";
import * as SvgaParser from "svga-parser"
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(); module.exports = factory();
...@@ -1684,10 +1685,12 @@ var StartScene = (function (_super) { ...@@ -1684,10 +1685,12 @@ var StartScene = (function (_super) {
return _super !== null && _super.apply(this, arguments) || this; return _super !== null && _super.apply(this, arguments) || this;
} }
StartScene.prototype.initUi = function () { StartScene.prototype.initUi = function () {
var _this = this;
_super.prototype.initUi.call(this); _super.prototype.initUi.call(this);
var canvas = new FYGE.Container(); var canvas = new FYGE.Container();
canvas.position.set(0, 0); canvas.position.set(0, 0);
this.addChild(canvas); this.addChild(canvas);
SvgaParser.loadSvga("//yun.duiba.com.cn/spark/assets/yuyu1.6473bb2ef640b556f35096428847216e72499d90.svga", function (e) { _this.addChild(new FYGE.MovieClip(e)); });
}; };
StartScene.prototype.start = function () { StartScene.prototype.start = function () {
this.addChild(new Root_1.default()); this.addChild(new Root_1.default());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment