Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-components
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
劳工
scilla-components
Commits
9e4545ad
Commit
9e4545ad
authored
Mar 22, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加全舞台尺寸适配组件
parent
f1502810
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
+43
-2
CameraController.ts
src/other/CameraController.ts
+0
-2
FullStageSize.ts
src/other/FullStageSize.ts
+42
-0
index.ts
src/other/index.ts
+1
-0
No files found.
src/other/CameraController.ts
View file @
9e4545ad
...
...
@@ -48,8 +48,6 @@ export default class CameraController extends ScillaComponent {
const
{
width
,
height
}
=
this
.
stageSize
;
const
{
x
,
y
}
=
this
.
viewportAnchor
;
this
.
transform
.
position
.
setXY
(
width
*
x
,
height
*
y
);
this
.
transform
.
width
=
width
;
this
.
transform
.
height
=
height
;
}
}
...
...
src/other/FullStageSize.ts
0 → 100644
View file @
9e4545ad
/**
* Created by rockyl on 2018/11/15.
*
*/
import
{
getStageSize
,
ScillaComponent
,
}
from
"scilla"
;
/**
* 全舞台尺寸组件
*/
export
default
class
FullStageSize
extends
ScillaComponent
{
once
:
boolean
=
true
;
private
stageSize
;
onCreate
()
{
super
.
onCreate
();
}
onAwake
()
{
super
.
onAwake
();
this
.
stageSize
=
getStageSize
();
this
.
execute
();
}
onUpdate
(
t
)
{
super
.
onUpdate
(
t
);
if
(
!
this
.
once
){
this
.
execute
();
}
}
execute
()
{
const
{
width
,
height
}
=
this
.
stageSize
;
this
.
transform
.
width
=
width
;
this
.
transform
.
height
=
height
;
}
}
src/other/index.ts
View file @
9e4545ad
...
...
@@ -5,3 +5,4 @@
export
{
default
as
CameraController
}
from
'./CameraController'
export
{
default
as
ContentSizeFitter
}
from
'./ContentSizeFitter'
export
{
default
as
RelativeLayout
}
from
'./RelativeLayout'
export
{
default
as
FullStageSize
}
from
'./FullStageSize'
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