Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_NongChang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
NJ_NongChang
Commits
5b5438f1
Commit
5b5438f1
authored
Oct 31, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配竖屏适配
parent
60b08e1f
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1314 additions
and
1082 deletions
+1314
-1082
NJ_NongChang.fire
assets/NJ_NongChang/scene/NJ_NongChang.fire
+1303
-1082
NJ_NongChang.ts
assets/NJ_NongChang/scene/NJ_NongChang.ts
+11
-0
No files found.
assets/NJ_NongChang/scene/NJ_NongChang.fire
View file @
5b5438f1
This diff is collapsed.
Click to expand it.
assets/NJ_NongChang/scene/NJ_NongChang.ts
View file @
5b5438f1
...
...
@@ -87,6 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async
initView
()
{
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
touchboard
=
cc
.
find
(
'
Canvas/touchboard
'
);
const
contant
=
cc
.
find
(
'
Canvas/touchboard/contant
'
);
const
scale
=
touchboard
.
height
/
contant
.
height
;
...
...
@@ -95,6 +96,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
contant
.
scale
=
scale
;
contant
.
x
=
contant
.
width
/
2
-
touchboard
.
width
/
2
;
if
((
canvas
.
width
/
canvas
.
height
)
>=
1
)
{
// 横屏
}
else
{
// 竖屏
const
bg
=
cc
.
find
(
'
Canvas/touchboard/contant/bg
'
);
bg
.
x
=
-
1800
;
bg
.
y
=
-
150
;
bg
.
scale
=
0.3
;
}
const
bg
=
cc
.
find
(
'
Canvas/touchboard/contant/bg
'
);
for
(
let
i
=
0
;
i
<
36
;
i
++
)
{
const
btn
=
seekChildByName
(
bg
,
`btn_
${
i
}
`
);
...
...
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