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
efab095d
Commit
efab095d
authored
Jun 16, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复
parent
14372fa3
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
397 additions
and
48 deletions
+397
-48
engine.js
debug/engine.js
+348
-39
engine.js.map
debug/engine.js.map
+1
-1
manifest.json
manifest.json
+1
-1
Container.ts
src/2d/display/Container.ts
+6
-0
AlignManager.ts
src/zeroing/decorators/AlignManager.ts
+6
-2
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+17
-1
web.ts
src/zeroing/web.ts
+18
-4
No files found.
debug/engine.js
View file @
efab095d
This diff is collapsed.
Click to expand it.
debug/engine.js.map
View file @
efab095d
This diff is collapsed.
Click to expand it.
manifest.json
View file @
efab095d
{
"id"
:
"engine"
,
"url"
:
"engine.dee8bb73f7c234c7fe2527549add0fab7ca3d3fc.js"
}
\ No newline at end of file
{
"id"
:
"engine"
,
"url"
:
"engine.8ae778db8ef99e121b1d622a45079bb758d196e1.js"
}
\ No newline at end of file
src/2d/display/Container.ts
View file @
efab095d
...
...
@@ -784,6 +784,9 @@ export default class Container extends DisplayObject {
}
set
x
(
value
:
number
)
{
if
(
this
.
destroyed
){
return
;
}
if
(
value
==
this
.
transform
.
position
.
x
)
return
;
this
.
transform
.
position
.
x
=
value
;
...
...
@@ -795,6 +798,9 @@ export default class Container extends DisplayObject {
}
set
y
(
value
:
number
)
{
if
(
this
.
destroyed
){
return
;
}
if
(
value
==
this
.
transform
.
position
.
y
)
return
;
this
.
transform
.
position
.
y
=
value
;
...
...
src/zeroing/decorators/AlignManager.ts
View file @
efab095d
...
...
@@ -137,15 +137,19 @@ class AlignManager {
}
}
if
(
that
.
children
){
that
.
children
.
forEach
(
v
=>
this
.
align
(
v
));
}
}
/**
* 自动大小
* @param that
*/
private
autoSize
(
that
)
{
if
(
!
that
.
children
){
return
;
}
const
len
=
that
.
children
.
length
if
(
len
>
0
)
{
...
...
src/zeroing/game-warpper/GameStage.ts
View file @
efab095d
...
...
@@ -322,7 +322,7 @@ export class GameStage extends Node {
};
async
loadPreloadAssets
(
onPreloadAssetsProgress
,
onPreloadAssetsComplete
)
{
const
{
assets
,}
=
this
.
_config
;
const
{
assets
,
customs
}
=
this
.
_config
;
let
loaded
=
0
;
let
assetsToLoad
=
assets
;
...
...
@@ -342,9 +342,25 @@ export class GameStage extends Node {
}
}
else
{
total
=
assetsToLoad
.
length
;
if
(
customs
)
{
for
(
let
custom
of
customs
)
{
if
(
custom
.
assets
)
{
total
+=
custom
.
assets
.
length
;
}
}
}
await
loadAssets
(
assetsToLoad
,
p
).
catch
(
e
=>
{
console
.
log
(
e
);
});
if
(
customs
)
{
for
(
let
custom
of
customs
)
{
if
(
custom
.
assets
)
{
await
loadAssets
(
custom
.
assets
,
p
).
catch
(
e
=>
{
console
.
log
(
e
);
});
}
}
}
}
function
p
()
{
...
...
src/zeroing/web.ts
View file @
efab095d
...
...
@@ -21,17 +21,31 @@ for (let item of search.replace('?', '').split('&')) {
* @param parent
*/
export
function
appendScript
(
script
,
parent
=
document
.
body
)
{
if
(
!
script
)
{
if
(
!
script
)
{
return
;
}
let
scriptContent
;
if
(
script
.
indexOf
(
'<script'
)
===
0
)
{
let
temp
=
document
.
createElement
(
'div'
);
temp
.
innerHTML
=
script
;
scriptContent
=
temp
.
children
[
0
].
innerHTML
;
for
(
let
i
=
0
,
li
=
temp
.
children
.
length
;
i
<
li
;
i
++
)
{
const
child
:
any
=
temp
.
children
[
i
];
if
(
child
.
src
)
{
parent
.
appendChild
(
child
);
i
--
;
li
--
;
}
else
{
_appendScript
(
child
.
innerHTML
,
parent
);
}
}
}
else
{
scriptContent
=
script
;
_appendScript
(
script
,
parent
)
;
}
}
function
_appendScript
(
scriptContent
,
parent
)
{
let
scriptEl
=
document
.
createElement
(
'script'
);
scriptEl
.
innerHTML
=
scriptContent
;
parent
.
appendChild
(
scriptEl
);
...
...
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