Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MRBR02
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
MRBR02
Commits
b783042c
Commit
b783042c
authored
May 04, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点击适配,重复点击
parent
3209a81b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
mouse_end.js
assets/MRBR02/mouse/end/mouse_end.js
+4
-1
MRBR02.ts
assets/MRBR02/scene/MRBR02.ts
+23
-11
No files found.
assets/MRBR02/mouse/end/mouse_end.js
View file @
b783042c
...
@@ -41,8 +41,11 @@ cc.Class({
...
@@ -41,8 +41,11 @@ cc.Class({
let
db
=
this
.
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
let
db
=
this
.
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
db
.
playAnimation
(
'
normal
'
,
1
);
db
.
playAnimation
(
'
normal
'
,
1
);
db
.
addEventListener
(
"
loopComplete
"
,
()
=>
{
db
.
addEventListener
(
"
loopComplete
"
,
()
=>
{
resolve
(
''
);
//
resolve('');
})
})
setTimeout
(()
=>
{
resolve
(
''
);
},
2000
);
});
});
}
}
// update (dt) {},
// update (dt) {},
...
...
assets/MRBR02/scene/MRBR02.ts
View file @
b783042c
...
@@ -195,30 +195,40 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -195,30 +195,40 @@ export default class SceneComponent extends MyCocosSceneComponent {
item
.
data
=
data
item
.
data
=
data
item
.
active
=
true
;
item
.
active
=
true
;
}
}
private
setTouchPos
(
e
)
{
let
location
=
e
.
getLocation
();
let
size
=
cc
.
view
.
getCanvasSize
();
let
scale
=
(
size
.
width
/
size
.
height
)
/
(
1280
/
720
);
if
(
scale
>
1
)
{
let
width
=
size
.
width
/
size
.
height
*
720
;
let
pos
=
location
.
sub
(
cc
.
v2
(
width
/
2
,
720
/
2
))
e
.
target
.
setPosition
(
pos
)
}
else
{
let
height
=
size
.
height
/
size
.
width
*
1280
;
let
pos
=
location
.
sub
(
cc
.
v2
(
1280
/
2
,
height
/
2
))
e
.
target
.
setPosition
(
pos
)
}
}
onItemTouchStart
(
e
)
{
onItemTouchStart
(
e
)
{
let
target
:
cc
.
Node
=
e
.
target
;
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
let
data
=
target
.
data
;
let
location
=
e
.
getLocation
();
if
(
data
.
isChecked
)
return
;
let
size
=
cc
.
view
.
getCanvasSize
();
this
.
setTouchPos
(
e
);
let
height
=
size
.
height
/
size
.
width
*
1280
;
let
pos
=
location
.
sub
(
cc
.
v2
(
1280
/
2
,
height
/
2
))
e
.
target
.
setPosition
(
pos
)
}
}
onItemTouchMove
(
e
)
{
onItemTouchMove
(
e
)
{
let
target
:
cc
.
Node
=
e
.
target
;
let
target
:
cc
.
Node
=
e
.
target
;
let
location
=
e
.
getLocation
();
let
data
=
target
.
data
;
let
size
=
cc
.
view
.
getCanvasSize
();
if
(
data
.
isChecked
)
return
;
let
height
=
size
.
height
/
size
.
width
*
1280
;
this
.
setTouchPos
(
e
);
let
pos
=
location
.
sub
(
cc
.
v2
(
1280
/
2
,
height
/
2
))
e
.
target
.
setPosition
(
pos
)
}
}
onItemTouchEnd
(
e
)
{
onItemTouchEnd
(
e
)
{
//
//
let
target
:
cc
.
Node
=
e
.
target
;
let
target
:
cc
.
Node
=
e
.
target
;
let
data
=
target
.
data
;
let
data
=
target
.
data
;
if
(
data
.
isChecked
)
return
;
let
rect1
=
cc
.
rect
(
target
.
x
,
target
.
y
,
target
.
width
*
target
.
scale
,
target
.
height
*
target
.
scale
);
let
rect1
=
cc
.
rect
(
target
.
x
,
target
.
y
,
target
.
width
*
target
.
scale
,
target
.
height
*
target
.
scale
);
let
itemBg
=
this
.
cardBgs
.
find
(
bg
=>
{
let
itemBg
=
this
.
cardBgs
.
find
(
bg
=>
{
return
rect1
.
intersects
(
cc
.
rect
(
bg
.
x
,
bg
.
y
,
bg
.
width
*
bg
.
scale
,
bg
.
height
*
bg
.
scale
));
return
rect1
.
intersects
(
cc
.
rect
(
bg
.
x
,
bg
.
y
,
bg
.
width
*
bg
.
scale
,
bg
.
height
*
bg
.
scale
/
2
));
})
})
if
(
!
itemBg
||
this
.
currentCards
[
itemBg
.
data
.
count
])
{
if
(
!
itemBg
||
this
.
currentCards
[
itemBg
.
data
.
count
])
{
//回退
//回退
...
@@ -237,6 +247,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -237,6 +247,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
pos
=
this
.
getBgPostionById
(
itemBg
.
data
.
count
);
let
pos
=
this
.
getBgPostionById
(
itemBg
.
data
.
count
);
target
.
setPosition
(
pos
);
target
.
setPosition
(
pos
);
this
.
currentCards
[
itemBg
.
data
.
count
]
=
target
;
this
.
currentCards
[
itemBg
.
data
.
count
]
=
target
;
data
.
isChecked
=
true
;
this
.
playLocalAudio
(
"
right
"
);
this
.
playLocalAudio
(
"
right
"
);
let
ani_flower
=
cc
.
instantiate
(
this
.
ani_flower
);
let
ani_flower
=
cc
.
instantiate
(
this
.
ani_flower
);
...
@@ -274,6 +285,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -274,6 +285,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
playLocalAudio
(
"
error
"
);
this
.
playLocalAudio
(
"
error
"
);
this
.
currentCards
.
forEach
(
card
=>
{
this
.
currentCards
.
forEach
(
card
=>
{
cc
.
tween
(
card
).
to
(
0.3
,
{
x
:
this
.
getPostionById
(
card
.
data
.
count
).
x
,
y
:
this
.
getPostionById
(
card
.
data
.
count
).
y
}).
start
();
cc
.
tween
(
card
).
to
(
0.3
,
{
x
:
this
.
getPostionById
(
card
.
data
.
count
).
x
,
y
:
this
.
getPostionById
(
card
.
data
.
count
).
y
}).
start
();
card
.
data
.
isChecked
=
false
;
})
})
this
.
currentCards
.
length
=
0
;
this
.
currentCards
.
length
=
0
;
return
;
return
;
...
...
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