Commit 879d39e0 authored by wildfirecode13's avatar wildfirecode13

1

parent 9862d383
......@@ -10,6 +10,12 @@ const resCanvasList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/bg.c4359b9ea9e843cd8d929567b2fb52ed5518e105.png',
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;
......@@ -8,6 +8,7 @@ import { destroyNetData } from "./TaoBaoNet";
import resCanvasList from '../resCanvasList';
import { setStage } from "./scenes/stage";
/**
......@@ -40,6 +41,7 @@ export class Main {
FYGE.RENDERER_TYPE.CANVAS
);
this.stage = stage;
setStage(stage);
//开始循环
// FYGE.Stage.flushAll();
//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 resCanvasList from "../../resCanvasList";
import DropItem from "./DropItem";
export default class Root extends FYGE.Container {
constructor() {
super();
......@@ -12,6 +13,17 @@ export default class Root extends FYGE.Container {
resCanvasList["cb54f3b5-0469-46d1-99ea-734153b92078"].url
);
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() {
......
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