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
9fa39321
Commit
9fa39321
authored
Jun 23, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 背景灰色问题
parent
2a15d45b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
59 deletions
+74
-59
NJ_NongChang.fire
assets/NJ_NongChang/scene/NJ_NongChang.fire
+37
-40
NJ_NongChang.ts
assets/NJ_NongChang/scene/NJ_NongChang.ts
+37
-19
No files found.
assets/NJ_NongChang/scene/NJ_NongChang.fire
View file @
9fa39321
...
@@ -6101,7 +6101,7 @@
...
@@ -6101,7 +6101,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
69
.94,
"width": 1
71
.94,
"height": 63
"height": 63
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -6178,8 +6178,8 @@
...
@@ -6178,8 +6178,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-8
4
.97,
-8
5
.97,
-3
4
.5,
-3
5
.5,
0,
0,
0,
0,
0,
0,
...
@@ -6202,7 +6202,7 @@
...
@@ -6202,7 +6202,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
61VnAvvX5LTrGlELL7dpjG
"
"_id": "
c5nhbNI4RMSbrFL6Kl78xV
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -6235,7 +6235,7 @@
...
@@ -6235,7 +6235,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "6
4IcTsDClPL6tJzp5yaFTX
"
"_id": "6
6U1JfBjFO5rncAeX2Ov5r
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -6253,7 +6253,7 @@
...
@@ -6253,7 +6253,7 @@
"a": 255
"a": 255
},
},
"_width": 4,
"_width": 4,
"_id": "
945K0hEm5MUJgW0D/KxZg3
"
"_id": "
61gASl8RlGlaPPAh7bEgpu
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -6406,7 +6406,7 @@
...
@@ -6406,7 +6406,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
c1HCQ9yRhMc62pH8ixjJs5
"
"_id": "
6519AK19JAhJXLOi4dFd2h
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -6439,7 +6439,7 @@
...
@@ -6439,7 +6439,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
45IA8ovq9O4InvquvEzW+F
"
"_id": "
e8Kme7caNFjL7+pxPMNnLu
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -6457,7 +6457,7 @@
...
@@ -6457,7 +6457,7 @@
"a": 255
"a": 255
},
},
"_width": 7,
"_width": 7,
"_id": "
14WKYLGNhI6JidrYDym2ws
"
"_id": "
43ZSQAavtNObMkCb2P3gb/
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -9354,7 +9354,7 @@
...
@@ -9354,7 +9354,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
91sTYQJbpNC5KUXsh3LcVQ
"
"_id": "
2d4u3leZhDyaTXwhq8ut96
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -9387,7 +9387,7 @@
...
@@ -9387,7 +9387,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
74mBEzHspBq4bH6fyH7Nna
"
"_id": "
17UytODGRPNr8c66k16WqB
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -9405,7 +9405,7 @@
...
@@ -9405,7 +9405,7 @@
"a": 255
"a": 255
},
},
"_width": 7,
"_width": 7,
"_id": "
a59I5drERMHYXbbKWVe9NG
"
"_id": "
70SB178G9D6JQ8zMisfLu8
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -9457,7 +9457,7 @@
...
@@ -9457,7 +9457,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
69
.94,
"width": 1
71
.94,
"height": 63
"height": 63
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -9534,8 +9534,8 @@
...
@@ -9534,8 +9534,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-8
4
.97,
-8
5
.97,
-3
4
.5,
-3
5
.5,
0,
0,
0,
0,
0,
0,
...
@@ -9558,7 +9558,7 @@
...
@@ -9558,7 +9558,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
fcaIrD2NVHLqn0ZMDMK8Wc
"
"_id": "
89VHvdT8VP+KKH3m7SaEdD
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -9591,7 +9591,7 @@
...
@@ -9591,7 +9591,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
e2v39LqAtIuZU7JeZs16JJ
"
"_id": "
7auYzlTQlBZ6wN8GAtE3Ed
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -9609,7 +9609,7 @@
...
@@ -9609,7 +9609,7 @@
"a": 255
"a": 255
},
},
"_width": 4,
"_width": 4,
"_id": "
dd5Ncb7mxFYoDBLzRDRosh
"
"_id": "
71PZSk0RpLu4hrNvuuzvxg
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -12700,7 +12700,7 @@
...
@@ -12700,7 +12700,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
aca/VnCzVLyrCGoIQNnXFv
"
"_id": "
52eIuWxMhGiprY7PFz/rJi
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -12733,7 +12733,7 @@
...
@@ -12733,7 +12733,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
49KFfESrxAAZH2RCAfuTOA
"
"_id": "
63ew3iWOFFr56J17PZvYHc
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -12751,7 +12751,7 @@
...
@@ -12751,7 +12751,7 @@
"a": 255
"a": 255
},
},
"_width": 7,
"_width": 7,
"_id": "
55Kf8Po6JMBJtsT2eK1jvJ
"
"_id": "
1dlBIXpvpNPoyWrHQTgd5G
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -12803,7 +12803,7 @@
...
@@ -12803,7 +12803,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
69
.94,
"width": 1
71
.94,
"height": 63
"height": 63
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -12880,8 +12880,8 @@
...
@@ -12880,8 +12880,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-8
4
.97,
-8
5
.97,
-3
4
.5,
-3
5
.5,
0,
0,
0,
0,
0,
0,
...
@@ -12904,7 +12904,7 @@
...
@@ -12904,7 +12904,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
7azYyrwh5NgaDQuXEX+iDv
"
"_id": "
ffmER+TB9CGYSP0PY4qLpL
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -12937,7 +12937,7 @@
...
@@ -12937,7 +12937,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
a9WT0IpX9DRozKfxAs9Bln
"
"_id": "
e0TwyF3IFOtKh1Yy8XjYrQ
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -12955,7 +12955,7 @@
...
@@ -12955,7 +12955,7 @@
"a": 255
"a": 255
},
},
"_width": 4,
"_width": 4,
"_id": "
0axwP33XJEr5B6H2jxUjCh
"
"_id": "
26Sdk0FuFPC7TSL9dYFk1j
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -16049,7 +16049,7 @@
...
@@ -16049,7 +16049,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
5aieC4clpHr7ypqSmJJ9AB
"
"_id": "
06v63HcOpBeJKL76s51TeH
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -16082,7 +16082,7 @@
...
@@ -16082,7 +16082,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
92YAQoy1ZF4Yqa5BfpY7Pu
"
"_id": "
f3HwTnvqJI7L9yaqHOuODb
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -16100,7 +16100,7 @@
...
@@ -16100,7 +16100,7 @@
"a": 255
"a": 255
},
},
"_width": 7,
"_width": 7,
"_id": "
fa85pFg0FLO6+ESUeTOQtA
"
"_id": "
58INBkg4lBU4mi9TUaKD9o
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -16152,7 +16152,7 @@
...
@@ -16152,7 +16152,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
69
.94,
"width": 1
71
.94,
"height": 63
"height": 63
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -16229,8 +16229,8 @@
...
@@ -16229,8 +16229,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
-8
4
.97,
-8
5
.97,
-3
4
.5,
-3
5
.5,
0,
0,
0,
0,
0,
0,
...
@@ -16253,7 +16253,7 @@
...
@@ -16253,7 +16253,7 @@
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"showInEditor": false,
"_id": "
7cysiQubhKtKXSsb/NUwr4
"
"_id": "
82f0AkhsJJlK/gCoi2Lngu
"
},
},
{
{
"__type__": "cc.Label",
"__type__": "cc.Label",
...
@@ -16286,7 +16286,7 @@
...
@@ -16286,7 +16286,7 @@
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$overflow": 0,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "
afNH1dvCdHNrsJLS4NJaiA
"
"_id": "
f5VgEKr+ZKk58g2sBAPwJf
"
},
},
{
{
"__type__": "cc.LabelOutline",
"__type__": "cc.LabelOutline",
...
@@ -16304,7 +16304,7 @@
...
@@ -16304,7 +16304,7 @@
"a": 255
"a": 255
},
},
"_width": 4,
"_width": 4,
"_id": "
6fuMXLHPNLjIpQ/5/k/dSr
"
"_id": "
d5J049HKVOs6lNMWzjrzYi
"
},
},
{
{
"__type__": "cc.RichText",
"__type__": "cc.RichText",
...
@@ -16402,9 +16402,6 @@
...
@@ -16402,9 +16402,6 @@
"_materials": [
"_materials": [
{
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
},
{
"__uuid__": "3a7bb79f-32fd-422e-ada2-96f518fed422"
}
}
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
...
@@ -16701,7 +16698,7 @@
...
@@ -16701,7 +16698,7 @@
"width": 1280,
"width": 1280,
"height": 720
"height": 720
},
},
"_fitWidth":
tru
e,
"_fitWidth":
fals
e,
"_fitHeight": true,
"_fitHeight": true,
"_id": "25Ey4w3bRJfKxUwBuWGsp3"
"_id": "25Ey4w3bRJfKxUwBuWGsp3"
},
},
...
...
assets/NJ_NongChang/scene/NJ_NongChang.ts
View file @
9fa39321
...
@@ -66,42 +66,60 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -66,42 +66,60 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
async
initView
()
{
async
initView
()
{
const
touchboard
=
cc
.
find
(
'
Canvas/touchboard
'
);
const
contant
=
cc
.
find
(
'
Canvas/touchboard/contant
'
);
const
scale
=
touchboard
.
height
/
contant
.
height
;
contant
.
width
=
4400
*
scale
;
contant
.
height
=
720
*
scale
;
contant
.
scale
=
scale
;
contant
.
x
=
contant
.
width
/
2
-
touchboard
.
width
/
2
;
const
bg
=
cc
.
find
(
'
Canvas/touchboard/contant/bg
'
);
const
bg
=
cc
.
find
(
'
Canvas/touchboard/contant/bg
'
);
for
(
let
i
=
0
;
i
<
36
;
i
++
)
{
for
(
let
i
=
0
;
i
<
36
;
i
++
)
{
const
btn
=
seekChildByName
(
bg
,
`btn_
${
i
}
`
);
const
btn
=
seekChildByName
(
bg
,
`btn_
${
i
}
`
);
const
row
=
this
.
rows
[
i
];
const
row
=
this
.
rows
[
i
];
if
(
row
&&
!
row
.
locked
)
{
if
(
row
&&
!
row
.
locked
)
{
this
.
changeNodeColor
(
btn
);
this
.
setSpriteColor
(
btn
,
cc
.
color
(
255
,
255
,
255
));
this
.
changeNodeColor
(
btn
.
getChildByName
(
'
icon
'
));
this
.
changeNodeColor
(
btn
.
getChildByName
(
'
icon1
'
));
this
.
changeNodeColor
(
btn
.
getChildByName
(
'
icon2
'
));
}
else
{
}
else
{
this
.
changeNodeGray
(
btn
);
this
.
setSpriteColor
(
btn
,
cc
.
color
(
200
,
200
,
200
));
this
.
changeNodeGray
(
btn
.
getChildByName
(
'
icon
'
));
this
.
changeNodeGray
(
btn
.
getChildByName
(
'
icon1
'
));
this
.
changeNodeGray
(
btn
.
getChildByName
(
'
icon2
'
));
}
}
}
}
}
}
changeNodeGray
(
node
)
{
changeNodeGray
(
node
)
{
const
sprite
:
cc
.
Sprite
=
node
.
getComponent
(
cc
.
Sprite
);
if
(
!
node
)
{
if
(
sprite
)
{
return
;
node
.
color
=
cc
.
color
(
200
,
200
,
200
);
// let material = cc.Material.createWithBuiltin('2d-gray-sprite', 0);
// let variant1 = cc.MaterialVariant.create(material, sprite);
// sprite.setMaterial(0, variant1);
}
}
let
material
=
cc
.
Material
.
createWithBuiltin
(
'
2d-gray-sprite
'
,
0
);
node
.
children
.
forEach
(
child
=>
{
const
sprite
=
node
.
getComponent
(
cc
.
Sprite
);
this
.
changeNodeGray
(
child
);
let
variant1
=
cc
.
MaterialVariant
.
create
(
material
,
sprite
);
}
);
sprite
.
setMaterial
(
0
,
variant1
);
}
}
changeNodeColor
(
node
)
{
changeNodeColor
(
node
)
{
const
sprite
:
cc
.
Sprite
=
node
.
getComponent
(
cc
.
Sprite
);
if
(
!
node
)
{
if
(
sprite
)
{
return
;
node
.
color
=
cc
.
color
(
255
,
255
,
255
);
// let material = cc.Material.createWithBuiltin('2d-sprite', 0);
// let variant1 = cc.MaterialVariant.create(material, sprite);
// sprite.setMaterial(0, variant1);
}
}
let
material
=
cc
.
Material
.
createWithBuiltin
(
'
2d-sprite
'
,
0
);
const
sprite
=
node
.
getComponent
(
cc
.
Sprite
);
let
variant1
=
cc
.
MaterialVariant
.
create
(
material
,
sprite
);
sprite
.
setMaterial
(
0
,
variant1
);
}
setSpriteColor
(
node
,
color
)
{
node
.
color
=
cc
.
color
(
color
.
r
,
color
.
g
,
color
.
b
);
node
.
children
.
forEach
(
child
=>
{
node
.
children
.
forEach
(
child
=>
{
this
.
changeNodeColor
(
child
);
if
(
child
.
getComponent
(
cc
.
Sprite
))
{
this
.
setSpriteColor
(
child
,
color
);
}
if
(
child
.
getComponent
(
cc
.
RichText
))
{
this
.
setSpriteColor
(
child
,
color
);
}
});
});
}
}
...
...
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