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
38573477
Commit
38573477
authored
Nov 12, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理结构
parent
96ca6c5a
Changes
18
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
77 additions
and
78 deletions
+77
-78
index.js
dist/index.js
+24
-21
index.js.map
dist/index.js.map
+1
-1
game-stage.js
examples/game-stage.js
+0
-22
VM.ts
src/zeroing/behavior-runtime/VM.ts
+10
-4
index.ts
src/zeroing/behavior-runtime/index.ts
+14
-5
events.ts
src/zeroing/decorators/events.ts
+1
-1
GameStage.ts
src/zeroing/game-warpper/GameStage.ts
+3
-3
StackContainer.ts
src/zeroing/game-warpper/StackContainer.ts
+1
-1
assets-manager.ts
src/zeroing/game-warpper/assets-manager.ts
+1
-1
data-center.ts
src/zeroing/game-warpper/data-center.ts
+2
-2
index.ts
src/zeroing/game-warpper/index.ts
+5
-0
Image.ts
src/zeroing/game-warpper/nodes/Image.ts
+3
-3
Label.ts
src/zeroing/game-warpper/nodes/Label.ts
+2
-2
index.ts
src/zeroing/game-warpper/nodes/index.ts
+0
-0
shapes.ts
src/zeroing/game-warpper/nodes/shapes.ts
+3
-3
view-interpreter.ts
src/zeroing/game-warpper/view-interpreter.ts
+1
-1
index.ts
src/zeroing/index.ts
+0
-7
launcher.ts
src/zeroing/launcher.ts
+6
-1
No files found.
dist/index.js
View file @
38573477
...
@@ -2172,8 +2172,9 @@
...
@@ -2172,8 +2172,9 @@
function
VM
()
{
function
VM
()
{
}
}
VM
.
prototype
.
setup
=
function
(
context
)
{
VM
.
prototype
.
setup
=
function
(
context
)
{
var
processMetaContexts
=
context
.
processMetaContexts
;
var
processMetaLibs
=
context
.
processMetaLibs
,
globalContext
=
context
.
globalContext
;
this
.
_processMetaContexts
=
processMetaContexts
;
this
.
_processMetaLibs
=
processMetaLibs
;
this
.
_globalContext
=
globalContext
;
};
};
VM
.
prototype
.
executeProcess
=
function
(
sequence
,
id
,
parentProcess
,
args
)
{
VM
.
prototype
.
executeProcess
=
function
(
sequence
,
id
,
parentProcess
,
args
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
...
@@ -2195,7 +2196,7 @@
...
@@ -2195,7 +2196,7 @@
});
});
};
};
VM
.
prototype
.
getMeta
=
function
(
id
)
{
VM
.
prototype
.
getMeta
=
function
(
id
)
{
for
(
var
_i
=
0
,
_a
=
this
.
_processMeta
Context
s
;
_i
<
_a
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
_a
=
this
.
_processMeta
Lib
s
;
_i
<
_a
.
length
;
_i
++
)
{
var
context
=
_a
[
_i
];
var
context
=
_a
[
_i
];
var
meta
=
arrayFind
(
context
,
function
(
item
)
{
return
item
.
id
===
id
;
});
var
meta
=
arrayFind
(
context
,
function
(
item
)
{
return
item
.
id
===
id
;
});
if
(
meta
)
{
if
(
meta
)
{
...
@@ -2203,25 +2204,36 @@
...
@@ -2203,25 +2204,36 @@
}
}
}
}
};
};
VM
.
prototype
.
getGlobal
=
function
()
{
return
this
.
_globalContext
;
};
return
VM
;
return
VM
;
}());
}());
var
processMetaContexts
=
[];
var
processMetaLibs
=
[];
function
setProcessMetaContexts
()
{
var
globalContext
=
{};
function
setProcessMetaLibs
()
{
var
metaContexts
=
[];
var
metaContexts
=
[];
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
metaContexts
[
_i
]
=
arguments
[
_i
];
metaContexts
[
_i
]
=
arguments
[
_i
];
}
}
for
(
var
_a
=
0
,
metaContexts_1
=
metaContexts
;
_a
<
metaContexts_1
.
length
;
_a
++
)
{
for
(
var
_a
=
0
,
metaContexts_1
=
metaContexts
;
_a
<
metaContexts_1
.
length
;
_a
++
)
{
var
context
=
metaContexts_1
[
_a
];
var
context
=
metaContexts_1
[
_a
];
processMetaContexts
.
push
(
context
);
processMetaLibs
.
push
(
context
);
}
}
function
setGlobalContext
(
context
)
{
globalContext
=
context
;
for
(
var
key
in
context
)
{
globalContext
[
key
]
=
context
[
key
];
}
}
}
}
function
executeBehavior
(
sequence
,
subEntry
,
args
)
{
function
executeBehavior
(
sequence
,
subEntry
,
args
)
{
if
(
subEntry
===
void
0
)
{
subEntry
=
'main'
;
}
if
(
subEntry
===
void
0
)
{
subEntry
=
'main'
;
}
var
vm
=
new
VM
();
var
vm
=
new
VM
();
vm
.
setup
({
vm
.
setup
({
processMetaContexts
:
processMetaContexts
,
processMetaLibs
:
processMetaLibs
,
globalContext
:
globalContext
,
});
});
vm
.
executeProcess
(
sequence
,
subEntry
,
null
,
args
)
vm
.
executeProcess
(
sequence
,
subEntry
,
null
,
args
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
...
@@ -2259,7 +2271,7 @@
...
@@ -2259,7 +2271,7 @@
if
(
eventConfig
)
{
if
(
eventConfig
)
{
executeBehavior
({
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
'aaa'
);
},
'main'
);
}
}
}
}
};
};
...
@@ -11471,7 +11483,7 @@
...
@@ -11471,7 +11483,7 @@
GameStage
.
prototype
.
start
=
function
()
{
GameStage
.
prototype
.
start
=
function
()
{
var
_a
=
this
.
_config
,
launchOptions
=
_a
.
launchOptions
,
dataMapping
=
_a
.
dataMapping
,
processes
=
_a
.
processes
,
globalProcesses
=
_a
.
globalProcesses
;
var
_a
=
this
.
_config
,
launchOptions
=
_a
.
launchOptions
,
dataMapping
=
_a
.
dataMapping
,
processes
=
_a
.
processes
,
globalProcesses
=
_a
.
globalProcesses
;
this
.
dataCenter
.
registerDataMapping
(
dataMapping
);
this
.
dataCenter
.
registerDataMapping
(
dataMapping
);
setProcessMeta
Context
s
(
processes
,
globalProcesses
);
setProcessMeta
Lib
s
(
processes
,
globalProcesses
);
var
entryViewName
=
launchOptions
.
entrySceneView
;
var
entryViewName
=
launchOptions
.
entrySceneView
;
var
entryViewConfig
=
this
.
getViewConfigByName
(
entryViewName
);
var
entryViewConfig
=
this
.
getViewConfigByName
(
entryViewName
);
if
(
entryViewConfig
)
{
if
(
entryViewConfig
)
{
...
@@ -11493,6 +11505,9 @@
...
@@ -11493,6 +11505,9 @@
var
stage
=
window
[
'stage'
]
=
new
Stage
(
containerID
||
"game-container"
,
designWidth
||
750
,
designHeight
||
1334
,
frameRate
||
60
,
scaleMode
||
StageScaleMode
.
FIXED_WIDTH
,
rendererType
||
exports
.
RENDERER_TYPE
.
WEBGL
);
var
stage
=
window
[
'stage'
]
=
new
Stage
(
containerID
||
"game-container"
,
designWidth
||
750
,
designHeight
||
1334
,
frameRate
||
60
,
scaleMode
||
StageScaleMode
.
FIXED_WIDTH
,
rendererType
||
exports
.
RENDERER_TYPE
.
WEBGL
);
Stage
.
flushAll
();
Stage
.
flushAll
();
var
gameStage
=
new
GameStage
(
stage
);
var
gameStage
=
new
GameStage
(
stage
);
setGlobalContext
({
gameStage
:
gameStage
});
stage
.
addChild
(
gameStage
);
stage
.
addChild
(
gameStage
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
gameStage
.
launch
(
config
,
onAssetsProgress
,
onAssetsComplete
);
gameStage
.
launch
(
config
,
onAssetsProgress
,
onAssetsComplete
);
...
@@ -11502,7 +11517,6 @@
...
@@ -11502,7 +11517,6 @@
exports
.
BaseTexture
=
BaseTexture
;
exports
.
BaseTexture
=
BaseTexture
;
exports
.
Button
=
Button
;
exports
.
Button
=
Button
;
exports
.
Circle
=
Circle$1
;
exports
.
Component
=
Component
;
exports
.
Component
=
Component
;
exports
.
Container
=
Container
;
exports
.
Container
=
Container
;
exports
.
DATA_URI
=
DATA_URI
;
exports
.
DATA_URI
=
DATA_URI
;
...
@@ -11513,24 +11527,19 @@
...
@@ -11513,24 +11527,19 @@
exports
.
EventDispatcher
=
EventDispatcher
;
exports
.
EventDispatcher
=
EventDispatcher
;
exports
.
FloatDisplay
=
FloatDisplay
;
exports
.
FloatDisplay
=
FloatDisplay
;
exports
.
GDispatcher
=
GDispatcher
;
exports
.
GDispatcher
=
GDispatcher
;
exports
.
GameStage
=
GameStage
;
exports
.
Graphics
=
Graphics
;
exports
.
Graphics
=
Graphics
;
exports
.
Image
=
Image$1
;
exports
.
InputText
=
InputText
;
exports
.
InputText
=
InputText
;
exports
.
Label
=
Label
;
exports
.
Loader
=
Loader
;
exports
.
Loader
=
Loader
;
exports
.
Matrix
=
Matrix
;
exports
.
Matrix
=
Matrix
;
exports
.
MouseEvent
=
MouseEvent
;
exports
.
MouseEvent
=
MouseEvent
;
exports
.
PI_2
=
PI_2
;
exports
.
PI_2
=
PI_2
;
exports
.
Point
=
Point
;
exports
.
Point
=
Point
;
exports
.
RAD_TO_DEG
=
RAD_TO_DEG
;
exports
.
RAD_TO_DEG
=
RAD_TO_DEG
;
exports
.
Rect
=
Rect
;
exports
.
Rectangle
=
Rectangle
;
exports
.
Rectangle
=
Rectangle
;
exports
.
ScrollList
=
ScrollList
;
exports
.
ScrollList
=
ScrollList
;
exports
.
ScrollPage
=
ScrollPage
;
exports
.
ScrollPage
=
ScrollPage
;
exports
.
Shape
=
Shape
;
exports
.
Shape
=
Shape
;
exports
.
Sprite
=
Sprite
;
exports
.
Sprite
=
Sprite
;
exports
.
StackContainer
=
StackContainer
;
exports
.
Stage
=
Stage
;
exports
.
Stage
=
Stage
;
exports
.
StageScaleMode
=
StageScaleMode
;
exports
.
StageScaleMode
=
StageScaleMode
;
exports
.
TextField
=
TextField
;
exports
.
TextField
=
TextField
;
...
@@ -11538,18 +11547,12 @@
...
@@ -11538,18 +11547,12 @@
exports
.
TextureSheet
=
TextureSheet
;
exports
.
TextureSheet
=
TextureSheet
;
exports
.
URL_FILE_EXTENSION
=
URL_FILE_EXTENSION
;
exports
.
URL_FILE_EXTENSION
=
URL_FILE_EXTENSION
;
exports
.
VERSION
=
VERSION
;
exports
.
VERSION
=
VERSION
;
exports
.
applyAutoAdjust
=
applyAutoAdjust
;
exports
.
applyEvents
=
applyEvents
;
exports
.
applyScript
=
applyScript
;
exports
.
applyScript
=
applyScript
;
exports
.
cos
=
cos
;
exports
.
cos
=
cos
;
exports
.
devicePixelRatio
=
devicePixelRatio
;
exports
.
devicePixelRatio
=
devicePixelRatio
;
exports
.
getAssetByName
=
getAssetByName
;
exports
.
getAssetByUUID
=
getAssetByUUID
;
exports
.
getTexture
=
getTexture
;
exports
.
getTexture
=
getTexture
;
exports
.
inputFeildIosEnable
=
inputFeildIosEnable
;
exports
.
inputFeildIosEnable
=
inputFeildIosEnable
;
exports
.
instantiate
=
instantiate
;
exports
.
launch
=
launch
;
exports
.
launch
=
launch
;
exports
.
loadAssets
=
loadAssets
;
exports
.
osType
=
osType
;
exports
.
osType
=
osType
;
exports
.
registerScriptDef
=
registerScriptDef
;
exports
.
registerScriptDef
=
registerScriptDef
;
exports
.
sin
=
sin
;
exports
.
sin
=
sin
;
...
...
dist/index.js.map
View file @
38573477
This diff is collapsed.
Click to expand it.
examples/game-stage.js
View file @
38573477
...
@@ -5,25 +5,3 @@
...
@@ -5,25 +5,3 @@
engine
.
registerScriptDef
(
ScriptDemo
);
engine
.
registerScriptDef
(
ScriptDemo
);
const
gameStage
=
engine
.
launch
(
data
);
const
gameStage
=
engine
.
launch
(
data
);
/*const dataCenter = gameStage.dataCenter;
dataCenter.registerGroup('test', {
hello: {
aaa: {
name: 'tom',
id: 1001,
age: 29,
avatar: 'face',
}
}
});
/!*console.log(dataCenter.getDataByPath('test.hello.aaa.name'));*!/
let i = 0;
setInterval(()=>{
let asset = data.assets[i % data.assets.length];
dataCenter.mutate('test', asset.name, 'hello.aaa.name');
dataCenter.mutate('test', asset.name, 'hello.aaa.avatar');
i++;
}, 1000);*/
src/zeroing/behavior-runtime/VM.ts
View file @
38573477
...
@@ -6,12 +6,14 @@ import {Process} from "./Process";
...
@@ -6,12 +6,14 @@ import {Process} from "./Process";
import
{
arrayFind
}
from
"../utils"
;
import
{
arrayFind
}
from
"../utils"
;
export
class
VM
{
export
class
VM
{
_processMetaContexts
;
_processMetaLibs
;
_globalContext
;
setup
(
context
)
{
setup
(
context
)
{
const
{
processMeta
Contexts
}
=
context
;
const
{
processMeta
Libs
,
globalContext
}
=
context
;
this
.
_processMetaContexts
=
processMetaContexts
;
this
.
_processMetaLibs
=
processMetaLibs
;
this
.
_globalContext
=
globalContext
;
}
}
async
executeProcess
(
sequence
,
id
,
parentProcess
,
args
)
{
async
executeProcess
(
sequence
,
id
,
parentProcess
,
args
)
{
...
@@ -27,11 +29,15 @@ export class VM {
...
@@ -27,11 +29,15 @@ export class VM {
}
}
getMeta
(
id
)
{
getMeta
(
id
)
{
for
(
let
context
of
this
.
_processMeta
Context
s
)
{
for
(
let
context
of
this
.
_processMeta
Lib
s
)
{
let
meta
=
arrayFind
(
context
,
item
=>
item
.
id
===
id
);
let
meta
=
arrayFind
(
context
,
item
=>
item
.
id
===
id
);
if
(
meta
)
{
if
(
meta
)
{
return
meta
;
return
meta
;
}
}
}
}
}
}
getGlobal
(){
return
this
.
_globalContext
;
}
}
}
src/zeroing/behavior-runtime/index.ts
View file @
38573477
...
@@ -4,18 +4,27 @@
...
@@ -4,18 +4,27 @@
import
{
VM
}
from
"./VM"
;
import
{
VM
}
from
"./VM"
;
let
processMetaContexts
=
[];
let
processMetaLibs
=
[];
let
globalContext
=
{};
export
function
setProcessMetaContexts
(...
metaContexts
)
{
export
function
setProcessMetaLibs
(...
metaContexts
)
{
for
(
let
context
of
metaContexts
){
for
(
let
context
of
metaContexts
)
{
processMetaContexts
.
push
(
context
);
processMetaLibs
.
push
(
context
);
}
}
export
function
setGlobalContext
(
context
)
{
globalContext
=
context
;
for
(
let
key
in
context
)
{
globalContext
[
key
]
=
context
[
key
];
}
}
}
}
export
function
executeBehavior
(
sequence
,
subEntry
=
'main'
,
args
?)
{
export
function
executeBehavior
(
sequence
,
subEntry
=
'main'
,
args
?)
{
const
vm
=
new
VM
();
const
vm
=
new
VM
();
vm
.
setup
({
vm
.
setup
({
processMetaContexts
,
processMetaLibs
,
globalContext
,
});
});
vm
.
executeProcess
(
sequence
,
subEntry
,
null
,
args
)
vm
.
executeProcess
(
sequence
,
subEntry
,
null
,
args
)
.
then
(
result
=>
{
.
then
(
result
=>
{
...
...
src/zeroing/decorators/events.ts
View file @
38573477
...
@@ -42,7 +42,7 @@ class EventsProxy extends HashObject {
...
@@ -42,7 +42,7 @@ class EventsProxy extends HashObject {
if
(
eventConfig
)
{
if
(
eventConfig
)
{
executeBehavior
({
executeBehavior
({
main
:
eventConfig
.
behaviors
[
0
],
main
:
eventConfig
.
behaviors
[
0
],
},
'main'
,
'aaa'
)
},
'main'
)
}
}
}
}
}
}
...
...
src/zeroing/GameStage.ts
→
src/zeroing/
game-warpper/
GameStage.ts
View file @
38573477
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* Created by rockyl on 2019-11-05.
* Created by rockyl on 2019-11-05.
*/
*/
import
{
Container
,
Stage
}
from
"../2d/display"
;
import
{
Container
,
Stage
}
from
"../
../
2d/display"
;
import
{
StackContainer
}
from
"./StackContainer"
;
import
{
StackContainer
}
from
"./StackContainer"
;
import
{
loadAssets
}
from
"./assets-manager"
;
import
{
loadAssets
}
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
{
setProcessMeta
Contexts
}
from
"
./behavior-runtime"
;
import
{
setProcessMeta
Libs
}
from
".
./behavior-runtime"
;
/**
/**
* 游戏舞台
* 游戏舞台
...
@@ -83,7 +83,7 @@ export class GameStage extends Container {
...
@@ -83,7 +83,7 @@ export class GameStage extends Container {
start
()
{
start
()
{
const
{
launchOptions
,
dataMapping
,
processes
,
globalProcesses
}
=
this
.
_config
;
const
{
launchOptions
,
dataMapping
,
processes
,
globalProcesses
}
=
this
.
_config
;
this
.
dataCenter
.
registerDataMapping
(
dataMapping
);
this
.
dataCenter
.
registerDataMapping
(
dataMapping
);
setProcessMeta
Context
s
(
processes
,
globalProcesses
);
setProcessMeta
Lib
s
(
processes
,
globalProcesses
);
const
entryViewName
=
launchOptions
.
entrySceneView
;
const
entryViewName
=
launchOptions
.
entrySceneView
;
let
entryViewConfig
=
this
.
getViewConfigByName
(
entryViewName
);
let
entryViewConfig
=
this
.
getViewConfigByName
(
entryViewName
);
if
(
entryViewConfig
)
{
if
(
entryViewConfig
)
{
...
...
src/zeroing/StackContainer.ts
→
src/zeroing/
game-warpper/
StackContainer.ts
View file @
38573477
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-05.
* Created by rockyl on 2019-11-05.
*/
*/
import
{
Container
,
DisplayObject
}
from
"../2d/display"
;
import
{
Container
,
DisplayObject
}
from
"../
../
2d/display"
;
/**
/**
* 栈式视图容器
* 栈式视图容器
...
...
src/zeroing/assets-manager.ts
→
src/zeroing/
game-warpper/
assets-manager.ts
View file @
38573477
/**
/**
* Created by rockyl on 2019-11-07.
* Created by rockyl on 2019-11-07.
*/
*/
import
{
Loader
}
from
".."
;
import
{
Loader
}
from
"..
/..
"
;
let
assetsConfig
;
let
assetsConfig
;
...
...
src/zeroing/data-center.ts
→
src/zeroing/
game-warpper/
data-center.ts
View file @
38573477
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
*
*
* 数据中心
* 数据中心
*/
*/
import
{
EventDispatcher
}
from
"../2d/events"
;
import
{
EventDispatcher
}
from
"../
../
2d/events"
;
import
{
arrayFind
}
from
"./utils"
;
import
{
arrayFind
}
from
".
.
/utils"
;
/**
/**
* 数据中心
* 数据中心
...
...
src/zeroing/game-warpper/index.ts
0 → 100644
View file @
38573477
/**
* Created by rockyl on 2019-11-12.
*/
export
*
from
'./GameStage'
src/zeroing/nodes/Image.ts
→
src/zeroing/
game-warpper/
nodes/Image.ts
View file @
38573477
/**
/**
* Created by rockyl on 2019-11-07.
* Created by rockyl on 2019-11-07.
*/
*/
import
{
Sprite
}
from
"../../2d/display"
;
import
{
Sprite
}
from
"../../
../
2d/display"
;
import
Texture
from
"../../2d/texture/Texture"
;
import
Texture
from
"../../
../
2d/texture/Texture"
;
import
{
getAssetByName
,
getAssetByUUID
}
from
"../assets-manager"
;
import
{
getAssetByName
,
getAssetByUUID
}
from
"../assets-manager"
;
import
{
dataCenter
}
from
"../data-center"
;
import
{
dataCenter
}
from
"../data-center"
;
import
{
ESCAPE_REG_EXP
}
from
"../utils"
;
import
{
ESCAPE_REG_EXP
}
from
"../
../
utils"
;
const
assetScheme
=
'asset://'
;
const
assetScheme
=
'asset://'
;
...
...
src/zeroing/nodes/Label.ts
→
src/zeroing/
game-warpper/
nodes/Label.ts
View file @
38573477
/**
/**
* Created by rockyl on 2019-11-08.
* Created by rockyl on 2019-11-08.
*/
*/
import
{
TextField
}
from
"../../2d/text"
;
import
{
TextField
}
from
"../../
../
2d/text"
;
import
{
dataCenter
}
from
"../data-center"
;
import
{
dataCenter
}
from
"../data-center"
;
import
{
ESCAPE_REG_EXP
}
from
"../utils"
;
import
{
ESCAPE_REG_EXP
}
from
"../
../
utils"
;
/**
/**
* 文本
* 文本
...
...
src/zeroing/nodes/index.ts
→
src/zeroing/
game-warpper/
nodes/index.ts
View file @
38573477
File moved
src/zeroing/nodes/shapes.ts
→
src/zeroing/
game-warpper/
nodes/shapes.ts
View file @
38573477
/**
/**
* Created by rockyl on 2019-11-06.
* Created by rockyl on 2019-11-06.
*/
*/
import
{
Shape
}
from
"../../"
;
import
{
Shape
}
from
"../../
../
"
;
import
{
Event
}
from
"../../2d/events"
;
import
{
Event
}
from
"../../
../
2d/events"
;
import
{
dirtyFieldDetector
}
from
"../decorators"
;
import
{
dirtyFieldDetector
}
from
"../
../
decorators"
;
/**
/**
* 图形基类
* 图形基类
...
...
src/zeroing/view-interpreter.ts
→
src/zeroing/
game-warpper/
view-interpreter.ts
View file @
38573477
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-08.
* Created by rockyl on 2019-11-08.
*/
*/
import
{
Container
}
from
"../2d/display"
;
import
{
Container
}
from
"../
../
2d/display"
;
import
{
Rect
,
Image
,
Label
}
from
"./nodes"
;
import
{
Rect
,
Image
,
Label
}
from
"./nodes"
;
const
nodeTypeMapping
=
{
const
nodeTypeMapping
=
{
...
...
src/zeroing/index.ts
View file @
38573477
...
@@ -2,12 +2,5 @@
...
@@ -2,12 +2,5 @@
* Created by rockyl on 2019-11-06.
* Created by rockyl on 2019-11-06.
*/
*/
export
*
from
'./GameStage'
export
*
from
'./StackContainer'
export
*
from
'./nodes'
export
*
from
'./assets-manager'
export
*
from
'./view-interpreter'
export
*
from
'./launcher'
export
*
from
'./launcher'
export
*
from
'./decorators/auto-adjust'
export
*
from
'./decorators/scripts'
export
*
from
'./decorators/scripts'
export
*
from
'./decorators/events'
src/zeroing/launcher.ts
View file @
38573477
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
*/
*/
import
{
Stage
}
from
"../2d/display"
;
import
{
Stage
}
from
"../2d/display"
;
import
{
GameStage
,
Rect
,
RENDERER_TYPE
,
StageScaleMode
}
from
".."
;
import
{
RENDERER_TYPE
,
StageScaleMode
}
from
".."
;
import
{
GameStage
}
from
"./game-warpper"
;
import
{
setGlobalContext
}
from
"./behavior-runtime"
;
export
function
launch
(
config
,
onAssetsProgress
,
onAssetsComplete
)
{
export
function
launch
(
config
,
onAssetsProgress
,
onAssetsComplete
)
{
const
{
containerID
,
designWidth
,
designHeight
,
frameRate
,
scaleMode
,
rendererType
,}
=
config
.
launchOptions
;
const
{
containerID
,
designWidth
,
designHeight
,
frameRate
,
scaleMode
,
rendererType
,}
=
config
.
launchOptions
;
...
@@ -18,6 +20,9 @@ export function launch(config, onAssetsProgress, onAssetsComplete) {
...
@@ -18,6 +20,9 @@ export function launch(config, onAssetsProgress, onAssetsComplete) {
Stage
.
flushAll
();
Stage
.
flushAll
();
let
gameStage
=
new
GameStage
(
stage
);
let
gameStage
=
new
GameStage
(
stage
);
setGlobalContext
({
gameStage
});
stage
.
addChild
(
gameStage
);
stage
.
addChild
(
gameStage
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
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