Commit f9542e93 authored by wildfirecode13's avatar wildfirecode13

1

parent 232ff81b
......@@ -311,7 +311,7 @@ export namespace RES {
let mark = true;
for (var i = 0; i < countAll; i++) {
let resName = arr[i]['url'];
getResAsync(resName, (res, str) => {
getResAsync("https:"+resName, (res, str) => {
//标记失败,如果有一项资源加载失败,标记下
if (!res) mark = false
if (++count == countAll) callback(mark);
......
......@@ -75,6 +75,7 @@ export class Main {
// RES.loadSkinConfig(SkinJson);
//加载通用资源
// await RES.loadGroup("common");
await RES.loadSparkAssets(resCanvasList);
console.log("通用资源加载完成")
//打开开始场景
......
{
"pages": ["pages/pagecanvas/pagecanvas", "pages/pagemycanvaspage/pagemycanvaspage"],
"pages": ["pages/pagecanvas/pagecanvas"],
"window": {
"enableSkia": "true",
"allowsBounceVertical":"NO"
......
......@@ -128,10 +128,13 @@ var RES;
}
var p = new Promise(function (resolve, reject) {
loadResList(function (s) {
console.log("恶趣味群翁群")
if (s) {
console.lo('res')
resolve();
}
else {
console.lo('rej')
reject();
}
}, list);
......@@ -173,8 +176,10 @@ var RES;
RES.loadGroup = loadGroup;
function getResAsync(str, comFun, thisObj) {
var type = str.substring(str.lastIndexOf(".") + 1, str.length);
console.log("奥术大师多"+str)
if (type == "png" || type == "jpg") {
if (FYGE.TextureCache[str]) {
console.log("奥术大师多"+str)
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
new Promise(function (r) {
r(FYGE.TextureCache[str]);
......@@ -183,13 +188,16 @@ var RES;
else {
return new Promise(function (resolve, reject) {
FYGE.GlobalLoader.loadImage(function (s, image) {
// console.log("asdasdasdqqqq"+str,s)
if (s) {
FYGE.Texture.addToCache(FYGE.Texture.from(image), str);
comFun && comFun.call(thisObj, FYGE.TextureCache[str], str);
console.log("asdasdasdqqqq"+str,s)
resolve(FYGE.TextureCache[str]);
}
else {
comFun && comFun.call(thisObj, null, str);
console.log("zxczxczxc"+str,s)
reject();
}
}, str);
......@@ -260,11 +268,17 @@ var RES;
var mark = true;
for (var i = 0; i < countAll; i++) {
var resName = arr[i]['url'];
getResAsync(resName, function (res, str) {
console.log(resName)
getResAsync("https:"+resName, function (res, str) {
console.log("asdasdasdas",res)
if (!res)
mark = false;
if (++count == countAll)
callback(mark);
if (++count == countAll){
console.log("玩儿若:asasdd")
callback(mark);
}
console.log("玩儿若:"+count,countAll)
}, this);
}
}
......@@ -1261,6 +1275,7 @@ var Main = (function () {
case 0:
layers_1.layers.init(this.stage);
console.log("初始化层级完成");
console.log("resCanvasList_1.default:",resCanvasList_1.default)
return [4, RES_1.RES.loadSparkAssets(resCanvasList_1.default)];
case 1:
_a.sent();
......
.mycanvaspage {
top: 0rpx;
left: 0rpx;
width: 750rpx;
height: 1624rpx;
display: block;
position: absolute;
}
.mycanvaspage .canvas {
width: 300rpx;
height: 300rpx;
opacity: 1;
display: block;
left: 0rpx;
top: 0rpx;
position: absolute;
}
<view class="mycanvaspage">
<view>
<canvas id="canvas" type="2d" class="canvas" disable-scroll="true" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady"></canvas>
</view>
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList'; //import API from '../../api';
Page({
data: {},
onLoad(props) {
this.setData(this.data || {
resList: resList
});
}
});
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
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