Commit 7c76d13a authored by rockyl's avatar rockyl

init

parent 96c534b8
...@@ -7885,6 +7885,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -7885,6 +7885,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
return requestAnimationFrame; return requestAnimationFrame;
}()); }());
var skipTagNames = ['INPUT'];
var Stage = (function (_super) { var Stage = (function (_super) {
tslib_1.__extends(Stage, _super); tslib_1.__extends(Stage, _super);
function Stage(rootDivId, desW, desH, frameRate, scaleMode, renderType, transparent, bgColor) { function Stage(rootDivId, desW, desH, frameRate, scaleMode, renderType, transparent, bgColor) {
...@@ -8118,6 +8119,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8118,6 +8119,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
Stage.prototype.onMouseEvent = function (e) { Stage.prototype.onMouseEvent = function (e) {
var s = this; var s = this;
if (skipTagNames.indexOf(e.target.tagName) >= 0) {
return;
}
if (EventDispatcher._totalMEC > 0) { if (EventDispatcher._totalMEC > 0) {
var points = void 0; var points = void 0;
var item = s._mouseEventTypes[e.type]; var item = s._mouseEventTypes[e.type];
...@@ -8454,7 +8458,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8454,7 +8458,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Stage.allUpdateObjList = []; Stage.allUpdateObjList = [];
return Stage; return Stage;
}(Container)); }(Container));
//# sourceMappingURL=Stage.js.map
var GraphicsData = (function (_super) { var GraphicsData = (function (_super) {
tslib_1.__extends(GraphicsData, _super); tslib_1.__extends(GraphicsData, _super);
...@@ -11328,7 +11331,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11328,7 +11331,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
'.mp3': 'Sound', '.mp3': 'Sound',
'': 'Raw', '': 'Raw',
}; };
function loadAssets(config, onProgress, onComplete) { function loadAssetGroup(config, onProgress, onComplete) {
var total = config.length; var total = config.length;
var loaded = 0; var loaded = 0;
var failedList = []; var failedList = [];
...@@ -20331,7 +20334,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20331,7 +20334,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
GameStage.prototype.launch = function (config, onAssetsProgress, onAssetsComplete, onStart) { GameStage.prototype.launch = function (config, onPreloadAssetsProgress, onPreloadAssetsComplete, onStart) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
function p() { function p() {
loaded++; loaded++;
...@@ -20356,7 +20359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20356,7 +20359,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
return [4, loadAssets(assets, p).catch(function (e) { return [4, loadAssetGroup(assets, p).catch(function (e) {
console.log(e); console.log(e);
})]; })];
case 1: case 1:
...@@ -20368,7 +20371,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20368,7 +20371,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (!(_a < customs_2.length)) return [3, 5]; if (!(_a < customs_2.length)) return [3, 5];
custom = customs_2[_a]; custom = customs_2[_a];
if (!custom.assets) return [3, 4]; if (!custom.assets) return [3, 4];
return [4, loadAssets(custom.assets, p).catch(function (e) { return [4, loadAssetGroup(custom.assets, p).catch(function (e) {
console.log(e); console.log(e);
})]; })];
case 3: case 3:
...@@ -20834,7 +20837,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20834,7 +20837,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.launchWithWindowVariable = launchWithWindowVariable; exports.launchWithWindowVariable = launchWithWindowVariable;
exports.linkScheme = linkScheme; exports.linkScheme = linkScheme;
exports.linkedFlag = linkedFlag; exports.linkedFlag = linkedFlag;
exports.loadAssets = loadAssets; exports.loadAssetGroup = loadAssetGroup;
exports.log10 = log10; exports.log10 = log10;
exports.log2 = log2; exports.log2 = log2;
exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi; exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi;
......
This diff is collapsed.
{"id":"engine","url":"engine.a00613f119b951548555b2f0d7ddcd5063975f8e.js"} {"id":"engine","url":"engine.0e9ca700c12d72334946cf67784ad8ad67977c13.js"}
\ No newline at end of file \ No newline at end of file
...@@ -42,7 +42,9 @@ export const requestAnimationFrame = (function () { ...@@ -42,7 +42,9 @@ export const requestAnimationFrame = (function () {
}; };
} }
return requestAnimationFrame return requestAnimationFrame
}()) }());
const skipTagNames = ['INPUT'];
export class Stage extends Container { export class Stage extends Container {
...@@ -611,6 +613,9 @@ export class Stage extends Container { ...@@ -611,6 +613,9 @@ export class Stage extends Container {
*/ */
private onMouseEvent(e: any): void { private onMouseEvent(e: any): void {
let s: Stage = this; let s: Stage = this;
if (skipTagNames.indexOf(e.target.tagName) >= 0) {
return;
}
//检查mouse或touch事件是否有,如果有的话,就触发事件函数 //检查mouse或touch事件是否有,如果有的话,就触发事件函数
if (EventDispatcher._totalMEC > 0) { if (EventDispatcher._totalMEC > 0) {
let points: any; let points: any;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import {Stage} from "../../2d/display/index"; import {Stage} from "../../2d/display/index";
import {StackContainer} from "./StackContainer"; import {StackContainer} from "./StackContainer";
import {loadAssets} from "./assets-manager"; import {loadAssetGroup} from "./assets-manager";
import {instantiate} from "./view-interpreter"; import {instantiate} from "./view-interpreter";
import {dataCenter, DataCenter} from "./data-center"; import {dataCenter, DataCenter} from "./data-center";
import {setProcessMetaLibs} from "../behavior-runtime/index"; import {setProcessMetaLibs} from "../behavior-runtime/index";
...@@ -98,10 +98,11 @@ export class GameStage extends Node { ...@@ -98,10 +98,11 @@ export class GameStage extends Node {
/** /**
* 启动游戏 * 启动游戏
* @param config * @param config
* @param onAssetsProgress * @param onPreloadAssetsProgress 预加载素材进度
* @param onAssetsComplete * @param onPreloadAssetsComplete 预加载素材完成
* @param onStart
*/ */
async launch(config, onAssetsProgress?, onAssetsComplete?, onStart?) { async launch(config, onPreloadAssetsProgress?, onPreloadAssetsComplete?, onStart?) {
this._config = config; this._config = config;
const {assets, customs} = config; const {assets, customs} = config;
let loaded = 0; let loaded = 0;
...@@ -114,13 +115,13 @@ export class GameStage extends Node { ...@@ -114,13 +115,13 @@ export class GameStage extends Node {
} }
} }
await loadAssets(assets, p).catch(e => { await loadAssetGroup(assets, p).catch(e => {
console.log(e); console.log(e);
}); });
if (customs) { if (customs) {
for (let custom of customs) { for (let custom of customs) {
if (custom.assets) { if (custom.assets) {
await loadAssets(custom.assets, p).catch(e => { await loadAssetGroup(custom.assets, p).catch(e => {
console.log(e); console.log(e);
}); });
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
import {globalLoader} from "../../2d/loader/Loader"; import {globalLoader} from "../../2d/loader/Loader";
import {arrayFind, linkScheme} from "../utils"; import {arrayFind, linkScheme} from "../utils/index";
import {parse} from "./bmp-text-manager"; import {parse} from "./bmp-text-manager";
let assetsConfig = []; let assetsConfig = [];
...@@ -23,9 +23,9 @@ const loaderMapping = { ...@@ -23,9 +23,9 @@ const loaderMapping = {
}; };
/** /**
* 加载素材 * 加载素材
*/ */
export function loadAssets(config, onProgress?, onComplete?) { export function loadAssetGroup(config, onProgress?, onComplete?) {
let total = config.length; let total = config.length;
let loaded = 0; let loaded = 0;
let failedList = []; let failedList = [];
......
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