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
b74ec328
Commit
b74ec328
authored
Oct 19, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fishing'
parents
ad6070ef
c7134f01
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
12 deletions
+57
-12
MainBase.ts
egret/libs/tl/MainBase.ts
+7
-1
RuleSkin.exml
egret/resource/skins/RuleSkin.exml
+4
-1
Main.ts
egret/src/Main.ts
+19
-2
RulePanel.ts
egret/src/rulePanel/RulePanel.ts
+21
-2
StartScene.ts
egret/src/startScene/StartScene.ts
+1
-1
Tips.ts
egret/src/startScene/view/Tips.ts
+4
-4
getRule.json
mock/json/getRule.json
+1
-1
No files found.
egret/libs/tl/MainBase.ts
View file @
b74ec328
...
@@ -70,6 +70,12 @@ export default class MainBase extends eui.UILayer {
...
@@ -70,6 +70,12 @@ export default class MainBase extends eui.UILayer {
DataManager
.
ins
.
gameCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
gameCfgData
=
window
[
'CFG'
];
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
gameId
=
window
[
"gameId"
];
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
gameId
=
window
[
"gameId"
];
setTimeout
(()
=>
{
console
.
log
(
'stageHeight'
,
this
.
stage
.
stageHeight
);
console
.
log
(
'height'
,
this
.
stage
.
height
);
},
2000
);
layers
.
init
(
this
);
layers
.
init
(
this
);
Loading
.
init
(
layers
.
topLayer
);
Loading
.
init
(
layers
.
topLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
PanelCtrl
.
instance
.
init
(
layers
.
popupLayer
);
...
...
egret/resource/skins/RuleSkin.exml
View file @
b74ec328
...
@@ -10,8 +10,11 @@
...
@@ -10,8 +10,11 @@
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Scroller
id=
"scroller"
width=
"528"
x=
"112"
height=
"641"
y=
"351"
>
<e:Scroller
id=
"scroller"
width=
"528"
x=
"112"
height=
"641"
y=
"351"
>
<e:Group
width=
"100%"
>
<e:Group
id=
"group"
width=
"100%"
>
<e:Label
id=
"labContent"
width=
"100%"
text=
""
lineSpacing=
"10"
size=
"30"
multiline=
"true"
textColor=
"0x333333"
/>
<e:Label
id=
"labContent"
width=
"100%"
text=
""
lineSpacing=
"10"
size=
"30"
multiline=
"true"
textColor=
"0x333333"
/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Group>
</e:Scroller>
</e:Scroller>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/Main.ts
View file @
b74ec328
...
@@ -30,3 +30,20 @@ class Main extends MainBase {
...
@@ -30,3 +30,20 @@ class Main extends MainBase {
}
}
window
[
'Main'
]
=
Main
;
window
[
'Main'
]
=
Main
;
setTimeout
(()
=>
{
egret
.
runEgret
({
renderMode
:
"webgl"
,
audioType
:
0
,
calculateCanvasScaleFactor
:
function
(
context
:
any
)
{
var
backingStore
=
context
.
backingStorePixelRatio
||
context
.
webkitBackingStorePixelRatio
||
context
.
mozBackingStorePixelRatio
||
context
.
msBackingStorePixelRatio
||
context
.
oBackingStorePixelRatio
||
context
.
backingStorePixelRatio
||
1
;
return
(
window
.
devicePixelRatio
||
1
)
/
backingStore
;
}
});
},
1000
);
\ No newline at end of file
egret/src/rulePanel/RulePanel.ts
View file @
b74ec328
...
@@ -13,9 +13,28 @@ export default class RulePanel extends Panel {
...
@@ -13,9 +13,28 @@ export default class RulePanel extends Panel {
this
.
addRule
();
this
.
addRule
();
}
}
group
:
eui
.
Group
;
private
addRule
()
{
private
addRule
()
{
// this.labContent.textFlow = alien.Utils.parseHtmlText(content);
let
text
:
string
=
DataManager
.
ins
.
getRuleData
.
ruleText
;
this
.
labContent
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
DataManager
.
ins
.
getRuleData
.
ruleText
);
text
=
text
.
replace
(
'/<div>/g'
,
''
);
text
=
text
.
replace
(
'/</div>/g'
,
''
);
text
=
text
.
replace
(
'/<br>/g'
,
'<br> '
);
const
textlist
=
text
.
split
(
'<br>'
);
console
.
log
(
text
);
// this.labContent.textFlow = (new egret.HtmlTextParser).parser(DataManager.ins.getRuleData.ruleText);
for
(
let
i
=
0
;
i
<
textlist
.
length
;
i
++
)
{
const
l
=
new
eui
.
Label
();
l
.
textColor
=
this
.
labContent
.
textColor
;
l
.
size
=
this
.
labContent
.
size
;
l
.
width
=
this
.
labContent
.
width
;
l
.
minHeight
=
20
;
l
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
textlist
[
i
]
+
''
);
this
.
group
.
addChild
(
l
)
}
}
}
protected
get
skinKey
()
{
return
'Rule'
}
protected
get
skinKey
()
{
return
'Rule'
}
...
...
egret/src/startScene/StartScene.ts
View file @
b74ec328
...
@@ -277,10 +277,10 @@ export default class StartScene extends Scene {
...
@@ -277,10 +277,10 @@ export default class StartScene extends Scene {
return
[
return
[
LayerTypes
.
bg
,
LayerTypes
.
bg
,
LayerTypes
.
river
,
LayerTypes
.
river
,
LayerTypes
.
ui
,
LayerTypes
.
guide
,
LayerTypes
.
guide
,
LayerTypes
.
kids
,
LayerTypes
.
kids
,
LayerTypes
.
net
,
LayerTypes
.
net
,
LayerTypes
.
ui
,
LayerTypes
.
box
,
LayerTypes
.
box
,
LayerTypes
.
monkey
,
LayerTypes
.
monkey
,
LayerTypes
.
top
,
LayerTypes
.
top
,
...
...
egret/src/startScene/view/Tips.ts
View file @
b74ec328
...
@@ -15,10 +15,10 @@ export default class Tips extends eui.Label {
...
@@ -15,10 +15,10 @@ export default class Tips extends eui.Label {
onAddToStage
()
{
onAddToStage
()
{
this
.
y
=
1142
;
this
.
y
=
1142
;
if
(
this
.
stage
.
stageHeight
>
1300
)
//
if (this.stage.stageHeight > 1300)
this
.
y
=
1206
;
//
this.y = 1206;
if
(
this
.
stage
.
stageHeight
<
1206
)
//
if (this.stage.stageHeight < 1206)
this
.
y
=
this
.
stage
.
stageHeight
-
this
.
textHeight
-
40
;
//
this.y = this.stage.stageHeight - this.textHeight - 40;
}
}
updateText
()
{
updateText
()
{
...
...
mock/json/getRule.json
View file @
b74ec328
"1.玩家通过控制按压屏幕时长来控制猫咪跨出去的步伐的大小,步伐越大分数越高
\n
2. 避开道路上的线条和陷阱,踩中则游戏结束
\n
3.每局游戏都有一次积分复活的机会,当用户积分不足的情况下则不会出现提醒"
"1<br><br>2"
\ 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