Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM-15
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
JM-15
Commits
4fc0860e
Commit
4fc0860e
authored
Oct 09, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 滚动条 提交按钮出现
parent
cb63e0a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
19 deletions
+46
-19
Unit.ts
src/app/play/Unit.ts
+9
-9
play.component.ts
src/app/play/play.component.ts
+37
-10
No files found.
src/app/play/Unit.ts
View file @
4fc0860e
...
@@ -2224,15 +2224,15 @@ export class ScrollView extends MySprite {
...
@@ -2224,15 +2224,15 @@ export class ScrollView extends MySprite {
const
boxEdgeY
=
curChild
.
y
+
(
1
-
curChild
.
anchorY
)
*
curChild
.
height
*
curChild
.
scaleY
;
const
boxEdgeY
=
curChild
.
y
+
(
1
-
curChild
.
anchorY
)
*
curChild
.
height
*
curChild
.
scaleY
;
if
(
!
children
[
i
].
colorRect
)
{
if
(
!
children
[
i
].
colorRect
)
{
const
rect
=
new
ShapeRectNew
();
//
const rect = new ShapeRectNew();
rect
.
fillColor
=
'
#ff0000
'
;
//
rect.fillColor = '#ff0000';
rect
.
setSize
(
curChild
.
width
*
curChild
.
scaleX
,
curChild
.
height
*
curChild
.
scaleY
,
0
);
//
rect.setSize(curChild.width * curChild.scaleX, curChild.height * curChild.scaleY, 0);
rect
.
alpha
=
0.3
;
//
rect.alpha = 0.3;
rect
.
x
=
boxEdgeX
-
curChild
.
width
*
curChild
.
scaleX
;
//
rect.x = boxEdgeX - curChild.width * curChild.scaleX;
rect
.
y
=
boxEdgeY
-
curChild
.
height
*
curChild
.
scaleY
;
//
rect.y = boxEdgeY - curChild.height * curChild.scaleY;
this
.
content
.
addChild
(
rect
);
//
this.content.addChild(rect);
children
[
i
].
colorRect
=
rect
;
//
children[i].colorRect = rect;
}
}
// console.log('boxEdgeY: ', boxEdgeY);
// console.log('boxEdgeY: ', boxEdgeY);
...
...
src/app/play/play.component.ts
View file @
4fc0860e
...
@@ -667,8 +667,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -667,8 +667,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initMaskPic
();
this
.
initMaskPic
();
this
.
relink
();
this
.
relink
();
this
.
checkShowSubmit
();
//
this.gameStart();
this
.
gameStart
();
// this.initBtn();
// this.initBtn();
...
@@ -689,6 +690,19 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -689,6 +690,19 @@ export class PlayComponent implements OnInit, OnDestroy {
// // this.testInput()
// // this.testInput()
}
}
showSubmit
()
{
this
.
submitBtn
.
visible
=
true
;
this
.
submitBtn
.
shadowSpr
.
visible
=
true
;
}
hideSubmit
()
{
this
.
submitBtn
.
visible
=
false
;
this
.
submitBtn
.
shadowSpr
.
visible
=
false
;
}
testInput
()
{
testInput
()
{
const
tmpRect
=
this
.
sentenceEmptyArr
[
0
].
getBoundingBox
();
const
tmpRect
=
this
.
sentenceEmptyArr
[
0
].
getBoundingBox
();
...
@@ -1633,8 +1647,6 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1633,8 +1647,6 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
!
this
.
canTouch
)
{
if
(
!
this
.
canTouch
)
{
return
;
return
;
}
}
...
@@ -1770,6 +1782,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1770,6 +1782,8 @@ export class PlayComponent implements OnInit, OnDestroy {
mapUp
(
event
)
{
mapUp
(
event
)
{
this
.
checkShowSubmit
();
if
(
this
.
resultPanel
)
{
if
(
this
.
resultPanel
)
{
this
.
resultSv
.
onTouchEnd
(
this
.
mx
,
this
.
my
);
this
.
resultSv
.
onTouchEnd
(
this
.
mx
,
this
.
my
);
return
;
return
;
...
@@ -2281,15 +2295,28 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -2281,15 +2295,28 @@ export class PlayComponent implements OnInit, OnDestroy {
checkShowSubmit
()
{
checkShowSubmit
()
{
for
(
let
i
=
0
;
i
<
this
.
btnArr
.
length
;
i
++
)
{
if
(
this
.
btnArr
[
i
].
visible
)
{
const
arr
=
this
.
hotZoneArr
;
return
;
console
.
log
(
'
arr:
'
,
arr
);
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
console
.
log
(
'
i:
'
,
i
);
console
.
log
(
'
arr[i]:
'
,
arr
[
i
]);
if
(
arr
[
i
].
data
.
gIdx
==
'
0
'
)
{
if
(
!
arr
[
i
].
label
||
!
arr
[
i
].
label
.
text
)
{
this
.
hideSubmit
();
return
;
}
}
}
}
this
.
submitBtn
.
visible
=
true
;
this
.
submitBtn
.
shadowSpr
.
visible
=
true
;
this
.
submitBtn
.
offBtn
.
visible
=
false
;
}
this
.
showSubmit
();
}
}
...
...
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