Commit 27fe421a authored by Edwise's avatar Edwise 🍷

Merge remote-tracking branch 'refs/remotes/origin/master'

parents 44a290e9 f9542e93
......@@ -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);
......
{
"pages": ["pages/pagecanvas/pagecanvas", "pages/pagemycanvaspage/pagemycanvaspage"],
"pages": ["pages/pagecanvas/pagecanvas"],
"window": {
"enableSkia": "true",
"allowsBounceVertical":"NO"
......
......@@ -129,10 +129,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);
......@@ -174,8 +177,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]);
......@@ -184,13 +189,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);
......@@ -261,11 +269,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);
}
}
......@@ -1262,6 +1276,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