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
ccb88c3c
Commit
ccb88c3c
authored
Oct 19, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
17a7738d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
isIPhoneX.ts
egret/libs/tc/utils/isIPhoneX.ts
+5
-0
DeclareText.ts
egret/src/startScene/view/DeclareText.ts
+4
-0
No files found.
egret/libs/tc/utils/isIPhoneX.ts
0 → 100644
View file @
ccb88c3c
export
default
function
isIPhoneX
()
{
var
u
=
navigator
.
userAgent
;
var
isIOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
return
isIOS
&&
screen
.
height
==
812
&&
screen
.
width
==
375
}
\ No newline at end of file
egret/src/startScene/view/DeclareText.ts
View file @
ccb88c3c
import
isIPhoneX
from
"../../../libs/tc/utils/isIPhoneX"
;
export
default
class
DeclareTextTips
extends
eui
.
Label
{
export
default
class
DeclareTextTips
extends
eui
.
Label
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -11,5 +13,7 @@ export default class DeclareTextTips extends eui.Label {
...
@@ -11,5 +13,7 @@ export default class DeclareTextTips extends eui.Label {
onAddToStage
()
{
onAddToStage
()
{
this
.
y
=
this
.
stage
.
stageHeight
-
this
.
textHeight
-
10
;
this
.
y
=
this
.
stage
.
stageHeight
-
this
.
textHeight
-
10
;
if
(
isIPhoneX
())
this
.
y
-=
20
;
}
}
}
}
\ 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