Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cc_mz_003
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
cc_mz_003
Commits
962ed42f
Commit
962ed42f
authored
Dec 08, 2020
by
Li MingZhe
Browse files
Options
Browse Files
Download
Plain Diff
feat: 背景色更改
parents
f7228ce8
9e19eb64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
scene.js
play/assets/mz_003/script/scene.js
+27
-24
No files found.
play/assets/mz_003/script/scene.js
View file @
962ed42f
...
...
@@ -5,7 +5,7 @@
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
{
localPosTolocalPos
}
from
"
./util
"
;
import
{
localPosTolocalPos
}
from
"
./util
"
;
cc
.
Class
({
extends
:
cc
.
Component
,
...
...
@@ -75,6 +75,7 @@ cc.Class({
},
start
()
{
cc
.
debug
.
setDisplayStats
(
false
);
let
getData
=
this
.
getData
.
bind
(
this
);
if
(
window
&&
window
.
courseware
)
{
// console.log('has window');
...
...
@@ -85,6 +86,8 @@ cc.Class({
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
preloadItem
()
})
console
.
log
(
'
cc.sys.capabilities["touches"] =
'
,
cc
.
sys
.
capabilities
[
"
touches
"
]);
},
...
...
@@ -180,14 +183,14 @@ cc.Class({
addPreloadImage
()
{
if
(
this
.
data
.
bgItem
)
{
this
.
_imageResList
.
push
({
url
:
this
.
data
.
bgItem
.
url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
bgItem
.
url
});
}
if
(
!
this
.
data
.
hotZoneItemArr
)
{
return
;
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
pic_url
)
{
this
.
_imageResList
.
push
({
url
:
item
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
item
.
pic_url
});
}
})
...
...
@@ -199,7 +202,7 @@ cc.Class({
return
;
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
this
.
_audioResList
.
push
({
url
:
item
.
audio_url
});
this
.
_audioResList
.
push
({
url
:
item
.
audio_url
});
})
},
...
...
@@ -209,9 +212,9 @@ cc.Class({
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
skeJsonData
)
{
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
}
})
...
...
@@ -504,7 +507,7 @@ cc.Class({
return
;
}
cc
.
loader
.
load
({
url
:
this
.
data
.
bgItem
.
url
},
(
err
,
img
)
=>
{
cc
.
loader
.
load
({
url
:
this
.
data
.
bgItem
.
url
},
(
err
,
img
)
=>
{
this
.
addMask
(
this
.
hotZoneBg
);
...
...
@@ -551,7 +554,7 @@ cc.Class({
this
.
hotZoneBg
.
scale
=
Math
.
min
(
sx
,
sy
);
// this.hotZoneBg.y = -frameSize.height / 2 * this._cocosScale + this.hotZoneBg.height / 2 * this.hotZoneBg.scaleY + (subNum * mapS * this._cocosScale);
this
.
hotZoneBg
.
y
=
frameSize
.
height
/
2
*
this
.
_cocosScale
-
this
.
hotZoneBg
.
height
/
2
*
this
.
hotZoneBg
.
scaleY
;
this
.
hotZoneBg
.
y
=
frameSize
.
height
/
2
*
this
.
_cocosScale
-
this
.
hotZoneBg
.
height
/
2
*
this
.
hotZoneBg
.
scaleY
;
// this.hotZoneBg.opacity = 20;
...
...
@@ -684,9 +687,9 @@ cc.Class({
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
cc
.
loader
.
load
(
image
,
(
error
,
texture
)
=>
{
cc
.
loader
.
load
({
url
:
atlas
,
type
:
'
txt
'
},
(
error
,
atlasJson
)
=>
{
cc
.
loader
.
load
({
url
:
atlas
,
type
:
'
txt
'
},
(
error
,
atlasJson
)
=>
{
cc
.
loader
.
load
({
url
:
ske
,
type
:
'
txt
'
},
(
error
,
dragonBonesJson
)
=>
{
cc
.
loader
.
load
({
url
:
ske
,
type
:
'
txt
'
},
(
error
,
dragonBonesJson
)
=>
{
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
atlasJson
;
...
...
@@ -751,7 +754,7 @@ cc.Class({
picNode
.
data
=
data
;
this
.
hotZoneBg
.
addChild
(
picNode
);
cc
.
loader
.
load
({
url
:
data
.
pic_url
},
(
err
,
img
)
=>
{
cc
.
loader
.
load
({
url
:
data
.
pic_url
},
(
err
,
img
)
=>
{
const
spr
=
picNode
.
addComponent
(
cc
.
Sprite
);
spr
.
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
...
...
@@ -831,9 +834,9 @@ cc.Class({
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
cc
.
loader
.
load
(
image
,
(
error
,
texture
)
=>
{
cc
.
loader
.
load
({
url
:
atlas
,
type
:
'
txt
'
},
(
error
,
atlasJson
)
=>
{
cc
.
loader
.
load
({
url
:
atlas
,
type
:
'
txt
'
},
(
error
,
atlasJson
)
=>
{
cc
.
loader
.
load
({
url
:
ske
,
type
:
'
txt
'
},
(
error
,
dragonBonesJson
)
=>
{
cc
.
loader
.
load
({
url
:
ske
,
type
:
'
txt
'
},
(
error
,
dragonBonesJson
)
=>
{
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
atlasJson
;
...
...
@@ -976,7 +979,7 @@ cc.Class({
_toCenterShow
(
node
)
{
const
bgBottom
=
cc
.
find
(
'
Canvas/bgBottom
'
);
cc
.
tween
(
node
)
.
to
(
1
,
{
x
:
0
,
y
:
0
,
scale
:
bgBottom
.
scale
},
{
easing
:
'
cubicOut
'
})
.
to
(
1
,
{
x
:
0
,
y
:
0
,
scale
:
bgBottom
.
scale
},
{
easing
:
'
cubicOut
'
})
.
call
(()
=>
{
})
.
start
();
...
...
@@ -999,7 +1002,7 @@ cc.Class({
const
changeNode
=
this
.
_curShowItem
;
changeNode
.
cantouch
=
false
;
cc
.
tween
(
this
.
_curShowItem
)
.
to
(
1
,
{
scale
:
s
*
0.95
,
x
:
localPos
.
x
,
y
:
localPos
.
y
},
{
easing
:
'
cubicOut
'
})
.
to
(
1
,
{
scale
:
s
*
0.95
,
x
:
localPos
.
x
,
y
:
localPos
.
y
},
{
easing
:
'
cubicOut
'
})
.
call
(()
=>
{
changeNode
.
cantouch
=
true
;
})
...
...
@@ -1150,8 +1153,8 @@ cc.Class({
const
backItem
=
this
.
_curShowItem
;
cc
.
tween
(
backItem
)
.
to
(
0.3
,
{
x
:
backItem
.
baseX
,
y
:
backItem
.
baseY
},
{
easing
:
'
elasticOut
'
})
.
call
((
)
=>
{
.
to
(
0.3
,
{
x
:
backItem
.
baseX
,
y
:
backItem
.
baseY
},
{
easing
:
'
elasticOut
'
})
.
call
(()
=>
{
backItem
.
bgBottomItem
.
opacity
=
255
;
backItem
.
removeFromParent
();
backItem
.
data
.
isDrag
=
false
;
...
...
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