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
09c0d0e2
Commit
09c0d0e2
authored
Apr 17, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加部分注释
parent
a89dec7a
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
49 additions
and
25 deletions
+49
-25
BounceZoom.ts
src/animation/BounceZoom.ts
+2
-1
Fade.ts
src/animation/Fade.ts
+2
-1
Rotation.ts
src/animation/Rotation.ts
+2
-1
RoundLoop.ts
src/animation/RoundLoop.ts
+1
-1
Swing.ts
src/animation/Swing.ts
+1
-1
Wave.ts
src/animation/Wave.ts
+2
-1
ZoomLoop.ts
src/animation/ZoomLoop.ts
+1
-1
InteractComponent.ts
src/base/InteractComponent.ts
+4
-5
ScillaComponent.ts
src/base/ScillaComponent.ts
+12
-0
Transform.ts
src/base/Transform.ts
+6
-4
ApiComponent.ts
src/net/ApiComponent.ts
+2
-1
CameraController.ts
src/other/CameraController.ts
+2
-1
ContentSizeFitter.ts
src/other/ContentSizeFitter.ts
+2
-1
FullStageSize.ts
src/other/FullStageSize.ts
+2
-1
RelativeLayout.ts
src/other/RelativeLayout.ts
+2
-1
Renderer.ts
src/renderer/Renderer.ts
+4
-3
ProgressBar.ts
src/ui/ProgressBar.ts
+2
-1
No files found.
src/animation/BounceZoom.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,8 @@
* 弹动缩放
*/
import
{
ScillaComponent
,
createTween
,
Tween
,
Vector2D
,
createVector2D
}
from
"scilla"
;
import
{
createTween
,
Tween
,
Vector2D
,
createVector2D
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
const
originScale
:
Vector2D
=
createVector2D
(
1
,
1
);
...
...
src/animation/Fade.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,8 @@
* 渐变组件
*/
import
{
math
,
ScillaComponent
}
from
"scilla"
;
import
{
math
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
export
default
class
Fade
extends
ScillaComponent
{
fromAlpha
:
number
=
0
;
...
...
src/animation/Rotation.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,8 @@
* 自转组件
*/
import
{
createTween
,
ScillaComponent
,
ScillaEvent
,
Tween
}
from
"scilla"
;
import
{
createTween
,
ScillaEvent
,
Tween
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
export
default
class
Rotation
extends
ScillaComponent
{
duration
:
number
=
10000
;
...
...
src/animation/RoundLoop.ts
View file @
09c0d0e2
/**
* Created by rockyl on 2018/11/5.
*/
import
{
ScillaComponent
}
from
"scilla
"
;
import
ScillaComponent
from
"../base/ScillaComponent
"
;
export
default
class
RoundLoop
extends
ScillaComponent
{
transform
;
...
...
src/animation/Swing.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,7 @@
* 摇摆组件
*/
import
{
ScillaComponent
}
from
"scilla
"
;
import
ScillaComponent
from
"../base/ScillaComponent
"
;
export
default
class
Swing
extends
ScillaComponent
{
duration
:
number
=
10000
;
...
...
src/animation/Wave.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,8 @@
* 波动组件
*/
import
{
ScillaComponent
,
raw
,
ScillaEvent
}
from
"scilla"
;
import
{
raw
,
ScillaEvent
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
const
PI2
=
Math
.
PI
*
2
;
...
...
src/animation/ZoomLoop.ts
View file @
09c0d0e2
...
...
@@ -2,7 +2,7 @@
* Created by rockyl on 2018/11/5.
*/
import
{
ScillaComponent
}
from
"scilla
"
;
import
ScillaComponent
from
"../base/ScillaComponent
"
;
export
default
class
ZoomLoop
extends
ScillaComponent
{
...
...
src/base/InteractComponent.ts
View file @
09c0d0e2
...
...
@@ -2,8 +2,9 @@
* Created by rockyl on 2018/11/7.
*/
import
{
Matrix
,
ScillaComponent
,
decorators
}
from
"scilla"
;
import
{
Matrix
,
decorators
}
from
"scilla"
;
import
Renderer
from
"../renderer/Renderer"
;
import
ScillaComponent
from
"./ScillaComponent"
;
const
{
dirtyFieldTrigger
}
=
decorators
;
...
...
@@ -127,13 +128,11 @@ export default class InteractComponent extends ScillaComponent {
const
renderers
=
this
.
entity
.
getComponents
(
Renderer
);
for
(
let
renderer
of
renderers
)
{
if
(
renderer
.
hitTest
(
this
.
localPos
.
x
,
this
.
localPos
.
y
))
{
if
(
renderer
.
isUsedToMask
)
{
continue
}
else
{
if
(
!
renderer
[
'isUsedToMask'
])
{
result
=
true
;
break
}
}
else
if
(
renderer
.
isUsedToMask
)
{
}
else
if
(
renderer
[
'isUsedToMask'
]
)
{
return
false
}
}
...
...
src/base/ScillaComponent.ts
0 → 100644
View file @
09c0d0e2
/**
* Created by rockyl on 2019-04-17.
*/
import
{
Component
}
from
'scilla'
import
Transform
from
"./Transform"
;
export
default
class
ScillaComponent
extends
Component
{
get
transform
():
Transform
{
return
this
.
entity
.
getComponentByName
(
'components/base/Transform'
);
}
}
src/base/Transform.ts
View file @
09c0d0e2
...
...
@@ -2,8 +2,9 @@
* Created by rockyl on 2018/11/5.
*/
import
{
ScillaComponent
,
Vector2D
,
Matrix
,
decorators
}
from
"scilla"
;
import
{
Vector2D
,
Matrix
,
decorators
}
from
"scilla"
;
import
Renderer
from
"../renderer/Renderer"
;
import
ScillaComponent
from
"./ScillaComponent"
;
const
{
dirtyFieldDetector
,
dirtyFieldTrigger
}
=
decorators
;
...
...
@@ -206,7 +207,7 @@ export default class Transform extends ScillaComponent {
_globalMatrix
.
copyFrom
(
_localMatrix
);
if
(
entity
.
parent
)
{
const
parentTransform
:
Transform
=
entity
.
parent
.
getComponent
(
Transform
);
const
parentTransform
:
Transform
=
<
Transform
>
entity
.
parent
.
getComponent
(
Transform
);
if
(
parentTransform
)
{
this
.
_renderAlpha
=
parentTransform
.
_renderAlpha
*
this
.
alpha
;
_globalMatrix
.
concat
(
parentTransform
.
getMatrix
(
true
,
false
));
...
...
@@ -217,9 +218,10 @@ export default class Transform extends ScillaComponent {
this
.
_renderAlpha
=
this
.
alpha
;
}
_globalPivotMatrix
.
copyFrom
(
_globalMatrix
);
const
{
a
,
d
}
=
_globalMatrix
;
_globalPivotMatrix
.
translate
(
-
(
px
-
0.5
)
*
width
,
-
(
py
-
0.5
)
*
height
,
-
(
px
-
0.5
)
*
width
*
a
,
-
(
py
-
0.5
)
*
height
*
d
,
);
}
...
...
src/net/ApiComponent.ts
View file @
09c0d0e2
...
...
@@ -4,7 +4,8 @@
* Api接口组件基类
*/
import
{
ScillaComponent
,
ScillaEvent
}
from
"scilla"
;
import
{
ScillaEvent
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
export
default
class
ApiComponent
extends
ScillaComponent
{
onResponse
:
ScillaEvent
=
new
ScillaEvent
();
...
...
src/other/CameraController.ts
View file @
09c0d0e2
...
...
@@ -3,8 +3,9 @@
*
*/
import
{
Entity
,
ScillaComponent
,
createVector2D
,
Vector2D
,
math
,
getRenderContext
}
from
"scilla"
;
import
{
Entity
,
createVector2D
,
Vector2D
,
math
,
getRenderContext
}
from
"scilla"
;
import
Transform
from
"../base/Transform"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
/**
* 相机控制组件
...
...
src/other/ContentSizeFitter.ts
View file @
09c0d0e2
...
...
@@ -4,8 +4,9 @@
* 内容组件尺寸自适应组件
*/
import
{
S
cillaComponent
,
S
ize
}
from
"scilla"
;
import
{
Size
}
from
"scilla"
;
import
Transform
from
"../base/Transform"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
export
default
class
ContentSizeFitter
extends
ScillaComponent
{
private
_measureSize
:
Size
=
new
Size
();
...
...
src/other/FullStageSize.ts
View file @
09c0d0e2
...
...
@@ -3,7 +3,8 @@
*
*/
import
{
getRenderContext
,
ScillaComponent
,
}
from
"scilla"
;
import
{
getRenderContext
,
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
/**
* 全舞台尺寸组件
...
...
src/other/RelativeLayout.ts
View file @
09c0d0e2
...
...
@@ -3,9 +3,10 @@
*
*/
import
{
ScillaComponent
}
from
"scilla"
;
import
Renderer
from
"../renderer/Renderer"
;
import
Transform
from
"../base/Transform"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
/**
* 相对布局组件
...
...
src/renderer/Renderer.ts
View file @
09c0d0e2
...
...
@@ -2,7 +2,8 @@
* Created by rockyl on 2018/11/6.
*/
import
{
createCanvas
,
getRenderContext
,
ScillaComponent
,
Bounds
,
Vector2D
,
math
,
decorators
,
EngineConfig
}
from
"scilla"
;
import
{
createCanvas
,
getRenderContext
,
Bounds
,
Vector2D
,
math
,
decorators
,
EngineConfig
}
from
"scilla"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
const
{
dirtyFieldTrigger
}
=
decorators
;
...
...
@@ -36,7 +37,7 @@ export default class Renderer extends ScillaComponent {
/**
* 边界
*/
protected
bounds
=
new
Bounds
();
bounds
=
new
Bounds
();
protected
cacheCanvas
=
null
;
...
...
@@ -243,7 +244,7 @@ export default class Renderer extends ScillaComponent {
/**
* 测量边界
*/
protected
measureBounds
()
{
measureBounds
()
{
const
{
anchor
:
{
x
,
y
},
bounds
,
bounds
:
{
width
,
height
}}
=
this
;
const
anchorOffsetX
=
this
.
_anchorOffset
.
x
=
width
*
x
;
...
...
src/ui/ProgressBar.ts
View file @
09c0d0e2
...
...
@@ -4,10 +4,11 @@
* 进度条
*/
import
{
Entity
,
ScillaComponent
,
decorators
,
createTween
,
ease
}
from
"scilla"
;
import
{
Entity
,
decorators
,
createTween
,
ease
}
from
"scilla"
;
import
RectRenderer
from
"../renderer/RectRenderer"
;
import
Transform
from
"../base/Transform"
;
import
TextRenderer
from
"../renderer/TextRenderer"
;
import
ScillaComponent
from
"../base/ScillaComponent"
;
const
{
dirtyFieldTrigger
}
=
decorators
;
...
...
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