Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crazyflirt
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Shawn Wang
crazyflirt
Commits
22c4134b
Commit
22c4134b
authored
May 06, 2018
by
Shawn Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a
parent
e0257e72
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
12 deletions
+23
-12
Avatar.ts
fe/src/Avatar.ts
+15
-3
AvatarGroup.ts
fe/src/AvatarGroup.ts
+4
-4
GameScene.ts
fe/src/scenes/GameScene.ts
+3
-4
RoomScene.ts
fe/src/scenes/RoomScene.ts
+1
-1
No files found.
fe/src/Avatar.ts
View file @
22c4134b
class
Avatar
extends
egret
.
Sprite
{
public
constructor
(
userData
)
{
public
constructor
(
userData
,
showName
)
{
super
()
this
.
init
(
userData
)
this
.
init
(
userData
,
showName
)
}
private
avatar
=
new
egret
.
Bitmap
()
private
bg
=
new
egret
.
Bitmap
()
private
imageLoader
=
new
egret
.
ImageLoader
()
private
nameLabel
=
new
egret
.
TextField
()
private
init
(
userData
)
{
private
init
(
userData
,
showName
)
{
this
.
bg
.
width
=
100
this
.
bg
.
height
=
100
this
.
bg
.
texture
=
RES
.
getRes
(
"avatar_bg_jpg"
)
...
...
@@ -23,6 +25,16 @@ class Avatar extends egret.Sprite {
this
.
imageLoader
.
load
(
userData
.
avatar_url
||
"http://www.insajderi.com/wp-content/uploads/2018/01/asdja.jpg"
)
this
.
addChild
(
this
.
avatar
)
if
(
showName
){
this
.
nameLabel
.
text
=
userData
.
nick_name
this
.
nameLabel
.
width
=
100
this
.
nameLabel
.
textAlign
=
egret
.
HorizontalAlign
.
CENTER
;
this
.
nameLabel
.
x
=
0
this
.
nameLabel
.
size
=
16
this
.
nameLabel
.
y
=
100
this
.
addChild
(
this
.
nameLabel
);
}
}
private
loadCompleteHandler
()
{
...
...
fe/src/AvatarGroup.ts
View file @
22c4134b
class
AvatarGroup
extends
egret
.
Sprite
{
public
constructor
(
userDatas
)
{
public
constructor
(
userDatas
,
showName
=
false
)
{
super
()
this
.
init
(
userDatas
)
this
.
init
(
userDatas
,
showName
)
}
private
init
(
userDatas
)
{
private
init
(
userDatas
,
showName
)
{
userDatas
.
forEach
((
userData
,
index
)
=>
{
let
avatar
=
new
Avatar
(
userData
)
let
avatar
=
new
Avatar
(
userData
,
showName
)
avatar
.
x
=
index
*
100
this
.
addChild
(
avatar
)
})
...
...
fe/src/scenes/GameScene.ts
View file @
22c4134b
...
...
@@ -16,14 +16,13 @@ class GameScene extends egret.Sprite {
bg
.
graphics
.
drawRect
(
0
,
0
,
1334
,
750
)
bg
.
graphics
.
endFill
()
this
.
addChild
(
bg
)
// if (!Store.isCatcher()) {
this
.
controller
=
new
Controller
(
Store
.
isCatcher
())
this
.
addChild
(
this
.
controller
)
// }
this
.
map
=
new
Map
()
this
.
map
.
y
=
15
this
.
map
.
x
=
10
this
.
addChild
(
this
.
map
)
this
.
controller
=
new
Controller
(
Store
.
isCatcher
())
this
.
addChild
(
this
.
controller
)
}
public
release
()
{
...
...
fe/src/scenes/RoomScene.ts
View file @
22c4134b
...
...
@@ -61,7 +61,7 @@ class RoomScene extends egret.Sprite {
if
(
this
.
avatars
&&
this
.
avatars
.
parent
){
this
.
avatars
.
parent
.
removeChild
(
this
.
avatars
)
}
this
.
avatars
=
new
AvatarGroup
(
members
)
this
.
avatars
=
new
AvatarGroup
(
members
,
true
)
this
.
avatars
.
y
=
330
this
.
avatars
.
x
=
667
-
(
members
.
length
*
100
)
/
2
this
.
addChild
(
this
.
avatars
)
...
...
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