Commit 879d39e0 authored by wildfirecode13's avatar wildfirecode13

1

parent 9862d383
...@@ -10,6 +10,12 @@ const resCanvasList = { ...@@ -10,6 +10,12 @@ const resCanvasList = {
ext: '.png', ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/bg.c4359b9ea9e843cd8d929567b2fb52ed5518e105.png', url: '//yun.duiba.com.cn/spark/assets/bg.c4359b9ea9e843cd8d929567b2fb52ed5518e105.png',
uuid: 'cb54f3b5-0469-46d1-99ea-734153b92078' uuid: 'cb54f3b5-0469-46d1-99ea-734153b92078'
},
'593e9d74-4944-496a-b6c1-8316756f8bf7': {
name: '宝箱2',
ext: '.png',
uuid: '593e9d74-4944-496a-b6c1-8316756f8bf7',
url: '//yun.duiba.com.cn/spark/assets/022e25a3984ff122fbf960bd0cb87bff48f8c3bf.png'
} }
}; };
export default resCanvasList; export default resCanvasList;
...@@ -8,6 +8,7 @@ import { destroyNetData } from "./TaoBaoNet"; ...@@ -8,6 +8,7 @@ import { destroyNetData } from "./TaoBaoNet";
import resCanvasList from '../resCanvasList'; import resCanvasList from '../resCanvasList';
import { setStage } from "./scenes/stage";
/** /**
...@@ -40,6 +41,7 @@ export class Main { ...@@ -40,6 +41,7 @@ export class Main {
FYGE.RENDERER_TYPE.CANVAS FYGE.RENDERER_TYPE.CANVAS
); );
this.stage = stage; this.stage = stage;
setStage(stage);
//开始循环 //开始循环
// FYGE.Stage.flushAll(); // FYGE.Stage.flushAll();
//stage初始化 //stage初始化
......
import resCanvasList from "../../resCanvasList";
import { RES } from "../../module/RES";
import { getStage } from "./stage";
export default class DropItem extends FYGE.Sprite {
constructor() {
super();
this.texture = RES.getRes(
resCanvasList["593e9d74-4944-496a-b6c1-8316756f8bf7"].url
);
getStage().addEventListener(
FYGE.Event.ENTER_FRAME,
this.onEnterFrame,
this
);
this.y= 0;
}
onEnterFrame() {
this.y +=10;
}
}
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import resCanvasList from "../../resCanvasList"; import resCanvasList from "../../resCanvasList";
import DropItem from "./DropItem";
export default class Root extends FYGE.Container { export default class Root extends FYGE.Container {
constructor() { constructor() {
super(); super();
...@@ -12,6 +13,17 @@ export default class Root extends FYGE.Container { ...@@ -12,6 +13,17 @@ export default class Root extends FYGE.Container {
resCanvasList["cb54f3b5-0469-46d1-99ea-734153b92078"].url resCanvasList["cb54f3b5-0469-46d1-99ea-734153b92078"].url
); );
this.addChild(bg); this.addChild(bg);
this.addChild(new DropItem())
// SvgaParser.loadSvga(
// "//yun.duiba.com.cn/spark/assets/open_effect.b997f18f52ca96abb0913ca32fdce6f22ad9bcf7.svga",
// (v:any) => {
// console.log(v)
// this.addChild(v)
// },
// () => {}
// );
} }
onAddToStage() { onAddToStage() {
......
let _stage;
export const getStage = ():FYGE.Stage => _stage;
export const setStage = (stage) => {
_stage = stage;
};
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