Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-engine
Commits
7c76d13a
Commit
7c76d13a
authored
Mar 27, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
96c534b8
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
18 deletions
+27
-18
engine.js
debug/engine.js
+9
-6
engine.js.map
debug/engine.js.map
+1
-1
manifest.json
manifest.json
+1
-1
Stage.ts
src/2d/display/Stage.ts
+6
-1
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+7
-6
assets-manager.ts
src/zeroing/game-warpper/assets-manager.ts
+3
-3
No files found.
debug/engine.js
View file @
7c76d13a
...
@@ -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
loadAsset
s
(
config
,
onProgress
,
onComplete
)
{
function
loadAsset
Group
(
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
,
on
AssetsProgress
,
on
AssetsComplete
,
onStart
)
{
GameStage
.
prototype
.
launch
=
function
(
config
,
on
PreloadAssetsProgress
,
onPreload
AssetsComplete
,
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
,
loadAsset
s
(
assets
,
p
).
catch
(
function
(
e
)
{
return
[
4
,
loadAsset
Group
(
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
,
loadAsset
s
(
custom
.
assets
,
p
).
catch
(
function
(
e
)
{
return
[
4
,
loadAsset
Group
(
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
.
loadAsset
s
=
loadAssets
;
exports
.
loadAsset
Group
=
loadAssetGroup
;
exports
.
log10
=
log10
;
exports
.
log10
=
log10
;
exports
.
log2
=
log2
;
exports
.
log2
=
log2
;
exports
.
mapWebGLBlendModesToPixi
=
mapWebGLBlendModesToPixi
;
exports
.
mapWebGLBlendModesToPixi
=
mapWebGLBlendModesToPixi
;
...
...
debug/engine.js.map
View file @
7c76d13a
This diff is collapsed.
Click to expand it.
manifest.json
View file @
7c76d13a
{
"id"
:
"engine"
,
"url"
:
"engine.a00613f119b951548555b2f0d7ddcd5063975f8e.js"
}
{
"id"
:
"engine"
,
"url"
:
"engine.0e9ca700c12d72334946cf67784ad8ad67977c13.js"
}
\ No newline at end of file
\ No newline at end of file
src/2d/display/Stage.ts
View file @
7c76d13a
...
@@ -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
;
...
...
src/zeroing/game-warpper/GameStage.ts
View file @
7c76d13a
...
@@ -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
{
loadAsset
s
}
from
"./assets-manager"
;
import
{
loadAsset
Group
}
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
,
on
AssetsProgress
?,
on
AssetsComplete
?,
onStart
?)
{
async
launch
(
config
,
on
PreloadAssetsProgress
?,
onPreload
AssetsComplete
?,
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
loadAsset
s
(
assets
,
p
).
catch
(
e
=>
{
await
loadAsset
Group
(
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
loadAsset
s
(
custom
.
assets
,
p
).
catch
(
e
=>
{
await
loadAsset
Group
(
custom
.
assets
,
p
).
catch
(
e
=>
{
console
.
log
(
e
);
console
.
log
(
e
);
});
});
}
}
...
...
src/zeroing/game-warpper/assets-manager.ts
View file @
7c76d13a
...
@@ -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
loadAsset
s
(
config
,
onProgress
?,
onComplete
?)
{
export
function
loadAsset
Group
(
config
,
onProgress
?,
onComplete
?)
{
let
total
=
config
.
length
;
let
total
=
config
.
length
;
let
loaded
=
0
;
let
loaded
=
0
;
let
failedList
=
[];
let
failedList
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment