Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_jxw_demo
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
middleLayer_for_jxw_demo
Commits
238bebea
Commit
238bebea
authored
Aug 22, 2025
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: test
parent
435d8f4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
gamecenter.ts
...s/middleLayer_for_jxw_demo/pages/gamecenter/gamecenter.ts
+24
-5
No files found.
assets/middleLayer_for_jxw_demo/pages/gamecenter/gamecenter.ts
View file @
238bebea
...
@@ -35,16 +35,35 @@ export default class GameCenter extends cc.Component {
...
@@ -35,16 +35,35 @@ export default class GameCenter extends cc.Component {
onLoad
()
{
onLoad
()
{
// 初始化组件引用
// 初始化组件引用
this
.
initComponents
();
this
.
initComponents
();
// 获取屏幕宽度
}
}
start
()
{
start
()
{
this
.
getGameList
();
this
.
getGameList
();
// const backBtn = cc.find("Canvas/back_btn");
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
let
design_size
=
cc
.
Canvas
.
instance
.
designResolution
.
width
/
cc
.
Canvas
.
instance
.
designResolution
.
height
// backBtn.x = -canvas.width/2 + 50 + backBtn.width/2;
let
f
=
screen_size
>=
design_size
// backBtn.y = canvas.height/2 - 50 - backBtn.height/2;
cc
.
Canvas
.
instance
.
fitHeight
=
f
// console.log( backBtn.x, backBtn.y)
cc
.
Canvas
.
instance
.
fitWidth
=
!
f
const
frameSize
=
cc
.
view
.
getFrameSize
();
// this._frameSize = frameSize;
const
designSize
=
cc
.
view
.
getDesignResolutionSize
();
let
sx
=
cc
.
winSize
.
width
/
frameSize
.
width
;
let
sy
=
cc
.
winSize
.
height
/
frameSize
.
height
;
const
cocosScale
=
Math
.
min
(
sx
,
sy
);
sx
=
frameSize
.
width
/
designSize
.
width
;
sy
=
frameSize
.
height
/
designSize
.
height
;
// this._mapScaleMin = Math.min(sx, sy) * cocosScale;
// this._mapScaleMax = Math.max(sx, sy) * cocosScale;
cc
.
director
[
'
_scene
'
].
width
=
frameSize
.
width
;
cc
.
director
[
'
_scene
'
].
height
=
frameSize
.
height
;
}
}
private
initComponents
()
{
private
initComponents
()
{
...
...
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