Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chooseWord
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
chooseWord
Commits
aea79427
Commit
aea79427
authored
Dec 01, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shipei
parent
87c4450b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
67 deletions
+93
-67
Scene.fire
play/assets/tmpGame/scene/Scene.fire
+80
-66
NodeFitScreen.js
play/assets/tmpGame/script/NodeFitScreen.js
+13
-1
No files found.
play/assets/tmpGame/scene/Scene.fire
View file @
aea79427
...
...
@@ -73,16 +73,10 @@
},
{
"__id__": 5
},
{
"__id__": 54
}
],
"_active": true,
"_components": [
{
"__id__": 64
},
{
"__id__": 65
},
...
...
@@ -91,6 +85,9 @@
},
{
"__id__": 67
},
{
"__id__": 68
}
],
"_prefab": null,
...
...
@@ -266,25 +263,28 @@
"__id__": 25
},
{
"__id__": 2
8
"__id__": 2
9
},
{
"__id__": 3
1
"__id__": 3
2
},
{
"__id__": 3
4
"__id__": 3
5
},
{
"__id__": 3
7
"__id__": 3
8
},
{
"__id__": 47
"__id__": 48
},
{
"__id__": 54
}
],
"_active": true,
"_components": [
{
"__id__":
53
"__id__":
64
}
],
"_prefab": null,
...
...
@@ -1150,6 +1150,9 @@
},
{
"__id__": 27
},
{
"__id__": 28
}
],
"_prefab": null,
...
...
@@ -1259,6 +1262,17 @@
"_originalHeight": 0,
"_id": "5asRigMmdJdqwJeYwQ8bhv"
},
{
"__type__": "e22e11e0CVGPajfhd4ljXke",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"FitType": 3,
"_id": "a3cWGmSwhH4q3MA7W70LUz"
},
{
"__type__": "cc.Node",
"_name": "invalid-name_5",
...
...
@@ -1270,10 +1284,10 @@
"_active": true,
"_components": [
{
"__id__":
29
"__id__":
30
},
{
"__id__": 3
0
"__id__": 3
1
}
],
"_prefab": null,
...
...
@@ -1329,7 +1343,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
8
"__id__": 2
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1361,7 +1375,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
8
"__id__": 2
9
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1394,10 +1408,10 @@
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
3
},
{
"__id__": 3
3
"__id__": 3
4
}
],
"_prefab": null,
...
...
@@ -1453,7 +1467,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
1
"__id__": 3
2
},
"_enabled": true,
"_materials": [
...
...
@@ -1485,7 +1499,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
1
"__id__": 3
2
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1518,10 +1532,10 @@
"_active": true,
"_components": [
{
"__id__": 3
5
"__id__": 3
6
},
{
"__id__": 3
6
"__id__": 3
7
}
],
"_prefab": null,
...
...
@@ -1548,7 +1562,7 @@
"ctor": "Float64Array",
"array": [
0,
-295.
959
,
-295.
5
,
0,
0,
0,
...
...
@@ -1577,7 +1591,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
4
"__id__": 3
5
},
"_enabled": true,
"_materials": [
...
...
@@ -1609,7 +1623,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
4
"__id__": 3
5
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1618,7 +1632,7 @@
"_left": 41,
"_right": 41,
"_top": 0,
"_bottom":
-0.4590000000000032
,
"_bottom":
0
,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
...
...
@@ -1640,22 +1654,22 @@
},
"_children": [
{
"__id__": 3
8
"__id__": 3
9
},
{
"__id__": 4
0
"__id__": 4
1
},
{
"__id__": 4
2
"__id__": 4
3
},
{
"__id__": 4
4
"__id__": 4
5
}
],
"_active": true,
"_components": [
{
"__id__": 4
6
"__id__": 4
7
}
],
"_prefab": null,
...
...
@@ -1711,13 +1725,13 @@
"_name": "invalid-name_14",
"_objFlags": 0,
"_parent": {
"__id__": 3
7
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
39
"__id__":
40
}
],
"_prefab": null,
...
...
@@ -1773,7 +1787,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
8
"__id__": 3
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1805,13 +1819,13 @@
"_name": "level1",
"_objFlags": 0,
"_parent": {
"__id__": 3
7
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
1
"__id__": 4
2
}
],
"_prefab": null,
...
...
@@ -1867,7 +1881,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
0
"__id__": 4
1
},
"_enabled": true,
"_materials": [
...
...
@@ -1899,13 +1913,13 @@
"_name": "level2",
"_objFlags": 0,
"_parent": {
"__id__": 3
7
"__id__": 3
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 4
3
"__id__": 4
4
}
],
"_prefab": null,
...
...
@@ -1961,7 +1975,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
2
"__id__": 4
3
},
"_enabled": true,
"_materials": [
...
...
@@ -1993,13 +2007,13 @@
"_name": "level3",
"_objFlags": 0,
"_parent": {
"__id__": 3
7
"__id__": 3
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 4
5
"__id__": 4
6
}
],
"_prefab": null,
...
...
@@ -2055,7 +2069,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
4
"__id__": 4
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2087,7 +2101,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
7
"__id__": 3
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2118,16 +2132,16 @@
},
"_children": [
{
"__id__": 4
8
"__id__": 4
9
}
],
"_active": true,
"_components": [
{
"__id__": 5
0
"__id__": 5
1
},
{
"__id__": 5
2
"__id__": 5
3
}
],
"_prefab": null,
...
...
@@ -2183,13 +2197,13 @@
"_name": "invalid-name_8",
"_objFlags": 0,
"_parent": {
"__id__": 4
7
"__id__": 4
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
49
"__id__":
50
}
],
"_prefab": null,
...
...
@@ -2245,7 +2259,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
8
"__id__": 4
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2277,7 +2291,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
7
"__id__": 4
8
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2286,7 +2300,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 5
1
"__id__": 5
2
}
],
"_N$interactable": true,
...
...
@@ -2354,7 +2368,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 4
7
"__id__": 4
8
},
"_id": "c4/0LlKOhNGYxw9Qf+RGtc"
},
...
...
@@ -2373,7 +2387,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
7
"__id__": 4
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2395,23 +2409,12 @@
"_originalHeight": 0,
"_id": "f09+2Nb4VHkJP4XueVoe1+"
},
{
"__type__": "e22e11e0CVGPajfhd4ljXke",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"FitType": 1,
"_id": "d2d7tWj1RCkoGmGJOQgkXO"
},
{
"__type__": "cc.Node",
"_name": "layerTrain",
"_objFlags": 0,
"_parent": {
"__id__":
2
"__id__":
5
},
"_children": [
{
...
...
@@ -2885,6 +2888,17 @@
"_originalHeight": 0,
"_id": "21D3mlX0ZIeKDtow2Zj3Lc"
},
{
"__type__": "e22e11e0CVGPajfhd4ljXke",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"FitType": 1,
"_id": "d2d7tWj1RCkoGmGJOQgkXO"
},
{
"__type__": "cc.Canvas",
"_name": "",
...
...
play/assets/tmpGame/script/NodeFitScreen.js
View file @
aea79427
...
...
@@ -3,6 +3,8 @@ const FitType = {
Scale
:
0
,
//等比缩放,一般用于背景图
FullScreen
:
1
,
//铺满全屏,拉伸
FitMode
:
2
,
//更改canvas适配策略,只能挂在canvas上
FullHeight
:
3
,
FullWidth
:
4
,
};
const
designSize
=
cc
.
size
(
1280
,
720
);
cc
.
Class
({
...
...
@@ -30,7 +32,17 @@ cc.Class({
let
visiblesize
=
cc
.
view
.
getVisibleSize
();
this
.
node
.
width
=
visiblesize
.
width
;
this
.
node
.
height
=
visiblesize
.
height
;
}
else
{
}
else
if
(
this
.
FitType
==
FitType
.
FullHeight
)
{
let
visiblesize
=
cc
.
view
.
getVisibleSize
();
let
scale
=
visiblesize
.
width
/
this
.
node
.
width
;
this
.
node
.
width
=
scale
*
this
.
node
.
width
;
this
.
node
.
height
=
scale
*
this
.
node
.
height
;
}
else
if
(
this
.
FitType
==
FitType
.
FullWidth
)
{
let
visiblesize
=
cc
.
view
.
getVisibleSize
();
let
scale
=
visiblesize
.
height
/
this
.
node
.
height
;
this
.
node
.
width
=
scale
*
this
.
node
.
width
;
this
.
node
.
height
=
scale
*
this
.
node
.
height
;
}
else
{
let
wsize
=
cc
.
view
.
getFrameSize
();
let
scaleW
=
wsize
.
width
/
designSize
.
width
;
let
scaleH
=
wsize
.
height
/
designSize
.
height
;
...
...
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