Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ET_07
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
ET_07
Commits
f99af5c5
Commit
f99af5c5
authored
Feb 25, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 屏幕适配
parent
9adff6a1
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
222 additions
and
233 deletions
+222
-233
ET_07.fire
play/assets/ET_07/scene/ET_07.fire
+201
-231
ET_07.js
play/assets/ET_07/scene/ET_07.js
+21
-2
No files found.
play/assets/ET_07/scene/ET_07.fire
View file @
f99af5c5
This diff is collapsed.
Click to expand it.
play/assets/ET_07/scene/ET_07.js
View file @
f99af5c5
...
@@ -84,7 +84,6 @@ cc.Class({
...
@@ -84,7 +84,6 @@ cc.Class({
this
.
initView
();
this
.
initView
();
this
.
initListener
();
this
.
initListener
();
this
.
showLetterAnimation
();
this
.
showLetterAnimation
();
this
.
startEditMode
();
this
.
startEditMode
();
},
},
...
@@ -109,7 +108,7 @@ cc.Class({
...
@@ -109,7 +108,7 @@ cc.Class({
letter
:
null
,
letter
:
null
,
initView
()
{
initView
()
{
// this.debugMode = true;
// this.debugMode = true;
this
.
setLetter
(
this
.
data
.
letter
);
this
.
setLetter
(
this
.
data
.
letter
);
},
},
setLetter
(
letter
)
{
setLetter
(
letter
)
{
...
@@ -118,6 +117,26 @@ cc.Class({
...
@@ -118,6 +117,26 @@ cc.Class({
this
.
updateLetterBtnLabel
();
this
.
updateLetterBtnLabel
();
this
.
addDrawLetter
(
this
.
letter
);
this
.
addDrawLetter
(
this
.
letter
);
cc
.
find
(
'
Canvas
'
).
on
(
'
size-changed
'
,
()
=>
{
this
.
onSizeChanged
();
});
this
.
onSizeChanged
();
},
onSizeChanged
()
{
this
.
node
.
getComponent
(
cc
.
Widget
).
updateAlignment
();
const
currentSize
=
{
width
:
this
.
node
.
width
,
height
:
this
.
node
.
height
};
console
.
log
(
'
currentSize =
'
+
JSON
.
stringify
(
currentSize
));
const
frameSize
=
cc
.
view
.
getFrameSize
();
console
.
log
(
'
frameSize =
'
+
JSON
.
stringify
(
frameSize
));
const
designSize
=
cc
.
view
.
getDesignResolutionSize
();
console
.
log
(
'
designSize =
'
+
JSON
.
stringify
(
designSize
));
const
letterBg
=
cc
.
find
(
'
Canvas/bg/Img_letter_bg
'
);
const
scale
=
(
designSize
.
width
/
designSize
.
height
)
/
(
frameSize
.
width
/
frameSize
.
height
);
letterBg
.
scale
=
Math
.
min
(
scale
,
1
);
},
},
updateLetterBtnLabel
()
{
updateLetterBtnLabel
()
{
...
...
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