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
1996ed54
Commit
1996ed54
authored
Nov 12, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 删除左下角的调试信息
parent
1f9f265c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
scene.js
play/assets/mz_003/script/scene.js
+26
-25
No files found.
play/assets/mz_003/script/scene.js
View file @
1996ed54
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
// Learn life-cycle callbacks:
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
{
localPosTolocalPos
}
from
"
./util
"
;
import
{
localPosTolocalPos
}
from
"
./util
"
;
cc
.
Class
({
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
...
@@ -59,6 +59,7 @@ cc.Class({
...
@@ -59,6 +59,7 @@ cc.Class({
},
},
start
()
{
start
()
{
cc
.
debug
.
setDisplayStats
(
false
);
let
getData
=
this
.
getData
.
bind
(
this
);
let
getData
=
this
.
getData
.
bind
(
this
);
if
(
window
&&
window
.
courseware
)
{
if
(
window
&&
window
.
courseware
)
{
// console.log('has window');
// console.log('has window');
...
@@ -164,14 +165,14 @@ cc.Class({
...
@@ -164,14 +165,14 @@ cc.Class({
addPreloadImage
()
{
addPreloadImage
()
{
if
(
this
.
data
.
bgItem
)
{
if
(
this
.
data
.
bgItem
)
{
this
.
_imageResList
.
push
({
url
:
this
.
data
.
bgItem
.
url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
bgItem
.
url
});
}
}
if
(
!
this
.
data
.
hotZoneItemArr
)
{
if
(
!
this
.
data
.
hotZoneItemArr
)
{
return
;
return
;
}
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
pic_url
)
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
pic_url
)
{
this
.
_imageResList
.
push
({
url
:
item
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
item
.
pic_url
});
}
}
})
})
...
@@ -183,7 +184,7 @@ cc.Class({
...
@@ -183,7 +184,7 @@ cc.Class({
return
;
return
;
}
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
this
.
_audioResList
.
push
({
url
:
item
.
audio_url
});
this
.
_audioResList
.
push
({
url
:
item
.
audio_url
});
})
})
},
},
...
@@ -193,9 +194,9 @@ cc.Class({
...
@@ -193,9 +194,9 @@ cc.Class({
}
}
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
this
.
data
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
skeJsonData
)
{
if
(
item
.
gIdx
==
'
0
'
&&
item
.
skeJsonData
)
{
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
}
}
})
})
...
@@ -355,7 +356,7 @@ cc.Class({
...
@@ -355,7 +356,7 @@ cc.Class({
return
;
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
);
this
.
addMask
(
this
.
hotZoneBg
);
...
@@ -402,7 +403,7 @@ cc.Class({
...
@@ -402,7 +403,7 @@ cc.Class({
this
.
hotZoneBg
.
scale
=
Math
.
min
(
sx
,
sy
);
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 + (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;
// this.hotZoneBg.opacity = 20;
...
@@ -535,9 +536,9 @@ cc.Class({
...
@@ -535,9 +536,9 @@ cc.Class({
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
cc
.
loader
.
load
(
image
,
(
error
,
texture
)
=>
{
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
();
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
atlasJson
;
atlas
.
atlasJson
=
atlasJson
;
...
@@ -602,7 +603,7 @@ cc.Class({
...
@@ -602,7 +603,7 @@ cc.Class({
picNode
.
data
=
data
;
picNode
.
data
=
data
;
this
.
hotZoneBg
.
addChild
(
picNode
);
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
);
const
spr
=
picNode
.
addComponent
(
cc
.
Sprite
);
spr
.
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
spr
.
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
...
@@ -682,9 +683,9 @@ cc.Class({
...
@@ -682,9 +683,9 @@ cc.Class({
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
const
atlas
=
data
.
texJsonData
.
url
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
cc
.
loader
.
load
(
image
,
(
error
,
texture
)
=>
{
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
();
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
atlasJson
;
atlas
.
atlasJson
=
atlasJson
;
...
@@ -827,7 +828,7 @@ cc.Class({
...
@@ -827,7 +828,7 @@ cc.Class({
_toCenterShow
(
node
)
{
_toCenterShow
(
node
)
{
const
bgBottom
=
cc
.
find
(
'
Canvas/bgBottom
'
);
const
bgBottom
=
cc
.
find
(
'
Canvas/bgBottom
'
);
cc
.
tween
(
node
)
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
(()
=>
{
.
call
(()
=>
{
})
})
.
start
();
.
start
();
...
@@ -850,7 +851,7 @@ cc.Class({
...
@@ -850,7 +851,7 @@ cc.Class({
const
changeNode
=
this
.
_curShowItem
;
const
changeNode
=
this
.
_curShowItem
;
changeNode
.
cantouch
=
false
;
changeNode
.
cantouch
=
false
;
cc
.
tween
(
this
.
_curShowItem
)
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
(()
=>
{
.
call
(()
=>
{
changeNode
.
cantouch
=
true
;
changeNode
.
cantouch
=
true
;
})
})
...
@@ -1001,8 +1002,8 @@ cc.Class({
...
@@ -1001,8 +1002,8 @@ cc.Class({
const
backItem
=
this
.
_curShowItem
;
const
backItem
=
this
.
_curShowItem
;
cc
.
tween
(
backItem
)
cc
.
tween
(
backItem
)
.
to
(
0.3
,
{
x
:
backItem
.
baseX
,
y
:
backItem
.
baseY
},
{
easing
:
'
elasticOut
'
})
.
to
(
0.3
,
{
x
:
backItem
.
baseX
,
y
:
backItem
.
baseY
},
{
easing
:
'
elasticOut
'
})
.
call
((
)
=>
{
.
call
(()
=>
{
backItem
.
bgBottomItem
.
opacity
=
255
;
backItem
.
bgBottomItem
.
opacity
=
255
;
backItem
.
removeFromParent
();
backItem
.
removeFromParent
();
backItem
.
data
.
isDrag
=
false
;
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