Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NGT_02
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
NGT_02
Commits
32eaddb3
Commit
32eaddb3
authored
Mar 03, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test:
parent
5c43f6ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
NGT_02.meta
assets/NGT_02.meta
+15
-1
view.js
assets/NGT_02/script/common/view.js
+10
-9
No files found.
assets/NGT_02.meta
View file @
32eaddb3
{"ver":"1.1.2","uuid":"d3ad24ed-9c8b-421d-934f-f93f1acf3060","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
{
\ No newline at end of file
"ver": "1.1.2",
"uuid": "d3ad24ed-9c8b-421d-934f-f93f1acf3060",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/NGT_02/script/common/view.js
View file @
32eaddb3
...
@@ -73,6 +73,7 @@ cc.Class({
...
@@ -73,6 +73,7 @@ cc.Class({
this
.
MaxSize
=
1
;
this
.
MaxSize
=
1
;
},
},
init
:
function
()
{
init
:
function
()
{
console
.
log
(
'
汪汪汪init
'
)
var
canvaSize
=
this
.
findCanvas
();
var
canvaSize
=
this
.
findCanvas
();
cc
.
director
.
_scene
.
width
=
canvaSize
.
width
;
cc
.
director
.
_scene
.
width
=
canvaSize
.
width
;
cc
.
director
.
_scene
.
height
=
canvaSize
.
height
;
cc
.
director
.
_scene
.
height
=
canvaSize
.
height
;
...
@@ -138,11 +139,11 @@ cc.Class({
...
@@ -138,11 +139,11 @@ cc.Class({
let
realWidth
=
this
.
bgScaleMax
[
i
].
width
*
scaleForShowAll
;
let
realWidth
=
this
.
bgScaleMax
[
i
].
width
*
scaleForShowAll
;
let
realHeight
=
this
.
bgScaleMax
[
i
].
height
*
scaleForShowAll
;
let
realHeight
=
this
.
bgScaleMax
[
i
].
height
*
scaleForShowAll
;
//
//
2. 基于第一步的数据,再做缩放适配
// 2. 基于第一步的数据,再做缩放适配
//
this.bgScaleMax[i].scale = Math.max(
this
.
bgScaleMax
[
i
].
scale
=
Math
.
max
(
//
cc.view.getCanvasSize().width / realWidth,
cc
.
view
.
getCanvasSize
().
width
/
realWidth
,
//
cc.view.getCanvasSize().height / realHeight
cc
.
view
.
getCanvasSize
().
height
/
realHeight
//
);
);
}
}
},
},
...
@@ -158,10 +159,10 @@ cc.Class({
...
@@ -158,10 +159,10 @@ cc.Class({
let
realHeight
=
720
*
srcScaleForShowAll
;
let
realHeight
=
720
*
srcScaleForShowAll
;
// 2. 基于第一步的数据,再做节点宽高重置
// 2. 基于第一步的数据,再做节点宽高重置
//
this.nodeUIOffset[i].width =
this
.
nodeUIOffset
[
i
].
width
=
//
1280 * (cc.view.getCanvasSize().width / realWidth);
1280
*
(
cc
.
view
.
getCanvasSize
().
width
/
realWidth
);
//
this.nodeUIOffset[i].height =
this
.
nodeUIOffset
[
i
].
height
=
//
720 * (cc.view.getCanvasSize().height / realHeight);
720
*
(
cc
.
view
.
getCanvasSize
().
height
/
realHeight
);
}
}
},
},
...
...
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