Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DG_FAF
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
DG_FAF
Commits
1fab9d5d
Commit
1fab9d5d
authored
Mar 05, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加游戏页排序题
parent
307fca3e
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
4333 additions
and
1473 deletions
+4333
-1473
SortWords.meta
assets/DG_FAF/prefabs/SortWords.meta
+12
-0
SortWords.prefab
assets/DG_FAF/prefabs/SortWords/SortWords.prefab
+1292
-0
SortWords.prefab.meta
assets/DG_FAF/prefabs/SortWords/SortWords.prefab.meta
+8
-0
SortWords_DG_FAF.js
assets/DG_FAF/prefabs/SortWords/SortWords_DG_FAF.js
+109
-0
SortWords_DG_FAF.js.meta
assets/DG_FAF/prefabs/SortWords/SortWords_DG_FAF.js.meta
+9
-0
textures.meta
assets/DG_FAF/prefabs/SortWords/textures.meta
+12
-0
icon_input_ok.png
assets/DG_FAF/prefabs/SortWords/textures/icon_input_ok.png
+0
-0
icon_input_ok.png.meta
.../DG_FAF/prefabs/SortWords/textures/icon_input_ok.png.meta
+36
-0
icon_input_return.png
...s/DG_FAF/prefabs/SortWords/textures/icon_input_return.png
+0
-0
icon_input_return.png.meta
...FAF/prefabs/SortWords/textures/icon_input_return.png.meta
+36
-0
mask_bg.png
assets/DG_FAF/prefabs/SortWords/textures/mask_bg.png
+0
-0
mask_bg.png.meta
assets/DG_FAF/prefabs/SortWords/textures/mask_bg.png.meta
+36
-0
DG_FAF.fire
assets/DG_FAF/scene/DG_FAF.fire
+2759
-1473
DG_FAF.ts
assets/DG_FAF/scene/DG_FAF.ts
+24
-0
No files found.
assets/DG_FAF/prefabs/SortWords.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "1.1.2",
"uuid": "c7844bce-f7f3-4440-950c-3b060af41edd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/SortWords.prefab
0 → 100644
View file @
1fab9d5d
This diff is collapsed.
Click to expand it.
assets/DG_FAF/prefabs/SortWords/SortWords.prefab.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "1.2.9",
"uuid": "e2d8086f-75f8-4d44-a894-88c1e26bb42c",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/SortWords_DG_FAF.js
0 → 100644
View file @
1fab9d5d
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
currentInputIndex
:
0
,
start
()
{
this
.
initEventListener
();
},
initEventListener
()
{
const
returnBtn
=
cc
.
find
(
"
buttons/return
"
,
this
.
node
);
returnBtn
.
on
(
"
click
"
,
()
=>
{
this
.
node
.
emit
(
"
onCancel
"
);
this
.
hide
();
})
const
okBtn
=
cc
.
find
(
"
buttons/ok
"
,
this
.
node
);
okBtn
.
on
(
"
click
"
,
()
=>
{
const
selectedContainer
=
cc
.
find
(
"
mainContainer/selected
"
,
this
.
node
);
const
allData
=
[];
selectedContainer
.
children
.
forEach
(
child
=>
{
allData
.
push
(
child
.
myData
)
})
this
.
node
.
emit
(
"
onEnter
"
,
allData
);
this
.
hide
();
})
this
.
node
.
on
(
"
show
"
,
options
=>
{
this
.
show
(
options
);
})
},
show
(
options
)
{
this
.
node
.
opacity
=
0
;
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
this
.
node
.
active
=
true
;
const
template
=
cc
.
find
(
"
mainContainer/options/word
"
,
this
.
node
);
const
optionsContainer
=
cc
.
find
(
"
mainContainer/options
"
,
this
.
node
);
const
selectedContainer
=
cc
.
find
(
"
mainContainer/selected
"
,
this
.
node
);
options
.
forEach
(
item
=>
{
const
newWord
=
cc
.
instantiate
(
template
);
newWord
.
getComponent
(
cc
.
Label
).
string
=
item
.
word
;
newWord
.
active
=
true
;
newWord
.
myData
=
{
selected
:
false
,
currentIndex
:
-
1
,
option
:
item
,
};
optionsContainer
.
addChild
(
newWord
);
newWord
.
on
(
"
click
"
,
()
=>
{
if
(
newWord
.
selected
)
{
selectedContainer
.
removeChild
(
newWord
)
optionsContainer
.
addChild
(
newWord
)
newWord
.
myData
.
selected
=
false
;
ewWord
.
myData
.
currentIndex
=
-
1
;
}
else
{
optionsContainer
.
removeChild
(
newWord
)
selectedContainer
.
addChild
(
newWord
)
newWord
.
myData
.
selected
=
true
;
newWord
.
myData
.
currentIndex
=
this
.
currentInputIndex
++
;
}
})
});
cc
.
tween
(
this
.
node
).
to
(
0.1
,
{
opacity
:
255
}).
call
(()
=>
{
}).
start
();
},
hide
()
{
this
.
node
.
opacity
=
255
;
cc
.
tween
(
this
.
node
).
to
(
0.1
,
{
opacity
:
0
}).
call
(()
=>
{
this
.
node
.
x
=
5000
;
this
.
node
.
active
=
false
;
}).
start
();
}
// update (dt) {},
});
assets/DG_FAF/prefabs/SortWords/SortWords_DG_FAF.js.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "1.0.8",
"uuid": "8990719f-ca53-4c90-ba7b-eeecc7b16a85",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/textures.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "1.1.2",
"uuid": "45b9b2fc-e28e-4620-a813-94820f1317cb",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/textures/icon_input_ok.png
0 → 100644
View file @
1fab9d5d
3.3 KB
assets/DG_FAF/prefabs/SortWords/textures/icon_input_ok.png.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "2.3.5",
"uuid": "1b41aab3-f2ca-48cb-a597-17bce5707713",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"platformSettings": {},
"subMetas": {
"icon_input_ok": {
"ver": "1.0.4",
"uuid": "c3616ea2-7570-41eb-9505-2b0478de27d4",
"rawTextureUuid": "1b41aab3-f2ca-48cb-a597-17bce5707713",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 3,
"trimY": 3,
"width": 115,
"height": 115,
"rawWidth": 120,
"rawHeight": 120,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/textures/icon_input_return.png
0 → 100644
View file @
1fab9d5d
3.51 KB
assets/DG_FAF/prefabs/SortWords/textures/icon_input_return.png.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "2.3.5",
"uuid": "91d71f77-d7a4-4a2d-8acf-335b27c7c50d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"platformSettings": {},
"subMetas": {
"icon_input_return": {
"ver": "1.0.4",
"uuid": "d9f5a0ac-32d2-4656-9f94-7d6d8cd0ab0e",
"rawTextureUuid": "91d71f77-d7a4-4a2d-8acf-335b27c7c50d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 3,
"width": 114,
"height": 115,
"rawWidth": 120,
"rawHeight": 120,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/DG_FAF/prefabs/SortWords/textures/mask_bg.png
0 → 100644
View file @
1fab9d5d
1.12 KB
assets/DG_FAF/prefabs/SortWords/textures/mask_bg.png.meta
0 → 100644
View file @
1fab9d5d
{
"ver": "2.3.5",
"uuid": "50fccd09-97c0-44fa-8139-44e924feda54",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 3840,
"height": 2160,
"platformSettings": {},
"subMetas": {
"mask_bg": {
"ver": "1.0.4",
"uuid": "cda8c593-abed-4137-af06-fe4e79a2fdf6",
"rawTextureUuid": "50fccd09-97c0-44fa-8139-44e924feda54",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 3840,
"height": 2160,
"rawWidth": 3840,
"rawHeight": 2160,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/DG_FAF/scene/DG_FAF.fire
View file @
1fab9d5d
This diff is collapsed.
Click to expand it.
assets/DG_FAF/scene/DG_FAF.ts
View file @
1fab9d5d
...
@@ -31,6 +31,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -31,6 +31,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
({
type
:
cc
.
Node
,
displayName
:
"
键盘
"
})
@
property
({
type
:
cc
.
Node
,
displayName
:
"
键盘
"
})
keyboard
:
cc
.
Node
=
null
;
keyboard
:
cc
.
Node
=
null
;
@
property
({
type
:
cc
.
Node
,
displayName
:
"
文字排序
"
})
sortWords
:
cc
.
Node
=
null
;
@
property
({
type
:
cc
.
Node
,
displayName
:
"
选择窗
"
})
@
property
({
type
:
cc
.
Node
,
displayName
:
"
选择窗
"
})
selectModal
:
cc
.
Node
=
null
;
selectModal
:
cc
.
Node
=
null
;
...
@@ -61,6 +64,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -61,6 +64,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initScorePanel
();
this
.
initScorePanel
();
this
.
initActionButton
();
this
.
initActionButton
();
this
.
initScoreShow
();
this
.
initScoreShow
();
setTimeout
(()
=>
{
this
.
sortWords
.
emit
(
"
show
"
,
[
{
word
:
"
Fine
"
},
{
word
:
"
thank
"
},
{
word
:
"
you
"
}
])
},
1000
);
}
}
// 初始化屏幕储存
// 初始化屏幕储存
...
@@ -98,6 +107,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -98,6 +107,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
currentInputTarget
=
null
;
currentInputTarget
=
null
;
onSelectedCallback
=
null
;
onSelectedCallback
=
null
;
onKeyboardEnterCallback
=
null
;
onKeyboardEnterCallback
=
null
;
onSortWordsEndCallback
=
null
;
initEventListener
()
{
initEventListener
()
{
// 注册键盘输入确定时间
// 注册键盘输入确定时间
this
.
keyboard
.
on
(
"
onEnter
"
,
(
text
)
=>
{
this
.
keyboard
.
on
(
"
onEnter
"
,
(
text
)
=>
{
...
@@ -120,6 +130,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -120,6 +130,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
currentInputTarget
=
null
;
this
.
currentInputTarget
=
null
;
}
}
})
})
this
.
sortWords
.
on
(
"
onEnter
"
,
(
e
)
=>
{
this
.
onSortWordsEndCallback
&&
this
.
onSortWordsEndCallback
(
this
.
currentInputTarget
,
e
)
if
(
this
.
currentInputTarget
)
{
this
.
currentInputTarget
=
null
;
}
})
this
.
sortWords
.
on
(
"
onCancel
"
,
(
e
)
=>
{
this
.
onSortWordsEndCallback
&&
this
.
onSortWordsEndCallback
(
this
.
currentInputTarget
,
e
)
if
(
this
.
currentInputTarget
)
{
this
.
currentInputTarget
=
null
;
}
})
}
}
// 初始化头部和底部图片
// 初始化头部和底部图片
...
...
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