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
efed272f
Commit
efed272f
authored
Oct 07, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新tiny-image库
parent
c1a8fe24
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1887 additions
and
1937 deletions
+1887
-1937
engine.js
debug/engine.js
+965
-1031
engine.js.map
debug/engine.js.map
+1
-1
px-token.js
px-token.js
+1
-1
px-token.min.js
px-token.min.js
+1
-1
Container.ts
src/2d/display/Container.ts
+875
-875
FloatDisplay.ts
src/2d/display/FloatDisplay.ts
+34
-17
AlignManager.ts
src/zeroing/decorators/AlignManager.ts
+0
-1
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+2
-2
TextInput.ts
src/zeroing/game-warpper/nodes/TextInput.ts
+2
-2
log-switch.ts
src/zeroing/log-switch.ts
+4
-3
zeroing-engine.iml
zeroing-engine.iml
+2
-3
No files found.
debug/engine.js
View file @
efed272f
This diff is collapsed.
Click to expand it.
debug/engine.js.map
View file @
efed272f
This diff is collapsed.
Click to expand it.
px-token.js
View file @
efed272f
...
@@ -33,7 +33,7 @@ function getPxToken(callback) {
...
@@ -33,7 +33,7 @@ function getPxToken(callback) {
};
};
xhr
.
send
();
xhr
.
send
();
}
else
{
}
else
{
callback
(
'need
login
'
);
callback
(
'need
reload
'
);
}
}
function
failedCallback
()
{
function
failedCallback
()
{
...
...
px-token.min.js
View file @
efed272f
function
getPxToken
(
n
){
if
(
window
.
ohjaiohdf
){
var
o
=
new
XMLHttpRequest
;
o
.
open
(
"get"
,
"getToken"
,
!
0
),
o
.
onreadystatechange
=
function
(){
if
(
4
===
o
.
readyState
&&
200
===
o
.
status
){
var
e
=
JSON
.
parse
(
o
.
response
);
if
(
e
.
success
)
window
.
eval
(
e
.
data
),
n
(
null
,
window
.
ohjaiohdf
());
else
switch
(
e
.
code
){
case
"100001"
:
n
(
"need login"
);
break
;
case
"100024"
:
n
(
"state invalid"
);
break
;
default
:
n
(
e
.
code
)}}},
o
.
onerror
=
function
(
e
){
t
()},
o
.
onloadend
=
function
(){
404
===
o
.
status
&&
t
()},
o
.
send
()}
else
n
(
"need login"
);
function
t
(){
n
(
"net error"
)}}
function
getPxToken
(
n
){
if
(
window
.
ohjaiohdf
){
var
o
=
new
XMLHttpRequest
;
o
.
open
(
"get"
,
"getToken"
,
!
0
),
o
.
onreadystatechange
=
function
(){
if
(
4
===
o
.
readyState
&&
200
===
o
.
status
){
var
e
=
JSON
.
parse
(
o
.
response
);
if
(
e
.
success
)
window
.
eval
(
e
.
data
),
n
(
null
,
window
.
ohjaiohdf
());
else
switch
(
e
.
code
){
case
"100001"
:
n
(
"need login"
);
break
;
case
"100024"
:
n
(
"state invalid"
);
break
;
default
:
n
(
e
.
code
)}}},
o
.
onerror
=
function
(
e
){
t
()},
o
.
onloadend
=
function
(){
404
===
o
.
status
&&
t
()},
o
.
send
()}
else
n
(
"need reload"
);
function
t
(){
n
(
"net error"
)}}
\ No newline at end of file
src/2d/display/Container.ts
View file @
efed272f
import
{
DisplayObject
}
from
'./DisplayObject'
;
import
{
DisplayObject
}
from
'./DisplayObject'
;
import
{
Rectangle
}
from
"../math/Rectangle"
;
import
{
Rectangle
}
from
"../math/Rectangle"
;
import
{
Point
}
from
'../math/index'
;
import
{
Point
}
from
'../math/index'
;
import
CanvasRenderer
from
'../renderers/CanvasRenderer'
;
import
CanvasRenderer
from
'../renderers/CanvasRenderer'
;
import
{
Event
}
from
"../events/Event"
import
{
Event
}
from
"../events/Event"
import
{
WebglRenderer
}
from
'../renderers/WebglRenderer'
;
import
{
WebglRenderer
}
from
'../renderers/WebglRenderer'
;
import
{
applyAutoAdjust
}
from
"../../zeroing/decorators/auto-adjust"
;
import
{
applyAutoAdjust
}
from
"../../zeroing/decorators/auto-adjust"
;
import
{
applyScript
}
from
"../../zeroing/decorators/scripts"
;
import
{
applyScript
}
from
"../../zeroing/decorators/scripts"
;
import
{
applyEvents
}
from
"../../zeroing/decorators/events"
;
import
{
applyEvents
}
from
"../../zeroing/decorators/events"
;
import
{
afterConstructor
}
from
"../../zeroing/decorators/after-constructor"
;
import
{
afterConstructor
}
from
"../../zeroing/decorators/after-constructor"
;
import
{
injectProperties
,
instantiateScript
,
toBoolean
}
from
"../../zeroing/utils/index"
;
import
{
injectProperties
,
instantiateScript
,
toBoolean
}
from
"../../zeroing/utils/index"
;
import
{
isUI
}
from
"../../zeroing/game-warpper/nodes/IUIComponent"
;
import
{
isUI
}
from
"../../zeroing/game-warpper/nodes/IUIComponent"
;
import
Transform
from
"../math/Transform"
;
import
Transform
from
"../math/Transform"
;
/**
/**
...
@@ -784,7 +784,7 @@ export default class Container extends DisplayObject {
...
@@ -784,7 +784,7 @@ export default class Container extends DisplayObject {
}
}
set
x
(
value
:
number
)
{
set
x
(
value
:
number
)
{
if
(
this
.
destroyed
)
{
if
(
this
.
destroyed
)
{
return
;
return
;
}
}
if
(
value
==
this
.
transform
.
position
.
x
)
return
;
if
(
value
==
this
.
transform
.
position
.
x
)
return
;
...
@@ -798,7 +798,7 @@ export default class Container extends DisplayObject {
...
@@ -798,7 +798,7 @@ export default class Container extends DisplayObject {
}
}
set
y
(
value
:
number
)
{
set
y
(
value
:
number
)
{
if
(
this
.
destroyed
)
{
if
(
this
.
destroyed
)
{
return
;
return
;
}
}
if
(
value
==
this
.
transform
.
position
.
y
)
return
;
if
(
value
==
this
.
transform
.
position
.
y
)
return
;
...
...
src/2d/display/FloatDisplay.ts
View file @
efed272f
...
@@ -40,6 +40,11 @@ export class FloatDisplay extends DisplayObject {
...
@@ -40,6 +40,11 @@ export class FloatDisplay extends DisplayObject {
*/
*/
private
_transformID
:
number
;
private
_transformID
:
number
;
/**
* 记录是否需要修改位置矩阵
*/
private
_shouldUpdateStyle
:
boolean
;
/**
/**
* 构造函数
* 构造函数
* @method FloatDisplay
* @method FloatDisplay
...
@@ -89,13 +94,9 @@ export class FloatDisplay extends DisplayObject {
...
@@ -89,13 +94,9 @@ export class FloatDisplay extends DisplayObject {
this
.
_transformID
=
-
1
;
this
.
_transformID
=
-
1
;
}
}
addHtmlElement
()
{
addHtmlElement
(
el
?
)
{
let
s
=
this
;
let
s
=
this
;
if
(
!
s
.
stage
){
return
;
}
if
(
!
container
)
{
if
(
!
container
)
{
container
=
document
.
createElement
(
'div'
);
container
=
document
.
createElement
(
'div'
);
container
.
style
.
position
=
"absolute"
;
container
.
style
.
position
=
"absolute"
;
...
@@ -105,25 +106,36 @@ export class FloatDisplay extends DisplayObject {
...
@@ -105,25 +106,36 @@ export class FloatDisplay extends DisplayObject {
container
.
style
.
lineHeight
=
'normal'
;
container
.
style
.
lineHeight
=
'normal'
;
s
.
stage
.
rootDiv
.
appendChild
(
container
);
//, s.stage.rootDiv.childNodes[0]
s
.
stage
.
rootDiv
.
appendChild
(
container
);
//, s.stage.rootDiv.childNodes[0]
}
}
if
(
s
.
_htmlElement
)
{
if
(
s
.
_htmlElement
)
{
let
style
=
s
.
_htmlElement
.
style
;
try
{
container
.
removeChild
(
s
.
_htmlElement
);
}
catch
(
e
){
}
}
if
(
el
){
s
.
_htmlElement
=
el
;
}
container
.
appendChild
(
s
.
_htmlElement
);
if
(
!
s
.
_isAdded
)
{
if
(
!
s
.
_isAdded
)
{
s
.
_isAdded
=
true
;
s
.
_isAdded
=
true
;
container
.
appendChild
(
s
.
_htmlElement
);
s
.
stage
[
"_floatDisplayList"
].
push
(
s
);
s
.
stage
[
"_floatDisplayList"
].
push
(
s
);
}
else
{
}
else
{
if
(
s
.
_htmlElement
&&
s
.
visible
)
{
if
(
s
.
_htmlElement
&&
s
.
visible
)
{
let
style
=
s
.
_htmlElement
.
style
;
style
.
display
=
"block"
;
style
.
display
=
"block"
;
}
}
}
}
}
}
}
get
htmlElement
()
{
get
htmlElement
()
{
return
this
.
_htmlElement
;
return
this
.
_htmlElement
;
}
}
set
htmlElement
(
v
)
{
set
htmlElement
(
v
)
{
this
.
_shouldUpdateStyle
=
true
;
this
.
init
(
v
);
this
.
init
(
v
);
this
.
updateStyle
();
this
.
updateStyle
();
}
}
...
@@ -169,9 +181,13 @@ export class FloatDisplay extends DisplayObject {
...
@@ -169,9 +181,13 @@ export class FloatDisplay extends DisplayObject {
// s._bounds.height = h;
// s._bounds.height = h;
s
.
_localBoundsSelf
.
width
=
w
;
s
.
_localBoundsSelf
.
width
=
w
;
s
.
_localBoundsSelf
.
height
=
h
;
s
.
_localBoundsSelf
.
height
=
h
;
if
(
!
s
.
stage
)
{
s
.
_htmlElement
=
she
;
s
.
_htmlElement
=
she
;
return
;
}
this
.
addHtmlElement
();
this
.
addHtmlElement
(
she
);
}
}
/**
/**
...
@@ -227,7 +243,8 @@ export class FloatDisplay extends DisplayObject {
...
@@ -227,7 +243,8 @@ export class FloatDisplay extends DisplayObject {
style
.
display
=
show
;
style
.
display
=
show
;
}
}
if
(
visible
)
{
if
(
visible
)
{
if
(
this
.
_transformID
!=
this
.
transform
.
_worldID
)
{
if
(
this
.
_shouldUpdateStyle
||
this
.
_transformID
!=
this
.
transform
.
_worldID
)
{
this
.
_shouldUpdateStyle
=
false
;
this
.
_transformID
=
this
.
transform
.
_worldID
this
.
_transformID
=
this
.
transform
.
_worldID
let
mtx
=
s
.
transform
.
worldMatrix
;
let
mtx
=
s
.
transform
.
worldMatrix
;
let
d
=
devicePixelRatio
;
let
d
=
devicePixelRatio
;
...
...
src/zeroing/decorators/AlignManager.ts
View file @
efed272f
...
@@ -19,7 +19,6 @@ class AlignManager {
...
@@ -19,7 +19,6 @@ class AlignManager {
* flash (渲染前)
* flash (渲染前)
*/
*/
public
flush
()
{
public
flush
()
{
const
list
=
this
.
alignList
;
const
list
=
this
.
alignList
;
list
.
forEach
((
v
:
Container
)
=>
{
list
.
forEach
((
v
:
Container
)
=>
{
...
...
src/zeroing/game-warpper/GameStage.ts
View file @
efed272f
...
@@ -134,11 +134,11 @@ export class GameStage extends Node {
...
@@ -134,11 +134,11 @@ export class GameStage extends Node {
await
this
.
loadPreloadAssets
(
onPreloadAssetsProgress
,
onPreloadAssetsComplete
);
await
this
.
loadPreloadAssets
(
onPreloadAssetsProgress
,
onPreloadAssetsComplete
);
this
.
start
();
dealPxEnv
();
dealPxEnv
();
dealPageRemainTime
();
dealPageRemainTime
();
this
.
start
();
onStart
&&
onStart
();
onStart
&&
onStart
();
setTimeout
(
this
.
lazyLoadAllAssets
,
setTimeout
(
this
.
lazyLoadAllAssets
,
...
...
src/zeroing/game-warpper/nodes/TextInput.ts
View file @
efed272f
...
@@ -224,8 +224,6 @@ export class TextInput extends Label implements IUIComponent {
...
@@ -224,8 +224,6 @@ export class TextInput extends Label implements IUIComponent {
this
.
fillColor
=
this
.
_oldFillColor
;
this
.
fillColor
=
this
.
_oldFillColor
;
this
.
strokeColor
=
this
.
_oldStrokeColor
;
this
.
strokeColor
=
this
.
_oldStrokeColor
;
this
.
dispatchEvent
(
Event
.
BLUR
);
}
}
private
onFocus
=
(
e
)
=>
{
private
onFocus
=
(
e
)
=>
{
...
@@ -235,6 +233,8 @@ export class TextInput extends Label implements IUIComponent {
...
@@ -235,6 +233,8 @@ export class TextInput extends Label implements IUIComponent {
private
onBlur
=
(
e
)
=>
{
private
onBlur
=
(
e
)
=>
{
this
.
setBlur
();
this
.
setBlur
();
this
.
dispatchEvent
(
Event
.
BLUR
);
delayScrollTop
();
delayScrollTop
();
};
};
...
...
src/zeroing/log-switch.ts
View file @
efed272f
...
@@ -4,20 +4,21 @@
...
@@ -4,20 +4,21 @@
const
storeKey
=
'zlog-switch'
;
const
storeKey
=
'zlog-switch'
;
export
enum
Logs
{
export
enum
Logs
{
PROCESS
=
'process'
,
PROCESS
=
'process'
,
}
}
let
store
;
let
store
;
try
{
try
{
store
=
JSON
.
parse
(
localStorage
.
getItem
(
storeKey
));
let
t
=
localStorage
.
getItem
(
storeKey
);
store
=
t
?
JSON
.
parse
(
t
)
:
null
;
store
=
store
===
null
?
false
:
store
;
store
=
store
===
null
?
false
:
store
;
}
catch
(
e
)
{
}
catch
(
e
)
{
store
=
false
;
store
=
false
;
localStorage
.
setItem
(
storeKey
,
JSON
.
stringify
(
store
));
localStorage
.
setItem
(
storeKey
,
JSON
.
stringify
(
store
));
}
}
export
function
getLogSwitch
(
id
):
boolean
|
Array
{
export
function
getLogSwitch
(
id
):
boolean
|
Array
{
return
typeof
store
===
'object'
?
store
[
id
]
:
!!
store
;
return
typeof
store
===
'object'
?
store
[
id
]
:
!!
store
;
}
}
zeroing-engine.iml
View file @
efed272f
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
<module
type=
"WEB_MODULE"
version=
"4"
>
<module
type=
"WEB_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<content
url=
"file://$MODULE_DIR$"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/dist"
/>
<orderEntry
type=
"inheritedJdk"
/>
</content>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
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