Commit d13da819 authored by spc's avatar spc

modified: src/scenes/LoadingScene.ts

parent 27528222
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
"name": "common", "name": "common",
"atlas": { "atlas": {
"comCloseBtn.png": { "comCloseBtn.png": {
"x": 646, "x": 2,
"y": 60, "y": 374,
"w": 48, "w": 48,
"h": 48, "h": 48,
"ox": 0, "ox": 0,
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"ro": false "ro": false
}, },
"toastBg.png": { "toastBg.png": {
"x": 184, "x": 2,
"y": 2, "y": 2,
"w": 460, "w": 460,
"h": 130, "h": 130,
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
}, },
"waitingBg.png": { "waitingBg.png": {
"x": 2, "x": 2,
"y": 2, "y": 134,
"w": 160, "w": 160,
"h": 180, "h": 180,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 160, "sw": 160,
"sh": 180, "sh": 180,
"ro": true "ro": false
}, },
"waitingRot.png": { "waitingRot.png": {
"x": 646, "x": 2,
"y": 2, "y": 316,
"w": 56, "w": 56,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
......
const resCanvasList = { const resCanvasList = {
'4ee17a9c-5deb-43be-b205-16fb7593d172': { '4ee17a9c-5deb-43be-b205-16fb7593d172': {
name: 'spark', name: 'spark',
ext: '.png', ext: '.png',
...@@ -628,6 +628,38 @@ const resCanvasList = { ...@@ -628,6 +628,38 @@ const resCanvasList = {
ext: '.jpg', ext: '.jpg',
url: 'https://yun.duiba.com.cn/spark/assets/寝室1.e9238ec5e71c328817026128dd0f41fdc65203f4.jpg', url: 'https://yun.duiba.com.cn/spark/assets/寝室1.e9238ec5e71c328817026128dd0f41fdc65203f4.jpg',
uuid: 'b3c8c187-e5c9-4968-9a00-a118d18ab2fc' uuid: 'b3c8c187-e5c9-4968-9a00-a118d18ab2fc'
},
"分割xian": {},
"dasdasdasdasd": {},
'2a747211-0210-4215-86a2-a6955b37c45b': {
name: '白色',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/白色.41dae4fd01f4750aea58f694b40d97a9da8f23ca.png',
uuid: '2a747211-0210-4215-86a2-a6955b37c45b'
},
'7fcd3fb3-57bd-436a-afca-989b68b6b311': {
name: '背景',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/背景.9713f3181595c655058adc1f1fd039ee5e1911bf.png',
uuid: '7fcd3fb3-57bd-436a-afca-989b68b6b311'
},
'7d1ec658-9371-4d52-b4d7-e75d04037daf': {
name: '粉色',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/粉色.f5d6e3215bdb1048b015fba9d743ae03be13ee3f.png',
uuid: '7d1ec658-9371-4d52-b4d7-e75d04037daf'
},
'6a1345f6-969c-4969-8bfb-f4de637df34d': {
name: '黄色',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/黄色.3e05aa9a7e01b9083ec21eb0545179a1c9ca24fd.png',
uuid: '6a1345f6-969c-4969-8bfb-f4de637df34d'
},
'2e12a9ec-46be-487f-a9cd-550dd0af3746': {
name: '银色',
ext: '.png',
url: 'https://yun.duiba.com.cn/spark-dev/assets/银色.1735303df8f858d3d9f30d662c5fb03ae72fc4c6.png',
uuid: '2e12a9ec-46be-487f-a9cd-550dd0af3746'
} }
}; };
export default resCanvasList; export default resCanvasList;
\ No newline at end of file
...@@ -4,21 +4,21 @@ const OrengeCatTexture = require("./src/lottieSrc/lottieTextureJson/OrengeCatTex ...@@ -4,21 +4,21 @@ const OrengeCatTexture = require("./src/lottieSrc/lottieTextureJson/OrengeCatTex
const SanhuaCatTexture = require("./src/lottieSrc/lottieTextureJson/SanhuaCatTexture.json") const SanhuaCatTexture = require("./src/lottieSrc/lottieTextureJson/SanhuaCatTexture.json")
const XianluoCatTexture = require("./src/lottieSrc/lottieTextureJson/XianluoCatTexture.json") const XianluoCatTexture = require("./src/lottieSrc/lottieTextureJson/XianluoCatTexture.json")
const resLottieList = { const resLottieList = {
"blueCat":{ // "blueCat":{
imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url, // imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
json:BlueCatTexture // json:BlueCatTexture
}, // },
"orengeCat":{ // "orengeCat":{
imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url, // imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
json:OrengeCatTexture // json:OrengeCatTexture
}, // },
"sanhuaCat":{ // "sanhuaCat":{
imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url, // imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
json:SanhuaCatTexture // json:SanhuaCatTexture
}, // },
"xianluoCat":{ // "xianluoCat":{
imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url, // imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
json:XianluoCatTexture // json:XianluoCatTexture
} // }
} }
export default resLottieList; export default resLottieList;
\ No newline at end of file
...@@ -3,7 +3,6 @@ import { layers, destroyLayers } from "../module/views/layers"; ...@@ -3,7 +3,6 @@ import { layers, destroyLayers } from "../module/views/layers";
import { ResJson } from "./ResJson"; import { ResJson } from "./ResJson";
import { G_EVENT } from "./common/G_EVENT"; import { G_EVENT } from "./common/G_EVENT";
import { destroyAllCtrls, changeScene, hideWaiting } from "../module/ctrls"; import { destroyAllCtrls, changeScene, hideWaiting } from "../module/ctrls";
import { StartScene } from "./scenes/StartScene";
import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet"; import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
...@@ -14,6 +13,7 @@ import { setStage } from "./scenes/stage"; ...@@ -14,6 +13,7 @@ import { setStage } from "./scenes/stage";
import { LoadingScene } from "./scenes/LoadingScene"; import { LoadingScene } from "./scenes/LoadingScene";
import { Ins } from "./Ins"; import { Ins } from "./Ins";
import { InitLottie } from "./initLottie"; import { InitLottie } from "./initLottie";
import { XxlScene } from "./xiaoxiaole/XxlScene";
/** /**
...@@ -86,7 +86,7 @@ export class Main { ...@@ -86,7 +86,7 @@ export class Main {
console.log("舞台宽高:",Ins.stageW,Ins.stageH) console.log("舞台宽高:",Ins.stageW,Ins.stageH)
await RES.loadSparkAssets(resloadingList); await RES.loadSparkAssets(resloadingList);
console.log('resloadingList 加载完毕') console.log('resloadingList 加载完毕')
changeScene(LoadingScene); changeScene(XxlScene);
await RES.loadSparkAssets(resCanvasList).catch(()=>{ await RES.loadSparkAssets(resCanvasList).catch(()=>{
console.log('loadSparkAssets resCanvasList 失败') console.log('loadSparkAssets resCanvasList 失败')
}); });
......
...@@ -5,8 +5,8 @@ export const ResJson = { ...@@ -5,8 +5,8 @@ export const ResJson = {
"name": "common", "name": "common",
"atlas": { "atlas": {
"comCloseBtn.png": { "comCloseBtn.png": {
"x": 646, "x": 2,
"y": 60, "y": 374,
"w": 48, "w": 48,
"h": 48, "h": 48,
"ox": 0, "ox": 0,
...@@ -16,7 +16,7 @@ export const ResJson = { ...@@ -16,7 +16,7 @@ export const ResJson = {
"ro": false "ro": false
}, },
"toastBg.png": { "toastBg.png": {
"x": 184, "x": 2,
"y": 2, "y": 2,
"w": 460, "w": 460,
"h": 130, "h": 130,
...@@ -28,18 +28,18 @@ export const ResJson = { ...@@ -28,18 +28,18 @@ export const ResJson = {
}, },
"waitingBg.png": { "waitingBg.png": {
"x": 2, "x": 2,
"y": 2, "y": 134,
"w": 160, "w": 160,
"h": 180, "h": 180,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 160, "sw": 160,
"sh": 180, "sh": 180,
"ro": true "ro": false
}, },
"waitingRot.png": { "waitingRot.png": {
"x": 646, "x": 2,
"y": 2, "y": 316,
"w": 56, "w": 56,
"h": 56, "h": 56,
"ox": 0, "ox": 0,
...@@ -55,5 +55,5 @@ export const ResJson = { ...@@ -55,5 +55,5 @@ export const ResJson = {
"name": "startScene" "name": "startScene"
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1600243346/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/1600827862/resource/"
} }
\ No newline at end of file
...@@ -3,87 +3,89 @@ import { Scene } from "../../module/views/Scene"; ...@@ -3,87 +3,89 @@ import { Scene } from "../../module/views/Scene";
import { Ins } from "../Ins"; import { Ins } from "../Ins";
import resloadingList from "../../../game/resloadingList"; import resloadingList from "../../../game/resloadingList";
import { changeScene } from "../../module/ctrls"; import { changeScene } from "../../module/ctrls";
import { StartScene } from "./StartScene"; import { XxlScene } from "../xiaoxiaole/XxlScene";
import { XxlScene } from "../xiaoxiaole/StartScene";
import { CsdScene } from "../chuansongdai/StartScene"; import { CsdScene } from "../chuansongdai/StartScene";
export class LoadingScene extends Scene{ export class LoadingScene extends Scene {
private bg:FYGE.Sprite; private bg: FYGE.Sprite;
private cat:FYGE.Sprite; private cat: FYGE.Sprite;
private dialogBox:FYGE.Sprite; private dialogBox: FYGE.Sprite;
private loadingGroup:FYGE.Sprite; private loadingGroup: FYGE.Sprite;
private loadingBg:FYGE.Sprite; private loadingBg: FYGE.Sprite;
private loading:FYGE.Sprite; private loading: FYGE.Sprite;
private zhuazi:FYGE.Sprite; private zhuazi: FYGE.Sprite;
private notice:FYGE.TextField; private notice: FYGE.TextField;
private loadingMask:FYGE.Shape; private loadingMask: FYGE.Shape;
private isEnd = false; private isEnd = false;
private tweenEnd = false; private tweenEnd = false;
initUi(){ initUi() {
var that = this; // var that = this;
that.x = (Ins.stageW - 750)>>1; // that.x = (Ins.stageW - 750) >> 1;
that.y = (Ins.stageH - 1624)>>1; // that.y = (Ins.stageH - 1624) >> 1;
that.bg = new FYGE.Sprite(RES.getRes(resloadingList["42084cc4-390d-4eee-8392-fbbe2e59455e"].url)); // that.bg = new FYGE.Sprite(RES.getRes(resloadingList["42084cc4-390d-4eee-8392-fbbe2e59455e"].url));
that.addChild(that.bg); // that.addChild(that.bg);
that.cat = new FYGE.Sprite(RES.getRes(resloadingList["4e3c6e09-0593-4818-976a-d73fe588580b"].url)); // that.cat = new FYGE.Sprite(RES.getRes(resloadingList["4e3c6e09-0593-4818-976a-d73fe588580b"].url));
that.addChild(that.cat); // that.addChild(that.cat);
that.cat.x = 91; // that.cat.x = 91;
that.cat.y = 792; // that.cat.y = 792;
that.dialogBox = new FYGE.Sprite(RES.getRes(resloadingList["1857a043-27d7-4925-9535-acb70ae3e90e"].url)); // that.dialogBox = new FYGE.Sprite(RES.getRes(resloadingList["1857a043-27d7-4925-9535-acb70ae3e90e"].url));
that.dialogBox.x = 268; // that.dialogBox.x = 268;
that.dialogBox.y = 695; // that.dialogBox.y = 695;
that.addChild(that.dialogBox); // that.addChild(that.dialogBox);
that.notice = new FYGE.TextField(); // that.notice = new FYGE.TextField();
that.notice.fillColor = "black"; // that.notice.fillColor = "black";
that.notice.size = 28; // that.notice.size = 28;
that.notice.x = 150; // that.notice.x = 150;
that.notice.y = 1134; // that.notice.y = 1134;
that.notice.text = "猫咪精力条恢复满后就不再恢复了哦~"; // that.notice.text = "猫咪精力条恢复满后就不再恢复了哦~";
that.addChild(that.notice); // that.addChild(that.notice);
that.loadingGroup = new FYGE.Sprite(RES.getRes(resloadingList["bd699d4f-af43-463f-b2ba-43e2803228a1"].url)); // that.loadingGroup = new FYGE.Sprite(RES.getRes(resloadingList["bd699d4f-af43-463f-b2ba-43e2803228a1"].url));
that.loadingGroup.x = 65; // that.loadingGroup.x = 65;
that.loadingGroup.y = 1043; // that.loadingGroup.y = 1043;
that.addChild(that.loadingGroup); // that.addChild(that.loadingGroup);
that.loading = new FYGE.Sprite(RES.getRes(resloadingList["efc21755-0441-41d5-b56f-d177026342d4"].url)); // that.loading = new FYGE.Sprite(RES.getRes(resloadingList["efc21755-0441-41d5-b56f-d177026342d4"].url));
that.loading.x = 9; // that.loading.x = 9;
that.loading.y = 9; // that.loading.y = 9;
that.loading.anchorY = that.loading.height>>1; // that.loading.anchorY = that.loading.height >> 1;
that.loading.x = -that.loading.width; // that.loading.x = -that.loading.width;
that.loadingGroup.addChild(that.loading); // that.loadingGroup.addChild(that.loading);
that.loadingMask = new FYGE.Shape(); // that.loadingMask = new FYGE.Shape();
that.loadingMask.x = 9; // that.loadingMask.x = 9;
that.loadingMask.y = 9; // that.loadingMask.y = 9;
that.loadingGroup.addChild(that.loadingMask); // that.loadingGroup.addChild(that.loadingMask);
that.loadingMask.beginFill(6,1); // that.loadingMask.beginFill(6, 1);
that.loadingMask.drawRoundedRect(0,0,that.loading.width,that.loading.height,38,38,38,38); // that.loadingMask.drawRoundedRect(0, 0, that.loading.width, that.loading.height, 38, 38, 38, 38);
that.loadingMask.endFill(); // that.loadingMask.endFill();
that.loading.mask = that.loadingMask; // that.loading.mask = that.loadingMask;
that.zhuazi = new FYGE.Sprite(RES.getRes(resloadingList["d01a19e5-fa4f-40b9-a6dc-9d21e0cc756e"].url)); // that.zhuazi = new FYGE.Sprite(RES.getRes(resloadingList["d01a19e5-fa4f-40b9-a6dc-9d21e0cc756e"].url));
that.loadingGroup.addChild(that.zhuazi); // that.loadingGroup.addChild(that.zhuazi);
that.zhuazi.y = -5; // that.zhuazi.y = -5;
FYGE.Tween.get(this.loading,{onChange:()=>{that.zhuazi.x = (that.loading.x+that.loading.width-30)},onChangeObj:that}).to({x:-80},200).call(()=>{ // FYGE.Tween.get(this.loading, { onChange: () => { that.zhuazi.x = (that.loading.x + that.loading.width - 30) }, onChangeObj: that }).to({ x: -80 }, 200).call(() => {
that.tweenEnd = true; // that.tweenEnd = true;
if(that.isEnd){ // if (that.isEnd) {
FYGE.Tween.get(that.loading,{onChange:()=>{that.zhuazi.x = (that.loading.x+that.loading.width-30)},onChangeObj:that}).to({x:9},600).call(()=>{changeScene(XxlScene)});
} // // changeScene(XxlScene)
}) // // FYGE.Tween.get(that.loading,{onChange:()=>{that.zhuazi.x = (that.loading.x+that.loading.width-30)},onChangeObj:that}).to({x:9},600).call(()=>{changeScene(XxlScene)});
// }
// })
FYGE.GDispatcher.addEventListener("loadEnd",()=>{ // FYGE.GDispatcher.addEventListener("loadEnd", () => {
that.isEnd = true; // that.isEnd = true;
if(that.tweenEnd){ // if (that.tweenEnd) {
FYGE.Tween.get(that.loading,{onChange:()=>{that.zhuazi.x = (that.loading.x+that.loading.width-30)},onChangeObj:that}).to({x:9},600).call(()=>{changeScene(CsdScene)}); // changeScene(XxlScene)
} // // FYGE.Tween.get(that.loading,{onChange:()=>{that.zhuazi.x = (that.loading.x+that.loading.width-30)},onChangeObj:that}).to({x:9},600).call(()=>{changeScene(XxlScene)});
},that) // }
// }, that)
} }
} }
\ No newline at end of file
...@@ -3,9 +3,9 @@ import { RES } from "../../module/RES"; ...@@ -3,9 +3,9 @@ import { RES } from "../../module/RES";
import Root from "./Root"; import Root from "./Root";
// import res from "../../test/output.json" // import res from "../../test/output.json"
import resCanvasList from "../../../game/resCanvasList" import resCanvasList from "../../../game/resCanvasList"
import { MainScene } from "./MainScene"; import { MainScene } from "../xiaoxiaole/MainScene";
import { Ins } from "../Ins"; import { Ins } from "../Ins";
import { showPanel } from "../../module/ctrls"; import { changeScene, showPanel } from "../../module/ctrls";
import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel"; import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel";
export class StartScene extends Scene { export class StartScene extends Scene {
initUi() { initUi() {
...@@ -15,12 +15,11 @@ export class StartScene extends Scene { ...@@ -15,12 +15,11 @@ export class StartScene extends Scene {
this.x = (Ins.stageW - 750)>>1; this.x = (Ins.stageW - 750)>>1;
this.y = (Ins.stageH - 1624)>>1; this.y = (Ins.stageH - 1624)>>1;
showPanel(SelectCatPanel); // showPanel(SelectCatPanel);
changeScene(MainScene)
// this.addChild(new MainScene()); // this.addChild(new MainScene());
} }
start() {
this.initUi()
}
} }
import { Scene } from "../../module/views/Scene";
import resCanvasList from "../../resCanvasList";
import { RES } from "../../module/RES";
import { Ins } from "../Ins";
import { MainSceneBtnUi } from "../ui/mainSceneBtnUi";
import { MSG, SCENETYPE } from "../Enum";
import { showToast } from "../../module/ctrls";
import { GDispatcher } from "../Main";
import { Cat } from "../cat/Cat";
import { Tools } from "../Tools";
export class MainScene extends Scene {
bg: FYGE.Sprite
initUi() {
var that = this;
that.initSceneEle();
this.bg = Ins.initSprite("7fcd3fb3-57bd-436a-afca-989b68b6b311")
that.addChild(this.bg)
this.setHexagram(7)
}
// 初始化六角形4/7/10/13/16....
setHexagram(max: number) {
let c = Math.ceil(max / 2)
let x = (2 * max + 1) / 3
let str = ""
for (let i = 0; i < 2 * max - x; i++) {
if (i < max - x) {
for (let j = 0; j <= i; j++) {
str += `${j}`
}
str += '\n'
} else if (i >= max - x && i <= c) {
console.log(i, max - i - 2 + x)
for (let j = max - i - 2 + x; j > 0; j--) {
str += `${j}`
}
str += '\n'
} else if (i > c && i < max) {
for (let j = 0; j < i + 1; j++) {
str += `${j}`
}
str += '\n'
} else {
for (let j = max - i - 2 + x; j > 0; j--) {
str += `${j}`
}
str += '\n'
}
}
console.log(str)
}
/**初始化场景元素 */
initSceneEle() {
console.log(1111)
}
initEvents() {
var that = this;
console.log("主场景添加事件")
// that.tlBtn.addEventListener(FYGE.MouseEvent.CLICK,()=>{that.changeMainScene(SCENETYPE.CLASSROOM)},that);
// that.mxqBtn.addEventListener(FYGE.MouseEvent.CLICK,()=>{that.changeMainScene(SCENETYPE.PLAYGROUND)},that);
// FYGE.GDispatcher.addEventListener(MSG.CHANGE_SCENE,()=>{that.changeMainScene(SCENETYPE.BEADROOM)},that);
}
removeEvents() {
var that = this;
console.log("主场景移除事件")
// that.tlBtn.removeEventListener(FYGE.MouseEvent.CLICK,()=>{that.changeMainScene(SCENETYPE.CLASSROOM)},that);
// that.mxqBtn.removeEventListener(FYGE.MouseEvent.CLICK,()=>{that.changeMainScene(SCENETYPE.PLAYGROUND)},that);
// FYGE.GDispatcher.removeEventListener(MSG.CHANGE_SCENE,()=>{that.changeMainScene(SCENETYPE.BEADROOM)},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 res from "../../test/output.json" // import res from "../../test/output.json"
import resCanvasList from "../../../game/resCanvasList" import resCanvasList from "../../resCanvasList"
import { Ins } from "../Ins"; import { Ins } from "../Ins";
import { showPanel } from "../../module/ctrls"; import { changeScene, showPanel } from "../../module/ctrls";
import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel"; import { SelectCatPanel } from "../panels/selectcatpanel/SelectCatPanel";
import { MainScene } from "./MainScene";
export class XxlScene extends Scene { export class XxlScene extends Scene {
initUi() { initUi() {
super.initUi(); super.initUi();
var sceneBg = Ins.initSprite("b3c8c187-e5c9-4968-9a00-a118d18ab2fc"); var sceneBg = Ins.initSprite("b3c8c187-e5c9-4968-9a00-a118d18ab2fc");
this.addChild(sceneBg); this.addChild(sceneBg);
this.x = (Ins.stageW - 750)>>1; this.x = (Ins.stageW - 750) >> 1;
this.y = (Ins.stageH - 1624)>>1; this.y = (Ins.stageH - 1624) >> 1;
showPanel(SelectCatPanel); // showPanel(SelectCatPanel);
// this.addChild(new MainScene()); // this.addChild(new MainScene());
} changeScene(MainScene);
start() {
this.initUi()
} }
} }
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