Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy14_pipei
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
hy14_pipei
Commits
fef972aa
Commit
fef972aa
authored
Sep 17, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5493ee25
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
5005 additions
and
889 deletions
+5005
-889
Game_hy14_pipei.ts
assets/hy14_pipei/scene/Game_hy14_pipei.ts
+2
-0
hy14_pipei.fire
assets/hy14_pipei/scene/hy14_pipei.fire
+4871
-862
hy14_pipei.ts
assets/hy14_pipei/scene/hy14_pipei.ts
+56
-24
pg_hy14_pipei.ts
assets/hy14_pipei/scene/pg_hy14_pipei.ts
+3
-3
stone1.png
assets/hy14_pipei/textures/stone1.png
+0
-0
stone1.png.meta
assets/hy14_pipei/textures/stone1.png.meta
+36
-0
stone2.png
assets/hy14_pipei/textures/stone2.png
+0
-0
stone2.png.meta
assets/hy14_pipei/textures/stone2.png.meta
+36
-0
form.component.ts
form/src/app/form/form.component.ts
+1
-0
No files found.
assets/hy14_pipei/scene/Game_hy14_pipei.ts
View file @
fef972aa
...
...
@@ -155,6 +155,8 @@ export default class Game {
text
:
item
.
text
,
width
:
item
.
rect
.
width
*
scX
,
height
:
item
.
rect
.
height
*
scY
,
index
:
item
.
index
,
pic_url
:
item
.
pic_url
,
}
})
this
.
pointsArr
=
arr
.
concat
();
...
...
assets/hy14_pipei/scene/hy14_pipei.fire
View file @
fef972aa
This diff is collapsed.
Click to expand it.
assets/hy14_pipei/scene/hy14_pipei.ts
View file @
fef972aa
...
...
@@ -171,39 +171,65 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
this
.
layout_op
.
removeAllChildren
();
let
op
=
Game
.
getIns
().
opdata
;
let
item
=
cc
.
instantiate
(
this
.
item_op
);
let
item
=
this
.
item_op
;
// let item = cc.instantiate(this.item_op);
item
.
active
=
true
;
// item.parent = this.layout_op;
op
.
forEach
((
dt
,
idx
)
=>
{
if
(
idx
%
8
==
0
)
{
item
=
cc
.
instantiate
(
this
.
item_op
);
item
.
active
=
true
;
item
.
parent
=
this
.
layout_op
;
}
let
id
=
idx
%
8
;
let
ch
=
item
.
children
[
id
];
this
.
log
(
id
)
// if (idx % 8 == 0) {
// }
// let id = idx % 8;
let
ch
=
item
.
children
[
idx
];
// this.log(id)
if
(
!
ch
)
return
;
ch
.
active
=
true
;
let
desc
=
cc
.
find
(
"
desc
"
,
ch
);
desc
.
getComponent
(
cc
.
Label
).
string
=
dt
.
text
;
desc
.
active
=
true
;
let
img
=
cc
.
find
(
"
img
"
,
ch
);
let
node
;
if
(
dt
.
pic_url
&&
dt
.
pic_url
!=
""
)
{
pg
.
view
.
setNetImg
(
img
,
dt
.
pic_url
,
{
w
:
200
,
h
:
150
});
desc
.
getComponent
(
cc
.
Label
).
string
=
""
;
img
.
active
=
true
;
desc
.
active
=
false
;
node
=
img
;
}
else
{
desc
.
getComponent
(
cc
.
Label
).
string
=
dt
.
text
;
img
.
active
=
false
;
desc
.
active
=
true
;
node
=
desc
;
}
let
data
:
any
=
{};
data
.
text
=
dt
.
text
;
data
.
audio
=
dt
.
audio_url
||
""
;
data
.
index
=
dt
.
index
;
data
.
parent
=
ch
;
data
.
x
=
desc
.
x
;
data
.
y
=
desc
.
y
;
desc
.
data
=
data
;
data
.
x
=
node
.
x
;
data
.
y
=
node
.
y
;
node
.
data
=
data
;
desc
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
desc
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
desc
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
desc
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onItemTouchEnd
,
this
);
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
onItemTouchCancel
,
this
);
ch
.
getComponent
(
cc
.
Layout
).
enabled
=
false
;
let
stone1
=
cc
.
find
(
"
stone1
"
,
ch
);
this
.
stSction
(
stone1
);
})
cc
.
find
(
"
ScrollView
"
,
this
.
node
).
getComponent
(
cc
.
ScrollView
).
enabled
=
op
.
length
>
4
;
let
size
=
cc
.
view
.
getCanvasSize
();
let
scale
=
(
size
.
width
/
size
.
height
)
/
(
1920
/
1080
);
let
oplen
=
scale
>
1.2
?
5
:
4
;
if
(
op
.
length
>
oplen
)
{
cc
.
find
(
"
ScrollView
"
,
this
.
node
).
getComponent
(
cc
.
ScrollView
).
enabled
=
false
;
this
.
layout_op
.
getComponent
(
cc
.
Layout
).
enabled
=
true
;
let
x
=
0
;
if
(
op
.
length
>
12
)
x
=
7680
;
else
if
(
op
.
length
>
8
)
x
=
5760
;
else
if
(
op
.
length
>
oplen
)
x
=
3840
;
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
10
,
{
x
:
-
x
})
.
call
(()
=>
{
item
.
x
=
-
960
*
scale
;
}))
.
start
();
}
}
private
creaetPosPic
()
{
let
pos
=
Game
.
getIns
().
pointsArr
;
...
...
@@ -216,7 +242,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// let desc = cc.find("desc", item);
// desc.getComponent(cc.Label).string = li.text;
this
.
cardBgs
.
push
(
item
);
let
data
=
{
text
:
li
.
text
}
;
let
data
=
li
;
item
.
data
=
data
;
item
.
width
=
li
.
width
;
item
.
height
=
li
.
height
;
...
...
@@ -293,13 +319,13 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// let dis = this.getDistances(target.getPosition(), bg.getPosition());
let
dis
=
this
.
getDistances
(
target
,
bg
);
// if (dis < 100 && bg.sortId == data.id) {
if
(
dis
<
100
&&
bg
.
data
.
text
==
data
.
text
)
{
if
(
dis
<
100
&&
bg
.
data
.
index
==
data
.
index
)
{
return
bg
;
}
return
null
;
})
//检测是否在区域内
if
(
!
itemBg
||
itemBg
.
data
.
text
!=
data
.
text
)
{
if
(
!
itemBg
)
{
target
.
parent
=
data
.
parent
;
target
.
setPosition
(
data
.
x
,
data
.
y
);
// this.playLocalAudio("error");
...
...
@@ -315,8 +341,14 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
let
layer_candy
=
cc
.
find
(
"
layer_candy
"
,
itemBg
);
layer_candy
.
active
=
true
;
let
desc
=
cc
.
find
(
"
desc
"
,
itemBg
);
desc
.
getComponent
(
cc
.
Label
).
string
=
data
.
text
;
if
(
itemBg
.
data
.
pic_url
&&
itemBg
.
data
.
pic_url
!=
""
)
{
let
img
=
cc
.
find
(
"
img
"
,
itemBg
);
pg
.
view
.
setNetImg
(
img
,
itemBg
.
data
.
pic_url
,
{
w
:
itemBg
.
data
.
width
,
h
:
itemBg
.
data
.
height
});
}
else
{
let
desc
=
cc
.
find
(
"
desc
"
,
itemBg
);
desc
.
getComponent
(
cc
.
Label
).
string
=
data
.
text
;
}
this
.
playLocalAudio
(
"
right
"
).
then
(
async
()
=>
{
...
...
assets/hy14_pipei/scene/pg_hy14_pipei.ts
View file @
fef972aa
...
...
@@ -258,12 +258,12 @@ let pg = {
node
.
net_url
=
res
;
if
(
!
cc
.
isValid
(
node
))
return
pg
.
logger
.
i
(
"
节点已销毁
"
);
if
(
!
node
)
return
pg
.
logger
.
w
(
"
节点已销毁
"
);
if
(
w
&&
h
&&
custom
)
{
if
(
w
&&
h
)
{
let
scaleX
=
w
/
nw
;
let
scaleY
=
h
/
nh
;
let
scale
=
scaleX
<=
scaleY
?
scaleX
:
scaleY
;
node
.
width
=
nw
*
scaleX
;
node
.
height
=
nh
*
scaleY
;
node
.
width
=
custom
?
nw
*
scaleX
:
nw
*
scale
;
node
.
height
=
custom
?
nh
*
scaleY
:
nw
*
scale
;
}
node
.
active
=
true
;
resolve
({
w
:
nw
,
h
:
nh
});
...
...
assets/hy14_pipei/textures/stone1.png
0 → 100644
View file @
fef972aa
18.2 KB
assets/hy14_pipei/textures/stone1.png.meta
0 → 100644
View file @
fef972aa
{
"ver": "2.3.5",
"uuid": "dfa36e3a-d7b9-429d-a759-7962c373a135",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 7680,
"height": 350,
"platformSettings": {},
"subMetas": {
"stone1": {
"ver": "1.0.4",
"uuid": "79b766ef-9ba2-45fb-8893-5ff148e34bcd",
"rawTextureUuid": "dfa36e3a-d7b9-429d-a759-7962c373a135",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 0,
"trimY": 1,
"width": 7680,
"height": 349,
"rawWidth": 7680,
"rawHeight": 350,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/hy14_pipei/textures/stone2.png
0 → 100644
View file @
fef972aa
74.6 KB
assets/hy14_pipei/textures/stone2.png.meta
0 → 100644
View file @
fef972aa
{
"ver": "2.3.5",
"uuid": "fa76097d-29d1-4c74-b2ff-7bfb123d650a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 7680,
"height": 350,
"platformSettings": {},
"subMetas": {
"stone2": {
"ver": "1.0.4",
"uuid": "5c1e928d-859c-44b7-aa24-d6e596582f62",
"rawTextureUuid": "fa76097d-29d1-4c74-b2ff-7bfb123d650a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 6,
"offsetY": -22,
"trimX": 19,
"trimY": 45,
"width": 7654,
"height": 304,
"rawWidth": 7680,
"rawHeight": 350,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
form/src/app/form/form.component.ts
View file @
fef972aa
...
...
@@ -42,6 +42,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
name
:
'
文本
'
,
text
:
true
,
audio
:
true
,
pic
:
true
,
// action: {
// type: 'text',
// option: [
...
...
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