Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
c8726d5f
Commit
c8726d5f
authored
Dec 07, 2019
by
XieChuanJin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
c6d85829
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
27 deletions
+59
-27
panelCtrl.ts
egret/src/ctrls/panelCtrl.ts
+2
-2
sceneCtrl.ts
egret/src/ctrls/sceneCtrl.ts
+3
-3
layers.ts
egret/src/views/layers.ts
+54
-22
No files found.
egret/src/ctrls/panelCtrl.ts
View file @
c8726d5f
import
Panel
from
"../views/Panel"
;
import
Panel
from
"../views/Panel"
;
import
Loading
from
"../Loading/Loading"
;
import
Loading
from
"../Loading/Loading"
;
export
default
class
PanelCtrl
{
export
default
class
PanelCtrl
{
private
_parent
:
eui
.
UILayer
;
private
_parent
:
eui
.
Group
;
private
_mask
:
egret
.
Shape
;
private
_mask
:
egret
.
Shape
;
private
hasMaskCount
=
0
;
private
hasMaskCount
=
0
;
private
stack
:
Panel
[]
=
[];
private
stack
:
Panel
[]
=
[];
...
@@ -12,7 +12,7 @@ export default class PanelCtrl {
...
@@ -12,7 +12,7 @@ export default class PanelCtrl {
return
PanelCtrl
.
_instance
||
(
PanelCtrl
.
_instance
=
new
PanelCtrl
())
return
PanelCtrl
.
_instance
||
(
PanelCtrl
.
_instance
=
new
PanelCtrl
())
}
}
init
(
parent
:
eui
.
UILayer
)
{
init
(
parent
:
eui
.
Group
)
{
this
.
_parent
=
parent
;
this
.
_parent
=
parent
;
let
mask
=
new
egret
.
Shape
();
let
mask
=
new
egret
.
Shape
();
mask
.
graphics
.
beginFill
(
0
,
0.8
);
mask
.
graphics
.
beginFill
(
0
,
0.8
);
...
...
egret/src/ctrls/sceneCtrl.ts
View file @
c8726d5f
...
@@ -3,17 +3,17 @@ import IScene from "../components/IScene";
...
@@ -3,17 +3,17 @@ import IScene from "../components/IScene";
import
Scene
from
"../views/Scene"
;
import
Scene
from
"../views/Scene"
;
export
default
class
SceneCtrl
{
export
default
class
SceneCtrl
{
public
get
parent
():
eui
.
UILayer
{
public
get
parent
():
eui
.
Group
{
return
this
.
_parent
;
return
this
.
_parent
;
}
}
private
_parent
:
eui
.
UILayer
;
private
_parent
:
eui
.
Group
;
private
_currentScene
:
Scene
;
private
_currentScene
:
Scene
;
static
_instance
:
SceneCtrl
;
static
_instance
:
SceneCtrl
;
static
get
instance
()
{
static
get
instance
()
{
return
SceneCtrl
.
_instance
||
(
SceneCtrl
.
_instance
=
new
SceneCtrl
())
return
SceneCtrl
.
_instance
||
(
SceneCtrl
.
_instance
=
new
SceneCtrl
())
}
}
init
(
parent
:
eui
.
UILayer
)
{
init
(
parent
:
eui
.
Group
)
{
this
.
_parent
=
parent
;
this
.
_parent
=
parent
;
}
}
...
...
egret/src/views/layers.ts
View file @
c8726d5f
import
{
ThroughSubmitData
}
from
"../../libs/tw/data/custom/throughSubmit/ThroughSubmitData"
;
import
GameMgr
from
"../Mgr/GameMgr"
;
class
Layers
extends
eui
.
UILayer
{
const
MinHeight
=
1200
;
private
_topLayer
:
eui
.
UILayer
;
class
MLayers
extends
eui
.
UILayer
{
private
_popupLayer
:
eui
.
UILayer
;
public
sceneLayer
:
eui
.
Group
=
null
;
private
_sceneLayer
:
eui
.
UILayer
;
public
popupLayer
:
eui
.
Group
=
null
;
public
topLayer
:
eui
.
UILayer
=
new
eui
.
UILayer
();
public
toastLayer
:
eui
.
UILayer
=
new
eui
.
UILayer
();
public
toastLayer
:
eui
.
UILayer
=
new
eui
.
UILayer
();
public
scroller
:
eui
.
Scroller
=
null
;
private
static
_instance
:
MLayers
=
null
;
public
static
get
instance
():
MLayers
{
if
(
!
this
.
_instance
)
{
this
.
_instance
=
new
MLayers
();
}
return
this
.
_instance
;
}
public
setScroller
(
v
:
boolean
)
{
if
(
this
.
scroller
==
null
)
return
;
if
(
v
==
true
)
{
this
.
scroller
.
viewport
=
this
;
}
else
{
this
.
scroller
.
viewport
=
null
;
this
.
scroller
.
addChild
(
this
);
}
}
init
(
root
:
eui
.
UILayer
)
{
init
(
root
:
eui
.
UILayer
)
{
root
.
addChild
(
this
);
if
(
document
.
body
.
clientWidth
/
document
.
body
.
clientHeight
>
750
/
MinHeight
)
{
this
.
_topLayer
=
new
eui
.
UILayer
();
let
scroller
=
new
eui
.
Scroller
();
this
.
_popupLayer
=
new
eui
.
UILayer
();
this
.
scroller
=
scroller
;
this
.
_sceneLayer
=
new
eui
.
UILayer
();
root
.
addChild
(
scroller
);
this
.
addChild
(
this
.
_sceneLayer
);
scroller
.
viewport
=
this
;
this
.
addChild
(
this
.
_popupLayer
);
scroller
.
bounces
=
false
;
this
.
addChild
(
this
.
_topLayer
);
scroller
.
addChild
(
this
);
this
.
popupLayer
=
new
eui
.
Group
();
this
.
popupLayer
.
width
=
750
;
this
.
popupLayer
.
height
=
MinHeight
;
this
.
sceneLayer
=
new
eui
.
Group
();
this
.
sceneLayer
.
width
=
750
this
.
sceneLayer
.
height
=
MinHeight
;
this
.
addChild
(
this
.
sceneLayer
);
this
.
addChild
(
this
.
popupLayer
);
}
else
{
root
.
addChild
(
this
);
this
.
popupLayer
=
new
eui
.
UILayer
();
this
.
sceneLayer
=
new
eui
.
UILayer
();
this
.
addChild
(
this
.
sceneLayer
);
this
.
addChild
(
this
.
popupLayer
);
}
this
.
addChild
(
this
.
toastLayer
);
this
.
addChild
(
this
.
toastLayer
);
this
.
addChild
(
this
.
topLayer
);
this
.
_
popupLayer
.
visible
=
false
;
this
.
popupLayer
.
visible
=
false
;
this
.
_
topLayer
.
visible
=
false
;
this
.
topLayer
.
visible
=
false
;
this
.
toastLayer
.
touchEnabled
=
false
;
this
.
toastLayer
.
touchEnabled
=
false
;
}
}
get
topLayer
()
{
return
this
.
_topLayer
}
get
popupLayer
()
{
return
this
.
_popupLayer
}
get
sceneLayer
()
{
return
this
.
_sceneLayer
}
}
}
const
instance
=
new
Layers
();
export
default
new
MLayers
();
export
default
instance
\ No newline at end of file
\ 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