Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU-11
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
PU-11
Commits
4db2fcb4
Commit
4db2fcb4
authored
Jun 22, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 标题适配
parent
a40a509c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
Stage.ts
src/app/play/Stage.ts
+5
-4
play.component.ts
src/app/play/play.component.ts
+2
-0
No files found.
src/app/play/Stage.ts
View file @
4db2fcb4
...
@@ -223,6 +223,7 @@ export class Stage extends Item {
...
@@ -223,6 +223,7 @@ export class Stage extends Item {
this
.
titleBg
.
removeChild
(
this
.
curTitleLabel
);
this
.
titleBg
.
removeChild
(
this
.
curTitleLabel
);
}
}
console
.
log
(
'
this._scaleX =
'
+
this
.
_scaleX
);
const
title
=
new
RichText
();
const
title
=
new
RichText
();
title
.
scaleX
=
this
.
_scaleX
;
title
.
scaleX
=
this
.
_scaleX
;
title
.
scaleY
=
this
.
_scaleY
;
title
.
scaleY
=
this
.
_scaleY
;
...
@@ -238,8 +239,8 @@ export class Stage extends Item {
...
@@ -238,8 +239,8 @@ export class Stage extends Item {
title
.
y
=
this
.
titleBg
.
height
/
2
;
title
.
y
=
this
.
titleBg
.
height
/
2
;
this
.
titleBg
.
addChild
(
title
);
this
.
titleBg
.
addChild
(
title
);
title
.
scaleY
=
Math
.
min
(
1
,
210
/
title
.
height
);
// title.scaleX = Math.min(this.scaleX, 500 / title.width
);
title
.
scaleX
=
Math
.
min
(
1
,
21
0
/
title
.
height
);
// title.scaleY = Math.min(this.scaleY, 15
0 / title.height);
this
.
curTitleLabel
=
title
;
this
.
curTitleLabel
=
title
;
}
}
...
@@ -286,14 +287,14 @@ export class Mission extends Item {
...
@@ -286,14 +287,14 @@ export class Mission extends Item {
const
missionPic
=
new
MySprite
();
const
missionPic
=
new
MySprite
();
missionPic
.
init
(
this
.
images
.
get
(
theme
+
"
e-mission
"
));
missionPic
.
init
(
this
.
images
.
get
(
theme
+
"
e-mission
"
));
missionPic
.
x
=
missionPic
.
width
/
2
;
missionPic
.
x
=
missionPic
.
width
/
2
-
20
;
missionPic
.
y
=
this
.
height
/
2
;
missionPic
.
y
=
this
.
height
/
2
;
bg
.
addChild
(
missionPic
,
2
);
bg
.
addChild
(
missionPic
,
2
);
const
stageBgPic
=
new
MySprite
();
const
stageBgPic
=
new
MySprite
();
stageBgPic
.
init
(
this
.
images
.
get
(
theme
+
"
stage_bg
"
));
stageBgPic
.
init
(
this
.
images
.
get
(
theme
+
"
stage_bg
"
));
stageBgPic
.
alpha
=
0
;
stageBgPic
.
alpha
=
0
;
stageBgPic
.
x
=
missionPic
.
width
+
stageBgPic
.
width
/
2
-
5
0
;
stageBgPic
.
x
=
missionPic
.
width
+
stageBgPic
.
width
/
2
-
7
0
;
stageBgPic
.
y
=
this
.
height
/
2
;
stageBgPic
.
y
=
this
.
height
/
2
;
this
.
stageBgPic
=
stageBgPic
;
this
.
stageBgPic
=
stageBgPic
;
bg
.
addChild
(
stageBgPic
,
1
);
bg
.
addChild
(
stageBgPic
,
1
);
...
...
src/app/play/play.component.ts
View file @
4db2fcb4
...
@@ -175,6 +175,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -175,6 +175,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
winResizeEventStream
this
.
winResizeEventStream
.
pipe
(
debounceTime
(
500
))
.
pipe
(
debounceTime
(
500
))
.
subscribe
(
data
=>
{
.
subscribe
(
data
=>
{
console
.
log
(
'
汪汪汪
'
)
this
.
renderAfterResize
();
this
.
renderAfterResize
();
});
});
...
@@ -481,6 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -481,6 +482,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
s
=
Math
.
min
(
sx
,
sy
);
const
s
=
Math
.
min
(
sx
,
sy
);
this
.
mapScale
=
s
;
this
.
mapScale
=
s
;
console
.
log
(
'
this.mapScale =
'
+
this
.
mapScale
);
this
.
renderArr
=
[];
this
.
renderArr
=
[];
...
...
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