Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
53c1561f
Commit
53c1561f
authored
Aug 21, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
호패 씬에서 입력 길이에 따라 입력창 길이가 달라지게 함
parent
3d59e452
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
hopaeSceneInput.png
assets/image/word/hopaeSceneInput.png
+0
-0
Input.js
js/Input.js
+3
-1
ResourceLoader.js
js/ResourceLoader.js
+1
-5
ScenesData.js
js/ScenesData.js
+4
-3
WordObject.js
js/WordObject.js
+8
-2
No files found.
assets/image/word/hopaeSceneInput.png
0 → 100644
View file @
53c1561f
28.8 KB
js/Input.js
View file @
53c1561f
...
...
@@ -306,13 +306,15 @@ Input.inputField =
{
generate
:
function
(
scene
,
enterCallback
,
text
,
isHopaeScene
=
false
)
{
this
.
text
=
text
;
this
.
text
=
text
.
getElement
(
'
text
'
);
this
.
inputBackground
=
text
.
getElement
(
'
background
'
);
scene
.
input
.
keyboard
.
on
(
'
keyup
'
,
function
()
{
Input
.
pressCount
--
;
Input
.
justPressed
=
''
;
if
(
isHopaeScene
)
{
ScenesData
.
hopaeScene
.
checkBtn
.
setEnable
(
Input
.
checkProperInput
(
Input
.
inputField
.
text
.
text
)
||
(
Input
.
finalInput
.
length
>
1
)
?
true
:
false
);
ScenesData
.
hopaeScene
.
warningText
.
setVisible
(
Input
.
finalInput
.
length
>
4
?
true
:
false
);
if
(
Input
.
finalInput
.
length
>
1
)
Input
.
inputField
.
inputBackground
.
setFrame
(
Input
.
finalInput
.
length
-
2
);
}})
scene
.
input
.
keyboard
.
on
(
'
keydown-SHIFT
'
,
function
()
{
Input
.
isShifted
=
true
});
scene
.
input
.
keyboard
.
on
(
'
keyup-SHIFT
'
,
function
()
{
Input
.
isShifted
=
false
});
...
...
js/ResourceLoader.js
View file @
53c1561f
...
...
@@ -42,6 +42,7 @@ ResourceLoader.loadImage = function(scene)
scene
.
load
.
image
(
'
pyeongminStand
'
,
'
assets/image/character/pyeongmin/pyeong_stand.png
'
);
scene
.
load
.
spritesheet
(
'
wordBreak
'
,
'
assets/image/word/wordbreak.png
'
,
{
frameWidth
:
180
,
frameHeight
:
180
});
scene
.
load
.
spritesheet
(
'
hopaeSceneInput
'
,
'
assets/image/word/hopaeSceneInput.png
'
,
{
frameWidth
:
239
,
frameHeight
:
45
});
scene
.
load
.
image
(
'
attackPaper
'
,
'
assets/image/etc/paper_crumbled.png
'
);
scene
.
load
.
image
(
'
button
'
,
'
assets/placeholder/button.png
'
);
scene
.
load
.
image
(
'
panel
'
,
'
assets/placeholder/panel.png
'
);
...
...
@@ -52,11 +53,6 @@ ResourceLoader.loadImage = function(scene)
scene
.
load
.
image
(
'
shopBtn
'
,
'
assets/image/UI/main/shop.png
'
);
scene
.
load
.
image
(
'
hopaeManageBtn
'
,
'
assets/image/UI/main/hopaeManage.png
'
);
scene
.
load
.
image
(
'
helpBtn
'
,
'
assets/image/UI/main/help.png
'
);
scene
.
load
.
image
(
'
helpBtn
'
,
'
assets/image/UI/decisionBtn/spectate.png
'
);
scene
.
load
.
image
(
'
helpBtn
'
,
'
assets/image/UI/decisionBtn/help.png
'
);
scene
.
load
.
image
(
'
helpBtn
'
,
'
assets/image/UI/decisionBtn/help.png
'
);
scene
.
load
.
image
(
'
helpBtn
'
,
'
assets/image/UI/decisionBtn/help.png
'
);
...
...
js/ScenesData.js
View file @
53c1561f
...
...
@@ -249,9 +249,10 @@ var hopaeScene = new Phaser.Class(
create
:
function
()
{
BackGround
.
drawBackground
(
this
);
this
.
inputBackground
=
UIObject
.
createLabel
(
this
,
game
.
config
.
width
/
2
,
game
.
config
.
height
/
2
,
10
,
'
hopaeSceneInput
'
,
2
,
'
center
'
,
''
,
50
,
'
#ffffff
'
,
0.45
,
0.5
);
Input
.
inputField
.
generate
(
this
,
function
(){},
UIObject
.
createLabel
(
this
,
game
.
config
.
width
/
2
,
game
.
config
.
height
/
2
,
10
,
'
nameBgr6
'
,
2
,
'
center
'
,
''
,
50
,
'
#ffffff
'
).
getElement
(
'
text
'
).
setOrigin
(
0.45
,
0.5
),
true
);
Input
.
inputField
.
generate
(
this
,
function
(){},
this
.
inputBackground
,
true
);
UIObject
.
createLabel
(
this
,
game
.
config
.
width
/
2
,
game
.
config
.
height
/
2
-
200
,
2
,
'
noticeBackground
'
,
1
,
'
center
'
,
'
호패는 오직 한글만 입력이 가능합니다.
\n
띄어쓰기도 사용할 수 없습니다.
'
,
50
,
'
#000000
'
).
layout
();
...
...
@@ -467,7 +468,7 @@ var gameScene = new Phaser.Class(
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
Input
.
inputField
.
generate
(
this
,
Input
.
gameSceneEnterReaction
,
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
,
game
.
config
.
height
*
25
/
36
,
10
,
'
inputfield
'
,
1
,
'
center
'
,
''
,
25
,
'
#000000
'
)
.
getElement
(
'
text
'
)
);
UIObject
.
createLabel
(
ScenesData
.
gameScene
,
game
.
config
.
width
/
2
,
game
.
config
.
height
*
25
/
36
,
10
,
'
inputfield
'
,
1
,
'
center
'
,
''
,
25
,
'
#000000
'
));
WordSpace
.
attackGauge
.
generate
(
this
);
WordSpace
.
spaceInitiate
(
this
);
...
...
js/WordObject.js
View file @
53c1561f
...
...
@@ -57,8 +57,6 @@ class WordObject
setTimeout
(
function
()
{
breakAnim
.
destroy
();
},
200
);
RoomData
.
myself
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
RoomData
.
myself
.
playerImage
.
anims
.
chain
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]);
}
attract
()
...
...
@@ -110,6 +108,8 @@ class NormalWord extends WordObject
super
.
destroy
();
if
(
isNormallyRemoved
)
{
RoomData
.
myself
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
RoomData
.
myself
.
playerImage
.
anims
.
chain
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]);
switch
(
this
.
wordGrade
)
{
case
0
:
WordSpace
.
attackGauge
.
add
(
2.5
);
break
;
...
...
@@ -189,6 +189,8 @@ class AttackWord extends WordObject
super
.
destroy
();
if
(
isNormallyRemoved
)
{
RoomData
.
myself
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
RoomData
.
myself
.
playerImage
.
anims
.
chain
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]);
switch
(
this
.
wordGrade
)
{
case
0
:
WordSpace
.
attackGauge
.
add
(
2.5
);
break
;
...
...
@@ -271,6 +273,8 @@ class NameWord extends WordObject
super
.
destroy
();
if
(
isNormallyRemoved
)
{
RoomData
.
myself
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
RoomData
.
myself
.
playerImage
.
anims
.
chain
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]);
ScenesData
.
gameScene
.
physics
.
world
.
removeCollider
(
this
.
physicsObj
.
wordCollider
);
WordSpace
.
wordGroup
.
forEach
(
function
(
element
)
{
...
...
@@ -356,6 +360,8 @@ class ItemWord extends WordObject
super
.
destroy
();
if
(
isNormallyRemoved
)
{
RoomData
.
myself
.
playerImage
.
play
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
write
]);
RoomData
.
myself
.
playerImage
.
anims
.
chain
(
WordSpace
.
pyeongminAnims
[
Enums
.
characterAnim
.
sit
]);
WordSpace
.
attackGauge
.
add
(
0.5
);
switch
(
this
.
itemType
)
{
...
...
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