Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
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
王剑峰
renderingEngine
Commits
e0aba4ed
Commit
e0aba4ed
authored
Dec 05, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决滚动条不跟手的问题
解决舞台适配问题 优化过程执行,如果子过程只有一个就跳过
parent
e3c51ee3
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
166 additions
and
99 deletions
+166
-99
engine.js
debug/engine.js
+116
-79
engine.js.map
debug/engine.js.map
+1
-1
ScrollContainer.ts
src/2d/ui/ScrollContainer.ts
+5
-5
Process.ts
src/zeroing/behavior-runtime/Process.ts
+6
-1
auto-adjust.ts
src/zeroing/decorators/auto-adjust.ts
+9
-1
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+6
-4
StackContainer.ts
src/zeroing/game-warpper/StackContainer.ts
+2
-2
launcher.ts
src/zeroing/launcher.ts
+7
-6
utils.ts
src/zeroing/utils/utils.ts
+14
-0
No files found.
debug/engine.js
View file @
e0aba4ed
This diff is collapsed.
Click to expand it.
debug/engine.js.map
View file @
e0aba4ed
This diff is collapsed.
Click to expand it.
src/2d/ui/ScrollContainer.ts
View file @
e0aba4ed
import
Container
from
"../display/Container"
;
import
Graphics
from
"../graphics/Graphics"
;
import
{
MouseEvent
}
from
"../events/MouseEvent"
;
import
{
Event
}
from
"../events/Event"
;
import
{
MouseEvent
}
from
"../events/MouseEvent"
;
import
{
Event
}
from
"../events/Event"
;
// import Tween from "../../tweenSimple/Tween";
...
...
@@ -62,7 +62,7 @@ export class ScrollContainer extends Container {
* 最小鼠标滑动距离
* @type {number}
*/
private
minDis
:
number
=
2
;
private
minDis
:
number
=
0
;
/**
* 遮罩对象
* @property maskObj
...
...
@@ -309,8 +309,8 @@ export class ScrollContainer extends Container {
}
s
.
speed
=
0
;
s
.
isMouseDownState
=
1
;
}
else
if
(
e
.
type
==
MouseEvent
.
MOUSE_MOVE
)
{
}
else
if
(
e
.
type
==
MouseEvent
.
MOUSE_MOVE
)
{
if
(
s
.
isMouseDownState
==
0
)
return
;
if
(
s
.
isMouseDownState
==
1
)
{
s
.
dispatchEvent
(
Event
.
ON_SCROLL_START
);
}
...
...
src/zeroing/behavior-runtime/Process.ts
View file @
e0aba4ed
...
...
@@ -78,7 +78,12 @@ export class Process {
}
}
else
{
const
scriptResult
=
await
this
.
_executeMetaScript
(
''
,
args
,
metaConfig
);
const
subProcessResult
=
await
this
.
_executeSubProcess
(
scriptResult
.
type
,
scriptResult
.
payload
);
let
subProcessResult
;
if
(
this
.
_meta
.
sub
&&
Object
.
keys
(
this
.
_meta
.
sub
).
length
>
1
)
{
subProcessResult
=
await
this
.
_executeSubProcess
(
scriptResult
.
type
,
scriptResult
.
payload
);
}
else
{
subProcessResult
=
scriptResult
;
}
result
=
await
this
.
_executeNextProcess
(
subProcessResult
.
type
,
subProcessResult
.
payload
);
}
...
...
src/zeroing/decorators/auto-adjust.ts
View file @
e0aba4ed
...
...
@@ -5,6 +5,7 @@
*/
import
{
Event
}
from
"../../2d/events"
;
import
{
Stage
}
from
"../../2d/display"
;
/**
* 应用自适应
...
...
@@ -94,7 +95,14 @@ class AdjustProxy {
adjustLayout
()
{
const
that
=
this
.
_host
;
const
{
width
:
pWidth
,
height
:
pHeight
}
=
that
.
parent
;
let
pWidth
,
pHeight
;
//if(that.parent instanceof Stage){
// pWidth = that.parent.desWidth;
// pHeight = that.parent.desHeight;
//}else{
pWidth
=
that
.
parent
.
width
;
pHeight
=
that
.
parent
.
height
;
//}
const
{
width
,
height
}
=
that
;
const
{
percentWidth
,
percentHeight
,
left
,
top
,
right
,
bottom
,
horizonCenter
,
verticalCenter
}
=
this
.
data
;
...
...
src/zeroing/game-warpper/GameStage.ts
View file @
e0aba4ed
...
...
@@ -35,11 +35,13 @@ export class GameStage extends Container {
this
.
name
=
'game-stage'
;
stage
.
width
=
stage
.
viewRect
.
width
;
stage
.
height
=
stage
.
viewRect
.
height
;
this
.
_stage
=
stage
;
this
.
_dataCenter
=
dataCenter
;
this
[
'percentWidth'
]
=
100
;
this
[
'percentHeight'
]
=
100
;
this
.
percentWidth
=
100
;
this
.
percentHeight
=
100
;
this
.
mouseEnabled
=
false
;
let
blackLayer
=
this
.
_blackLayer
=
new
Rect
();
...
...
@@ -49,8 +51,8 @@ export class GameStage extends Container {
this
.
addChild
(
this
.
_popupContainer
=
new
StackContainer
(
false
));
this
.
addChild
(
this
.
_toast
=
new
Toast
(
this
));
blackLayer
[
'percentWidth'
]
=
100
;
blackLayer
[
'percentHeight'
]
=
100
;
blackLayer
.
percentWidth
=
100
;
blackLayer
.
percentHeight
=
100
;
blackLayer
.
visible
=
false
;
blackLayer
.
fillColor
=
0
;
blackLayer
.
alpha
=
0.7
;
...
...
src/zeroing/game-warpper/StackContainer.ts
View file @
e0aba4ed
...
...
@@ -16,8 +16,8 @@ export class StackContainer extends Container {
this
.
_mutex
=
mutex
;
this
[
'percentWidth'
]
=
100
;
this
[
'percentHeight'
]
=
100
;
this
.
percentWidth
=
100
;
this
.
percentHeight
=
100
;
this
.
mouseEnabled
=
false
;
}
...
...
src/zeroing/launcher.ts
View file @
e0aba4ed
...
...
@@ -7,6 +7,7 @@ import {RENDERER_TYPE, StageScaleMode} from "..";
import
{
GameStage
}
from
"./game-warpper"
;
import
{
setGlobalContext
}
from
"./behavior-runtime"
;
import
{
globalLoader
}
from
"../2d/loader/Loader"
;
import
{
Event
}
from
"../2d/events/Event"
;
export
let
gameStage
;
...
...
@@ -40,13 +41,13 @@ export function launchWithConfig(config, onAssetsProgress, onAssetsComplete) {
);
Stage
.
flushAll
();
stage
.
addEventListener
(
Event
.
ON_INIT_STAGE
,
()
=>
{
gameStage
=
new
GameStage
(
stage
);
setGlobalContext
({
gameStage
});
stage
.
addChild
(
gameStage
);
setTimeout
(()
=>
{
gameStage
.
launch
(
config
,
onAssetsProgress
,
onAssetsComplete
);
});
...
...
src/zeroing/utils/utils.ts
View file @
e0aba4ed
...
...
@@ -204,3 +204,17 @@ export function findVariable(name: string, ...contexts) {
}
return
result
;
}
let
el
;
export
function
htmlToPureText
(
htmlText
)
{
if
(
!
el
)
{
el
=
document
.
createElement
(
'div'
);
}
el
.
innerHTML
=
htmlText
;
document
.
body
.
append
(
el
);
let
pureText
=
el
.
innerText
;
document
.
body
.
removeChild
(
el
);
return
pureText
;
}
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