Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douyin_xiaoxiaole
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
douyin_xiaoxiaole
Commits
0c290c6a
Commit
0c290c6a
authored
Jul 13, 2023
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
fcd1f274
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
douyin_xiaoxiaole.js
assets/douyin_xiaoxiaole/scene/douyin_xiaoxiaole.js
+1
-1
wordgame_syllabus.ts
assets/wordgame_syllabus/scene/wordgame_syllabus.ts
+6
-6
No files found.
assets/douyin_xiaoxiaole/scene/douyin_xiaoxiaole.js
View file @
0c290c6a
...
...
@@ -93,7 +93,7 @@ cc.Class({
const
nickObj
=
await
drawOpenNickName
(
res
.
nickName
);
await
asyncCallNetworkApiPost
(
'
/api/douyin/v1/create
'
,
{
roomid
:
this
.
roomId
,
uid
:
this
.
uid
,
nickname
:
nickObj
.
data
,
role
:
this
.
role
});
await
asyncCallNetworkApiPost
(
'
/api/douyin/v1/create
'
,
{
roomid
:
this
.
roomId
,
uid
:
this
.
uid
,
nickname
:
JSON
.
stringify
(
nickObj
)
,
role
:
this
.
role
});
if
(
this
.
role
==
'
anchor
'
)
{
// 主播
cc
.
director
.
loadScene
(
'
wordgame_syllabus
'
);
...
...
assets/wordgame_syllabus/scene/wordgame_syllabus.ts
View file @
0c290c6a
...
...
@@ -62,7 +62,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
find
(
`ready`
,
itemClone
).
active
=
false
;
cc
.
find
(
`score`
,
itemClone
).
active
=
true
;
cc
.
find
(
`score`
,
itemClone
).
getComponent
(
cc
.
Label
).
string
=
row
.
score
;
await
this
.
drawNickName
(
itemClone
,
row
.
nick_name
);
await
this
.
drawNickName
(
itemClone
,
JSON
.
parse
(
row
.
nickObj
)
);
}
}
else
{
this
.
rankpage
.
active
=
false
;
...
...
@@ -74,7 +74,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
},
1
);
}
drawNickName
(
node
,
data
)
{
drawNickName
(
node
,
nickObj
)
{
return
new
Promise
((
resolve
)
=>
{
const
image
=
new
Image
();
image
.
onload
=
()
=>
{
...
...
@@ -84,12 +84,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
);
const
coverNode
=
cc
.
find
(
`nickname`
,
node
);
coverNode
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
spriteFrame
;
//
const sx = nickObj.width / coverNode.width;
//
const sy = nickObj.height / coverNode.height;
//
coverNode.scale = Math.max(sx, sy);
const
sx
=
nickObj
.
width
/
coverNode
.
width
;
const
sy
=
nickObj
.
height
/
coverNode
.
height
;
coverNode
.
scale
=
Math
.
max
(
sx
,
sy
);
resolve
();
}
image
.
src
=
data
;
image
.
src
=
nickObj
.
data
;
});
}
...
...
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