Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_iplayabc
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
middleLayer_for_iplayabc
Commits
2ad39261
Commit
2ad39261
authored
Mar 19, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: ui调整
parent
b8e0d5cf
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1057 additions
and
405 deletions
+1057
-405
.DS_Store
.DS_Store
+0
-0
big_star.mp3
assets/middleLayer_for_iplayabc/audios/big_star.mp3
+0
-0
big_star.mp3.meta
assets/middleLayer_for_iplayabc/audios/big_star.mp3.meta
+7
-0
middleLayer_for_iplayabc.fire
...dleLayer_for_iplayabc/scene/middleLayer_for_iplayabc.fire
+920
-400
middleLayer.js
assets/middleLayer_for_iplayabc/script/middleLayer.js
+32
-4
util.js
assets/middleLayer_for_iplayabc/script/util.js
+57
-1
MMTextBook-Bold.ttf
assets/middleLayer_for_iplayabc/textures/MMTextBook-Bold.ttf
+0
-0
MMTextBook-Bold.ttf.meta
...iddleLayer_for_iplayabc/textures/MMTextBook-Bold.ttf.meta
+5
-0
btn_coode.png
assets/middleLayer_for_iplayabc/textures/btn_coode.png
+0
-0
btn_coode.png.meta
assets/middleLayer_for_iplayabc/textures/btn_coode.png.meta
+36
-0
No files found.
.DS_Store
View file @
2ad39261
No preview for this file type
assets/middleLayer_for_iplayabc/audios/big_star.mp3
0 → 100644
View file @
2ad39261
File added
assets/middleLayer_for_iplayabc/audios/big_star.mp3.meta
0 → 100644
View file @
2ad39261
{
"ver": "2.0.1",
"uuid": "ad3f8d69-10b9-47f2-8168-6afd2a6247cf",
"downloadMode": 0,
"duration": 1.776327,
"subMetas": {}
}
\ No newline at end of file
assets/middleLayer_for_iplayabc/scene/middleLayer_for_iplayabc.fire
View file @
2ad39261
This diff is collapsed.
Click to expand it.
assets/middleLayer_for_iplayabc/script/middleLayer.js
View file @
2ad39261
import
{
initAir
}
from
'
./air
'
;
import
{
playAudio
,
showBigStar
}
from
'
./util
'
;
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
...
...
@@ -77,6 +78,7 @@ cc.Class({
this
.
preloadCount
=
0
;
this
.
loadedCount
=
0
;
initAir
(
this
);
this
.
initAudio
();
},
start
()
{
...
...
@@ -93,6 +95,10 @@ cc.Class({
});
},
initAudio
()
{
this
.
bigStarClip
=
cc
.
find
(
'
middleLayer/res/audio/big_star
'
).
getComponent
(
cc
.
AudioSource
).
clip
;
},
initTerminalInfo
(
callback
)
{
window
.
courseware
.
getEngineInfo
(
res
=>
{
const
{
isDev
,
uuid
}
=
JSON
.
parse
(
res
);
...
...
@@ -143,14 +149,16 @@ cc.Class({
user_code
:
this
.
userCode
,
},
res
=>
{
if
(
res
.
code
===
200
)
{
const
starLabel
=
cc
.
find
(
'
middleLayer/star_count_label
'
).
getComponent
(
cc
.
Label
);
starLabel
.
string
=
res
.
data
;
// const starLabel = cc.find('middleLayer/star_count_label').getComponent(cc.Label);
const
starLabel
=
cc
.
find
(
'
middleLayer/star_node/star_count_label
'
).
getComponent
(
cc
.
RichText
);
starLabel
.
string
=
`<outline color=black width=2><b>
${
res
.
data
}
</b></outline>`
;
}
else
{
console
.
log
(
"
-----error------
"
);
console
.
log
(
res
.
msg
);
// TODO 提示错误和上报错误
}
});
},
initPageInfo
()
{
...
...
@@ -194,6 +202,24 @@ cc.Class({
if
(
animationFlag
){
// TODO 添加星星的动画
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
setTimeout
(()
=>
{
let
star
=
cc
.
find
(
'
middleLayer/star_node/icon_star
'
);
const
resItem
=
cc
.
find
(
'
middleLayer/res/icon_bigstar
'
);
const
starBig
=
cc
.
instantiate
(
resItem
);
starBig
.
parent
=
star
.
parent
;
showBigStar
(
starBig
,
star
);
},
i
*
500
);
}
playAudio
(
this
.
bigStarClip
);
}
this
.
callNetworkApiPost
(
this
.
baseApiUrl
,
`v1/terminal/star/save`
,
{
...
...
@@ -204,6 +230,8 @@ cc.Class({
stars
:
count
,
})
},
preloadAll
()
{
if
(
window
.
preloadBundleAndSourcesFlag
)
{
...
...
@@ -489,7 +517,7 @@ cc.Class({
if
(
this
.
courseIndex
==
this
.
courses
.
length
-
1
)
{
cc
.
find
(
'
middleLayer/BtnRight
'
).
active
=
false
;
}
else
{
cc
.
find
(
'
middleLayer/BtnRight
'
).
active
=
true
;
//
cc.find('middleLayer/BtnRight').active = true;
}
this
.
loadPageBundle
();
},
...
...
@@ -542,7 +570,7 @@ cc.Class({
this
.
courseItem
=
data
.
rows
[
this
.
courseIndex
];
}
if
(
this
.
courses
&&
this
.
courses
.
length
>
1
&&
this
.
courseIndex
<=
this
.
courses
.
length
-
1
)
{
cc
.
find
(
'
middleLayer/BtnRight
'
).
active
=
true
;
//
cc.find('middleLayer/BtnRight').active = true;
}
if
(
this
.
courseIndex
>
0
)
{
cc
.
find
(
'
middleLayer/BtnLeft
'
).
active
=
false
;
...
...
assets/middleLayer_for_iplayabc/script/util.js
View file @
2ad39261
...
...
@@ -168,7 +168,7 @@ export function playAudio(audioClip, cb = null) {
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
();
cb
&&
cb
();
});
}
}
...
...
@@ -305,6 +305,62 @@ export async function asyncTweenTo(node, duration, obj, ease = undefined) {
});
}
export
function
showBigStar
(
starJump
,
starBase
,
cb
=
null
)
{
const
bigStarBg
=
cc
.
instantiate
(
starJump
);
bigStarBg
.
scale
=
starJump
.
width
/
starBase
.
width
/
1.2
;
starBase
.
scale
=
1
;
// const star = bigStarBg.star;
starJump
.
active
=
true
;
starJump
.
scaleX
=
0.7
/
bigStarBg
.
scale
;
starJump
.
scaleY
=
1
/
bigStarBg
.
scale
;
// starJump.angle = 90;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
exchangeNodePos
(
starJump
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
2
));
const
middlePos
=
exchangeNodePos
(
starJump
.
parent
,
canvas
,
cc
.
v2
(
0
,
-
canvas
.
height
/
4
));
starJump
.
x
=
startPos
.
x
+
Math
.
random
()
*
100
-
50
;
starJump
.
y
=
startPos
.
y
-
starBase
.
height
;
console
.
log
(
'
middlePos =
'
+
JSON
.
stringify
(
middlePos
));
const
time
=
1
;
cc
.
tween
(
starJump
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
60
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
30
,
scaleX
:
1.2
/
bigStarBg
.
scale
,
scaleY
:
0.8
/
bigStarBg
.
scale
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
bigStarBg
.
scale
,
scaleY
:
1
/
bigStarBg
.
scale
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
,
scale
:
1
})
.
start
();
cc
.
tween
(
starJump
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
x
:
starBase
.
x
},
{
easing
:
'
sineOut
'
})
.
start
();
cc
.
tween
(
starJump
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
y
:
starBase
.
y
},
{
easing
:
'
backIn
'
})
.
start
();
cc
.
tween
(
starJump
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
starBase
.
width
/
starJump
.
width
*
0.5
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
starJump
.
removeFromParent
();
cb
&&
cb
()
})
.
start
();
cc
.
tween
(
starBase
)
.
delay
(
1.4
)
.
to
(
0.1
,
{
scale
:
1.2
},
{
easing
:
'
sineInOut
'
})
.
to
(
1.1
,
{
scale
:
1
},
{
easing
:
'
elasticOut
'
})
.
start
();
}
export
async
function
asyncTweenBy
(
node
,
duration
,
obj
,
ease
=
undefined
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
...
...
assets/middleLayer_for_iplayabc/textures/MMTextBook-Bold.ttf
0 → 100644
View file @
2ad39261
File added
assets/middleLayer_for_iplayabc/textures/MMTextBook-Bold.ttf.meta
0 → 100644
View file @
2ad39261
{
"ver": "1.1.0",
"uuid": "b019349c-fa93-4ed9-81a3-2636d3b165aa",
"subMetas": {}
}
\ No newline at end of file
assets/middleLayer_for_iplayabc/textures/btn_coode.png
0 → 100644
View file @
2ad39261
15.6 KB
assets/middleLayer_for_iplayabc/textures/btn_coode.png.meta
0 → 100644
View file @
2ad39261
{
"ver": "2.3.5",
"uuid": "8ebdae24-6add-45f8-8735-310821c49bd7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 171,
"height": 146,
"platformSettings": {},
"subMetas": {
"btn_coode": {
"ver": "1.0.4",
"uuid": "f89b7f7d-86c6-40be-8cc9-f4440dd10140",
"rawTextureUuid": "8ebdae24-6add-45f8-8735-310821c49bd7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 171,
"height": 146,
"rawWidth": 171,
"rawHeight": 146,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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