Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fyge_for_tb
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
王剑峰
fyge_for_tb
Commits
9966ede6
Commit
9966ede6
authored
Jan 28, 2021
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.15
parent
f3308651
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1085 additions
and
723 deletions
+1085
-723
FYGE.d.ts
build/FYGE.d.ts
+666
-659
fyge.min.js
build/fyge.min.js
+1
-1
fyge.min.js.map
build/fyge.min.js.map
+1
-1
2d.html
examples/2d.html
+9
-0
package.json
package.json
+1
-1
record.txt
record.txt
+25
-2
const.ts
src/2d/const.ts
+8
-18
Container.ts
src/2d/display/Container.ts
+13
-13
DisplayObject.ts
src/2d/display/DisplayObject.ts
+6
-4
FloatDisplay.ts
src/2d/display/FloatDisplay.ts
+6
-6
Graphics.ts
src/2d/graphics/Graphics.ts
+1
-1
Loader.ts
src/2d/loader/Loader.ts
+3
-3
SystemRenderer.ts
src/2d/renderers/SystemRenderer.ts
+1
-1
BitmapText.ts
src/2d/text/BitmapText.ts
+1
-1
EditableText.ts
src/2d/text/EditableText.ts
+10
-2
InputText.ts
src/2d/text/InputText.ts
+312
-0
index.ts
src/2d/text/index.ts
+1
-1
FrameAni.ts
src/2d/ui/FrameAni.ts
+8
-0
Lottie.ts
src/2d/ui/Lottie.ts
+5
-5
MovieClip.ts
src/2d/ui/MovieClip.ts
+1
-1
tbminiAdapte.ts
src/2d/utils/tbminiAdapte.ts
+2
-0
Bone.ts
src/spine/Bone.ts
+2
-2
Spine.ts
src/spine/Spine.ts
+2
-1
No files found.
build/FYGE.d.ts
View file @
9966ede6
This diff is collapsed.
Click to expand it.
build/fyge.min.js
View file @
9966ede6
This diff is collapsed.
Click to expand it.
build/fyge.min.js.map
View file @
9966ede6
This diff is collapsed.
Click to expand it.
examples/2d.html
View file @
9966ede6
...
@@ -238,6 +238,15 @@
...
@@ -238,6 +238,15 @@
// s.moveTo(300, 300)
// s.moveTo(300, 300)
// s.drawRoundedRect(300, 100, 200, 100, 1111)
// s.drawRoundedRect(300, 100, 200, 100, 1111)
// s.endFill()
// s.endFill()
//画线
var
s
=
stage
.
addChild
(
new
FYGE
.
Shape
())
s
.
beginStroke
(
0
,
3
)
s
.
moveTo
(
10
,
10
);
s
.
lineTo
(
10
,
500
);
s
.
lineTo
(
200
,
500
);
s
.
lineTo
(
200
,
10
);
s
.
lineTo
(
10
,
10
);
s
.
endStroke
()
},
this
);
},
this
);
//循环
//循环
...
...
package.json
View file @
9966ede6
{
{
"name"
:
"fyge"
,
"name"
:
"fyge"
,
"version"
:
"2.0.1
4
"
,
"version"
:
"2.0.1
5
"
,
"description"
:
"canvas渲染引擎"
,
"description"
:
"canvas渲染引擎"
,
"main"
:
"./build/fyge.min.js"
,
"main"
:
"./build/fyge.min.js"
,
"types"
:
"./build/FYGE.d.ts"
,
"types"
:
"./build/FYGE.d.ts"
,
...
...
record.txt
View file @
9966ede6
...
@@ -208,7 +208,6 @@
...
@@ -208,7 +208,6 @@
utils的isWebGLSupported方法修改
utils的isWebGLSupported方法修改
utils的inputFeildIosEnable有修改,到时删掉
utils的inputFeildIosEnable有修改,到时删掉
//未发,及先
2.0.14 Stage的dpi字段改成_dpi
2.0.14 Stage的dpi字段改成_dpi
Stage记录_scaleMode和_stageCenter
Stage记录_scaleMode和_stageCenter
Stage添加_setAlign方法(原来构造方法里设定缩放和视窗,现在在构造函数和resize方法里调用),
Stage添加_setAlign方法(原来构造方法里设定缩放和视窗,现在在构造函数和resize方法里调用),
...
@@ -218,10 +217,27 @@
...
@@ -218,10 +217,27 @@
AttachmentAniTrack的setValue方法在time小于首帧时间时,对blend额外加了replace的或判断;待观察后续
AttachmentAniTrack的setValue方法在time小于首帧时间时,对blend额外加了replace的或判断;待观察后续
删除utils的inputFeildIosEnable(从没用过)
删除utils的inputFeildIosEnable(从没用过)
2.0.15 const里去掉了devicePixelRatio,SystemRenderer去掉devicePixelRatio引用
Container的children类型any改成DisplayObject,spliceChildren返回值多了断言as,calculateBounds的child多了断言及_mask改成mask
DisplayObject的parent加上类型Container,stage加上类型Stage,getBounds里多了断言,worldVisible忽略了item类型
FloatDisplay去掉了devicePixelRatio,改成了stage["_dpi"]
Graphics的_renderCanvas方法缓存里加了父级存在的判断
Loader的loadSheet修改false回调加上各自的数据
BitmapText的set text加了断言
EditableText加了onblur和remove时scrollTo
InputText暂不导出
FrameAni新增getCurrentFrame方法
Lottie新增几处断言,mark引号,layerData引号
MovieClip的setImage加了断言
Spine加了_instanceType,sortBone加了断言
现在不改,索引数据过大时得用Uint32Array,同时开扩展gl.getExtension( "OES_element_index_uint" )和drawElements改参数类型为gl.UNSIGNED_INT
现在不改,索引数据过大时得用Uint32Array,同时开扩展gl.getExtension( "OES_element_index_uint" )和drawElements改参数类型为gl.UNSIGNED_INT
//现在不改,DisplayObject的getLocalBounds最后是否考虑计算一次updateTransform(不用计算自己的,为了计算子级的)
//现在不改,DisplayObject的getLocalBounds最后是否考虑计算一次updateTransform(不用计算自己的,为了计算子级的)
现在不改,D3Renderer里的aSkinIndex传值用了Uint8Array,类型是gl.UNSIGNED_BYTE,估计那个外星头是因为这个
现在不改,D3Renderer里的aSkinIndex传值用了Uint8Array,类型是gl.UNSIGNED_BYTE,估计那个外星头是因为这个
以后要改成和three一样的几何数据处理方式,为了数据能修改
以后要改成和three一样的几何数据处理方式,为了数据能修改
以后光照要改成和three一样的处理方式
以后光照要改成和three一样的处理方式
...
@@ -267,4 +283,11 @@ Texture.WHITE得修改下,在canvas下不能用imageData去drawImage
...
@@ -267,4 +283,11 @@ Texture.WHITE得修改下,在canvas下不能用imageData去drawImage
//3D模块分支dev3D,只需要里面的./src/3D文件夹和./test文件夹,暂时不会把dev的修改合并到dev3D
//3D模块分支dev3D,只需要里面的./src/3D文件夹和./test文件夹,暂时不会把dev的修改合并到dev3D
D3Renderer到时要考虑重新addAttr,重新bindVao,重新传数据upload,到时改造下vao,
D3Renderer到时要考虑重新addAttr,重新bindVao,重新传数据upload,到时改造下vao,
\ No newline at end of file
FloatDisplay会阻止鼠标事件,因为现在stage的鼠标事件是在canvas的,
如果自行监听到canvas的父级上或body上,此时非全屏的canvas的鼠标事件会有问题,因为stage里只算了canvas包围盒,pageXY又不是canvas上的
FloatDisplay现在是body上面的。以后有时间取canvas的父级
文本以后按照bottom来,但是真实高度怎么拿
\ No newline at end of file
src/2d/const.ts
View file @
9966ede6
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
* @name VERSION
* @name VERSION
* @type {string}
* @type {string}
*/
*/
export
const
VERSION
=
"2.0.1
4
"
;
export
const
VERSION
=
"2.0.1
5
"
;
/**
/**
* 判读window,标记浏览器环境,到时万一淘宝小程序内也有window,再改
* 判读window,标记浏览器环境,到时万一淘宝小程序内也有window,再改
,这个貌似没有地方用到,用到了用自己方法取
*/
*/
//@ts-ignore
//@ts-ignore
export
const
devicePixelRatio
:
number
=
window
&&
(
window
.
devicePixelRatio
||
1
)
||
my
.
getSystemInfoSync
().
pixelRatio
;
//
export const devicePixelRatio: number = window && (window.devicePixelRatio || 1) || my.getSystemInfoSync().pixelRatio;
/**
/**
...
@@ -33,7 +33,7 @@ export const osType: "ios" | "android" | "pc" = navigator && navigator.userAgent
...
@@ -33,7 +33,7 @@ export const osType: "ios" | "android" | "pc" = navigator && navigator.userAgent
return
"pc"
;
return
"pc"
;
}
}
})()
})()
//@ts-ignore
//@ts-ignore
//以后加了其他环境再改,现在除了web就是淘宝小程序
||
my
.
getSystemInfoSync
().
platform
.
toLowerCase
()
||
my
.
getSystemInfoSync
().
platform
.
toLowerCase
()
...
@@ -338,7 +338,7 @@ export enum SCALE_MODES {
...
@@ -338,7 +338,7 @@ export enum SCALE_MODES {
/**
/**
* The wrap modes that are supported by
* The wrap modes that are supported by
*
*
* The
{@link settings.WRAP_MODE}
wrap mode affects the default wrapping mode of future operations.
* The wrap mode affects the default wrapping mode of future operations.
* It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.
* It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.
* If the texture is non power of two then clamp will be used regardless as webGL can
* If the texture is non power of two then clamp will be used regardless as webGL can
* only use REPEAT if the texture is po2.
* only use REPEAT if the texture is po2.
...
@@ -360,23 +360,13 @@ export enum WRAP_MODES {
...
@@ -360,23 +360,13 @@ export enum WRAP_MODES {
};
};
/**
/**
* The gc modes that are supported by
* 查看类TextureGarbageCollector
*
* The {@link settings.GC_MODE} Garbage Collection mode for textures is AUTO
* If set to GC_MODE, the renderer will occasionally check textures usage. If they are not
* used for a specified period of time they will be removed from the GPU. They will of course
* be uploaded again when they are required. This is a silent behind the scenes process that
* should ensure that the GPU does not get filled up.
*
* Handy for mobile devices!
* This property only affects WebGL.
*
* @static
* @static
* @constant
* @constant
* @name GC_MODES
* @name GC_MODES
* @type {object}
* @type {object}
* @property {number} AUTO -
Garbage collection will happen periodically automatically
* @property {number} AUTO -
周期性自动回收
* @property {number} MANUAL -
Garbage collection will need to be called manually
* @property {number} MANUAL -
手动调用
*/
*/
export
enum
GC_MODES
{
export
enum
GC_MODES
{
AUTO
=
0
,
AUTO
=
0
,
...
...
src/2d/display/Container.ts
View file @
9966ede6
...
@@ -21,7 +21,7 @@ export default class Container extends DisplayObject {
...
@@ -21,7 +21,7 @@ export default class Container extends DisplayObject {
* @member {DisplayObject[]}
* @member {DisplayObject[]}
* @readonly
* @readonly
*/
*/
children
:
any
[];
children
:
DisplayObject
[];
/**
/**
* 特殊用处
* 特殊用处
...
@@ -322,7 +322,7 @@ export default class Container extends DisplayObject {
...
@@ -322,7 +322,7 @@ export default class Container extends DisplayObject {
for
(
let
i
=
0
;
i
<
removed
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
removed
.
length
;
++
i
)
{
removed
[
i
].
_onDispatchBubbledEvent
(
Event
.
REMOVED_FROM_STAGE
);
removed
[
i
].
_onDispatchBubbledEvent
(
Event
.
REMOVED_FROM_STAGE
);
}
}
return
removed
;
return
removed
as
T
[]
;
}
}
/**
/**
...
@@ -353,25 +353,25 @@ export default class Container extends DisplayObject {
...
@@ -353,25 +353,25 @@ export default class Container extends DisplayObject {
//算自己的
//算自己的
this
.
_calculateBounds
();
this
.
_calculateBounds
();
for
(
let
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
const
child
=
this
.
children
[
i
];
const
child
=
this
.
children
[
i
]
as
Container
;
if
(
!
child
.
visible
||
!
child
.
renderable
)
{
if
(
!
child
.
visible
||
!
child
.
renderable
)
{
continue
;
continue
;
}
}
child
.
calculateBounds
();
child
.
calculateBounds
();
if
(
child
.
_
mask
)
{
if
(
child
.
mask
)
{
child
.
_
mask
.
calculateBounds
();
child
.
mask
.
calculateBounds
();
//取交集矩形
//取交集矩形
if
(
child
.
_bounds
.
x
<
child
.
_
mask
.
_bounds
.
x
)
{
if
(
child
.
_bounds
.
x
<
child
.
mask
.
_bounds
.
x
)
{
child
.
_bounds
.
x
=
child
.
_
mask
.
_bounds
.
x
;
child
.
_bounds
.
x
=
child
.
mask
.
_bounds
.
x
;
}
}
if
(
child
.
_bounds
.
y
<
child
.
_
mask
.
_bounds
.
y
)
{
if
(
child
.
_bounds
.
y
<
child
.
mask
.
_bounds
.
y
)
{
child
.
_bounds
.
y
=
child
.
_
mask
.
_bounds
.
y
;
child
.
_bounds
.
y
=
child
.
mask
.
_bounds
.
y
;
}
}
if
(
child
.
_bounds
.
width
>
child
.
_
mask
.
_bounds
.
width
)
{
if
(
child
.
_bounds
.
width
>
child
.
mask
.
_bounds
.
width
)
{
child
.
_bounds
.
width
=
child
.
_
mask
.
_bounds
.
width
;
child
.
_bounds
.
width
=
child
.
mask
.
_bounds
.
width
;
}
}
if
(
child
.
_bounds
.
height
>
child
.
_
mask
.
_bounds
.
height
)
{
if
(
child
.
_bounds
.
height
>
child
.
mask
.
_bounds
.
height
)
{
child
.
_bounds
.
height
=
child
.
_
mask
.
_bounds
.
height
;
child
.
_bounds
.
height
=
child
.
mask
.
_bounds
.
height
;
}
}
Rectangle
.
createFromRects
(
this
.
_bounds
,
child
.
_bounds
);
Rectangle
.
createFromRects
(
this
.
_bounds
,
child
.
_bounds
);
}
}
...
...
src/2d/display/DisplayObject.ts
View file @
9966ede6
...
@@ -5,6 +5,8 @@ import { Event } from "../events/Event";
...
@@ -5,6 +5,8 @@ import { Event } from "../events/Event";
import
Graphics
from
'../graphics/Graphics'
;
import
Graphics
from
'../graphics/Graphics'
;
import
{
RAD_TO_DEG
,
DEG_TO_RAD
}
from
'../const'
;
import
{
RAD_TO_DEG
,
DEG_TO_RAD
}
from
'../const'
;
import
{
Filter
}
from
'../filter'
;
import
{
Filter
}
from
'../filter'
;
import
{
Stage
}
from
'./Stage'
;
import
Container
from
'./Container'
;
/**
/**
* 基础显示对象抽象类
* 基础显示对象抽象类
* @class
* @class
...
@@ -30,12 +32,12 @@ export class DisplayObject extends EventDispatcher {
...
@@ -30,12 +32,12 @@ export class DisplayObject extends EventDispatcher {
* @member {Container}
* @member {Container}
* @readonly
* @readonly
*/
*/
parent
:
any
;
parent
:
Container
;
/**
/**
* 舞台
* 舞台
*/
*/
stage
:
any
stage
:
Stage
/**
/**
* 名字,预留
* 名字,预留
...
@@ -229,7 +231,7 @@ export class DisplayObject extends EventDispatcher {
...
@@ -229,7 +231,7 @@ export class DisplayObject extends EventDispatcher {
//先把父级的都变换
//先把父级的都变换
if
(
!
skipUpdate
)
{
if
(
!
skipUpdate
)
{
if
(
!
this
.
parent
)
{
if
(
!
this
.
parent
)
{
this
.
parent
=
this
.
_tempDisplayObjectParent
;
this
.
parent
=
this
.
_tempDisplayObjectParent
as
Container
;
this
.
updateTransform
();
this
.
updateTransform
();
this
.
parent
=
null
;
this
.
parent
=
null
;
}
}
...
@@ -605,7 +607,7 @@ export class DisplayObject extends EventDispatcher {
...
@@ -605,7 +607,7 @@ export class DisplayObject extends EventDispatcher {
if
(
!
item
.
visible
)
{
if
(
!
item
.
visible
)
{
return
false
;
return
false
;
}
}
//@ts-ignore
item
=
item
.
parent
;
item
=
item
.
parent
;
}
while
(
item
);
}
while
(
item
);
...
...
src/2d/display/FloatDisplay.ts
View file @
9966ede6
import
{
Event
}
from
"../events/Event"
;
import
{
Event
}
from
"../events/Event"
;
import
{
DisplayObject
}
from
"./DisplayObject"
;
import
{
DisplayObject
}
from
"./DisplayObject"
;
import
{
devicePixelRatio
}
from
"../const"
;
//
import { devicePixelRatio } from "../const";
/**
/**
* 此类对于需要在canvas上放置html其他类型元素的时候非常有用<br/>
* 此类对于需要在canvas上放置html其他类型元素的时候非常有用<br/>
* 比如有时候我们需要放置一个注册,登录或者其他的内容.这些内容包含了输入框<br/>
* 比如有时候我们需要放置一个注册,登录或者其他的内容.这些内容包含了输入框<br/>
...
@@ -82,8 +82,8 @@ export class FloatDisplay extends DisplayObject {
...
@@ -82,8 +82,8 @@ export class FloatDisplay extends DisplayObject {
let
style
=
s
.
htmlElement
.
style
;
let
style
=
s
.
htmlElement
.
style
;
if
(
!
s
.
_isAdded
)
{
if
(
!
s
.
_isAdded
)
{
s
.
_isAdded
=
true
;
s
.
_isAdded
=
true
;
if
(
s
.
stage
.
rootDiv
)
{
if
(
s
.
stage
[
"rootDiv"
]
)
{
s
.
stage
.
rootDiv
.
insertBefore
(
s
.
htmlElement
,
s
.
stage
.
rootDiv
.
childNodes
[
0
]);
s
.
stage
[
"rootDiv"
].
insertBefore
(
s
.
htmlElement
,
s
.
stage
[
"rootDiv"
]
.
childNodes
[
0
]);
}
}
//没有div直接加在body里吧
//没有div直接加在body里吧
else
{
else
{
...
@@ -140,8 +140,8 @@ export class FloatDisplay extends DisplayObject {
...
@@ -140,8 +140,8 @@ export class FloatDisplay extends DisplayObject {
//如果原先在舞台上,加入,是否显示下一帧吧
//如果原先在舞台上,加入,是否显示下一帧吧
if
(
s
.
stage
)
{
if
(
s
.
stage
)
{
s
.
_isAdded
=
true
;
s
.
_isAdded
=
true
;
if
(
s
.
stage
.
rootDiv
)
{
if
(
s
.
stage
[
"rootDiv"
]
)
{
s
.
stage
.
rootDiv
.
insertBefore
(
s
.
htmlElement
,
s
.
stage
.
rootDiv
.
childNodes
[
0
]);
s
.
stage
[
"rootDiv"
].
insertBefore
(
s
.
htmlElement
,
s
.
stage
[
"rootDiv"
]
.
childNodes
[
0
]);
}
}
//没有div直接加在body里吧
//没有div直接加在body里吧
else
{
else
{
...
@@ -206,7 +206,7 @@ export class FloatDisplay extends DisplayObject {
...
@@ -206,7 +206,7 @@ export class FloatDisplay extends DisplayObject {
if
(
this
.
_transformID
!=
this
.
transform
.
_worldID
)
{
if
(
this
.
_transformID
!=
this
.
transform
.
_worldID
)
{
this
.
_transformID
=
this
.
transform
.
_worldID
this
.
_transformID
=
this
.
transform
.
_worldID
let
mtx
=
s
.
transform
.
worldMatrix
;
let
mtx
=
s
.
transform
.
worldMatrix
;
let
d
=
devicePixelRatio
;
let
d
=
s
.
stage
[
"_dpi"
]
||
s
.
stage
[
"dpi"
]
//devicePixelRatio;//不用设备的,改成stage的
style
.
transform
=
style
.
webkitTransform
=
"matrix("
+
(
mtx
.
a
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
b
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
c
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
d
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
tx
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
ty
/
d
).
toFixed
(
4
)
+
")"
;
style
.
transform
=
style
.
webkitTransform
=
"matrix("
+
(
mtx
.
a
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
b
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
c
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
d
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
tx
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
ty
/
d
).
toFixed
(
4
)
+
")"
;
}
}
style
.
opacity
=
s
.
_worldAlpha
;
style
.
opacity
=
s
.
_worldAlpha
;
...
...
src/2d/graphics/Graphics.ts
View file @
9966ede6
...
@@ -1131,7 +1131,7 @@ export default class Graphics extends Container {
...
@@ -1131,7 +1131,7 @@ export default class Graphics extends Container {
this
.
alpha
=
tempAlpha
;
this
.
alpha
=
tempAlpha
;
this
.
cacheAsBitmap
=
true
;
this
.
cacheAsBitmap
=
true
;
this
.
children
=
tempChildren
;
//待测试,还原原先子级
this
.
children
=
tempChildren
;
//待测试,还原原先子级
this
.
updateTransform
()
if
(
this
.
parent
)
this
.
updateTransform
();
}
}
//普通画图的渲染,提供图片和图形的插件,先判断_anchorTexture,offsetX,0
//普通画图的渲染,提供图片和图形的插件,先判断_anchorTexture,offsetX,0
renderer
.
plugins
.
sprite
.
render
(
this
);
renderer
.
plugins
.
sprite
.
render
(
this
);
...
...
src/2d/loader/Loader.ts
View file @
9966ede6
...
@@ -28,7 +28,7 @@ export class Loader extends EventDispatcher {
...
@@ -28,7 +28,7 @@ export class Loader extends EventDispatcher {
* @param callback
* @param callback
* @param url 图集一般是png格式,传的是json,在callback自行拆分
* @param url 图集一般是png格式,传的是json,在callback自行拆分
*/
*/
loadSheet
(
callback
:
Function
,
url
:
string
)
{
loadSheet
(
callback
:
(
success
:
boolean
,
sheet
?:
{
json
:
any
,
img
:
HTMLImageElement
})
=>
void
,
url
:
string
)
{
let
pngFile
=
url
.
substring
(
0
,
url
.
lastIndexOf
(
'.'
))
+
'.png'
;
let
pngFile
=
url
.
substring
(
0
,
url
.
lastIndexOf
(
'.'
))
+
'.png'
;
this
.
loadImage
((
suc
,
data
)
=>
{
this
.
loadImage
((
suc
,
data
)
=>
{
if
(
suc
)
{
if
(
suc
)
{
...
@@ -40,7 +40,7 @@ export class Loader extends EventDispatcher {
...
@@ -40,7 +40,7 @@ export class Loader extends EventDispatcher {
this
.
caches
[
pngFile
]
=
null
;
this
.
caches
[
pngFile
]
=
null
;
}
}
}
else
{
}
else
{
callback
(
false
,
data
)
callback
(
false
)
}
}
},
pngFile
);
},
pngFile
);
...
@@ -55,7 +55,7 @@ export class Loader extends EventDispatcher {
...
@@ -55,7 +55,7 @@ export class Loader extends EventDispatcher {
this
.
caches
[
pngFile
]
=
null
;
this
.
caches
[
pngFile
]
=
null
;
}
}
}
else
{
}
else
{
callback
(
false
,
data
)
callback
(
false
)
}
}
},
url
)
},
url
)
...
...
src/2d/renderers/SystemRenderer.ts
View file @
9966ede6
import
{
hex2string
,
hex2rgb
}
from
'../utils'
;
import
{
hex2string
,
hex2rgb
}
from
'../utils'
;
import
{
RENDERER_TYPE
,
devicePixelRatio
}
from
'../const'
;
import
{
RENDERER_TYPE
/*, devicePixelRatio*/
}
from
'../const'
;
import
Container
from
'../display/Container'
;
import
Container
from
'../display/Container'
;
import
{
EventDispatcher
}
from
'../events/EventDispatcher'
;
import
{
EventDispatcher
}
from
'../events/EventDispatcher'
;
import
{
DisplayObject
}
from
"../display/DisplayObject"
;
import
{
DisplayObject
}
from
"../display/DisplayObject"
;
...
...
src/2d/text/BitmapText.ts
View file @
9966ede6
...
@@ -89,7 +89,7 @@ export class BitmapText extends Container {
...
@@ -89,7 +89,7 @@ export class BitmapText extends Container {
if
(
this
.
children
.
length
>
arr
.
length
)
{
if
(
this
.
children
.
length
>
arr
.
length
)
{
//移除后序
//移除后序
for
(
var
i
=
this
.
children
.
length
-
1
;
i
>=
arr
.
length
;
i
--
)
{
for
(
var
i
=
this
.
children
.
length
-
1
;
i
>=
arr
.
length
;
i
--
)
{
let
c
=
this
.
children
[
i
];
let
c
=
this
.
children
[
i
]
as
BitmapTextSingle
;
this
.
removeChild
(
c
);
this
.
removeChild
(
c
);
bitmapTextSinglePool
.
push
(
c
);
bitmapTextSinglePool
.
push
(
c
);
}
}
...
...
src/2d/text/EditableText.ts
View file @
9966ede6
import
{
TextField
}
from
"./TextField"
;
import
{
TextField
}
from
"./TextField"
;
import
{
MouseEvent
}
from
"../events"
;
import
{
MouseEvent
}
from
"../events"
;
import
{
osType
}
from
"../const"
;
/**
/**
...
@@ -64,7 +65,7 @@ export class EditableText extends TextField {
...
@@ -64,7 +65,7 @@ export class EditableText extends TextField {
* 获取输入框内容
* 获取输入框内容
*/
*/
get
inputValue
():
string
{
get
inputValue
():
string
{
return
this
.
htmlElement
&&
this
.
htmlElement
.
value
||
""
return
this
.
htmlElement
&&
this
.
htmlElement
.
value
||
(
this
.
text
!=
this
.
_prompt
?
this
.
text
:
""
)
}
}
...
@@ -84,6 +85,7 @@ export class EditableText extends TextField {
...
@@ -84,6 +85,7 @@ export class EditableText extends TextField {
s
.
text
=
s
.
prompt
;
s
.
text
=
s
.
prompt
;
s
.
fillColor
=
s
.
promptColor
;
s
.
fillColor
=
s
.
promptColor
;
}
}
window
.
scrollTo
(
0
,
0
)
};
};
this
.
addEventListener
(
MouseEvent
.
CLICK
,
function
(
e
:
Event
)
{
this
.
addEventListener
(
MouseEvent
.
CLICK
,
function
(
e
:
Event
)
{
...
@@ -116,6 +118,12 @@ export class EditableText extends TextField {
...
@@ -116,6 +118,12 @@ export class EditableText extends TextField {
// var divParent = s.stage.canvas.parentNode;
// var divParent = s.stage.canvas.parentNode;
// divParent.insertBefore(s.htmlElement, divParent.childNodes[0])
// divParent.insertBefore(s.htmlElement, divParent.childNodes[0])
document
.
body
.
appendChild
(
s
.
htmlElement
)
document
.
body
.
appendChild
(
s
.
htmlElement
)
//添加
s
.
htmlElement
.
onblur
=
function
()
{
if
(
osType
==
"ios"
)
{
window
.
scrollTo
({
top
:
0
,
left
:
0
,
behavior
:
"smooth"
});
}
};
}
}
//font包括字体和大小
//font包括字体和大小
s
.
htmlElement
.
style
.
font
=
s
.
size
+
"px "
+
this
.
font
;
s
.
htmlElement
.
style
.
font
=
s
.
size
+
"px "
+
this
.
font
;
...
@@ -132,7 +140,7 @@ export class EditableText extends TextField {
...
@@ -132,7 +140,7 @@ export class EditableText extends TextField {
s
.
htmlElement
.
focus
();
s
.
htmlElement
.
focus
();
let
mtx
=
s
.
transform
.
worldMatrix
;
let
mtx
=
s
.
transform
.
worldMatrix
;
let
d
=
devicePixelRatio
||
1
;
let
d
=
s
.
stage
[
"_dpi"
]
||
s
.
stage
[
"dpi"
]
//devicePixelRatio || 1;//用舞台的,能点击肯定有舞台,所以不做存在判断
// console.log(mtx)
// console.log(mtx)
//位置
//位置
s
.
htmlElement
.
style
.
transform
=
s
.
htmlElement
.
style
.
webkitTransform
=
"matrix("
+
(
mtx
.
a
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
b
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
c
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
d
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
tx
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
ty
/
d
).
toFixed
(
4
)
+
")"
;
s
.
htmlElement
.
style
.
transform
=
s
.
htmlElement
.
style
.
webkitTransform
=
"matrix("
+
(
mtx
.
a
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
b
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
c
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
d
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
tx
/
d
).
toFixed
(
4
)
+
","
+
(
mtx
.
ty
/
d
).
toFixed
(
4
)
+
")"
;
...
...
src/2d/text/InputText.ts
0 → 100644
View file @
9966ede6
import
{
osType
,
TEXT_lINETYPE
}
from
"../const"
;
import
{
Event
}
from
"../events/Event"
;
import
{
MouseEvent
}
from
"../events/MouseEvent"
;
import
{
FloatDisplay
}
from
"../display/FloatDisplay"
;
import
{
TextField
}
from
"./TextField"
;
/**
* 纯dom的输入文本,待测试
* 输入,密码,文本区域
*/
export
class
InputText
extends
FloatDisplay
{
/**
* 输入文本的类型.
* @property inputType
* @public
* @since 1.0.0
* @type {number} 0 input 1 password 2 mulit
* @default 0
*/
public
inputType
:
number
=
0
;
/**
* 在手机端是否需要自动收回软键盘,在pc端此参数无效
* @property isAutoDownKeyBoard
* @type {boolean}
* @since 1.0.3
* @default true
*/
public
isAutoDownKeyBoard
:
boolean
=
true
;
/**
* @property _inputTypeList
* @static
* @type {string[]}
* @private
* @since 2.0.0
*/
private
static
_inputTypeList
:
Array
<
string
>
=
[
"input"
,
"password"
,
"textarea"
];
/**
* @method InputText
* @public
* @since 1.0.0
* @param {number} inputType 0 input 1 password 2 multiline
* @example
* var inputText=new InputText();
* inputText.initInfo('aa',100,100,'#ffffff','left',14,'微软雅黑',false,2);
*/
public
constructor
(
inputType
:
number
=
0
)
{
super
();
var
input
:
any
=
null
;
let
s
:
InputText
=
this
;
s
.
_instanceType
=
"InputText"
;
if
(
inputType
<
2
)
{
input
=
document
.
createElement
(
"input"
);
input
.
type
=
InputText
.
_inputTypeList
[
inputType
];
}
else
{
input
=
document
.
createElement
(
"textarea"
);
input
.
style
.
resize
=
"none"
;
input
.
style
.
overflow
=
"hidden"
;
}
s
.
inputType
=
inputType
;
var
remove
=
function
()
{
if
(
s
.
isAutoDownKeyBoard
&&
osType
!=
"pc"
)
{
s
.
htmlElement
&&
s
.
htmlElement
.
blur
();
}
}.
bind
(
s
);
s
.
addEventListener
(
Event
.
REMOVED_FROM_STAGE
,
function
(
e
:
Event
)
{
s
.
stage
.
removeEventListener
(
MouseEvent
.
MOUSE_UP
,
remove
);
});
s
.
addEventListener
(
Event
.
ADDED_TO_STAGE
,
function
(
e
:
Event
)
{
//点击stage任何地方都失去焦点
s
.
stage
.
addEventListener
(
MouseEvent
.
MOUSE_UP
,
remove
);
});
s
.
init
(
input
);
}
/**
* 初始化输入文本
* @method init
* @param htmlElement
* @public
* @return {void}
* @since 1.0.0
*/
public
init
(
htmlElement
:
any
):
void
{
super
.
init
(
htmlElement
);
//默认设置
let
s
=
this
;
s
.
htmlElement
.
style
.
outline
=
"none"
;
s
.
htmlElement
.
style
.
borderWidth
=
"thin"
;
s
.
htmlElement
.
style
.
borderColor
=
"#000"
;
}
/**
* 被始化输入文件的一些属性
* @method initInfo
* @public
* @since 1.0.0
* @param {string} text 默认文字
* @param {string}color 文字颜色
* @param {string}align 文字的对齐方式
* @param {number}size 文字大小
* @param {string}font 文字所使用的字体
* @param {boolean}showBorder 是否需要显示边框
* @param {number}lineSpacing 如果是多行,请设置行高
* @param {number}textWidth 文本宽
*/
public
initInfo
(
text
:
string
,
color
:
string
,
align
:
string
,
size
:
number
,
font
:
string
,
showBorder
:
boolean
,
lineSpacing
:
number
,
textWidth
:
number
,
):
void
{
let
s
:
InputText
=
this
;
s
.
htmlElement
.
placeholder
=
text
;
//font包括字体和大小
s
.
htmlElement
.
style
.
font
=
size
+
"px "
+
font
;
s
.
htmlElement
.
style
.
color
=
color
;
s
.
htmlElement
.
style
.
textAlign
=
align
;
/////////////////////设置边框//////////////
s
.
border
=
showBorder
;
//color:blue; text-align:center"
if
(
s
.
inputType
==
2
)
{
s
.
htmlElement
.
style
.
lineHeight
=
lineSpacing
+
"px"
;
}
s
.
textWidth
=
textWidth
;
}
/**
* @property lineSpacing
* @public
* @since 2.0.0
* @param {number} value
*/
public
set
lineSpacing
(
value
:
number
)
{
this
.
htmlElement
.
style
.
lineHeight
=
value
+
"px"
;
}
public
get
lineSpacing
():
number
{
return
parseInt
(
this
.
htmlElement
.
style
.
lineHeight
);
}
/**
* 设置文本是否为粗体
* @property bold
* @param {boolean} bold true或false
* @public
* @since 1.0.3
*/
public
set
bold
(
bold
:
boolean
)
{
let
ss
=
this
.
htmlElement
.
style
;
if
(
bold
)
{
ss
.
fontWeight
=
"bold"
;
}
else
{
ss
.
fontWeight
=
"normal"
;
}
}
public
get
bold
():
boolean
{
return
this
.
htmlElement
.
style
.
fontWeight
==
"bold"
;
}
/**
* 设置文本是否倾斜
* @property italic
* @param {boolean} italic true或false
* @public
* @since 1.0.3
*/
public
set
italic
(
italic
:
boolean
)
{
let
s
=
this
.
htmlElement
.
style
;
if
(
italic
)
{
s
.
fontStyle
=
"italic"
;
}
else
{
s
.
fontStyle
=
"normal"
;
}
}
public
get
italic
():
boolean
{
return
this
.
htmlElement
.
style
.
fontStyle
==
"italic"
}
/**
* 文本的行高
* @property textHeight
* @public
* @since 1.0.0
* @type {number}
* @default 0
*/
public
set
textHeight
(
value
:
number
)
{
this
.
htmlElement
.
style
.
height
=
value
+
"px"
;
}
public
get
textHeight
():
number
{
return
parseInt
(
this
.
htmlElement
.
style
.
height
);
}
/**
* 文本的宽
* @property textWidth
* @public
* @since 1.0.0
* @type {number}
* @default 0
*/
public
set
textWidth
(
value
:
number
)
{
this
.
htmlElement
.
style
.
width
=
value
+
"px"
;
}
public
get
textWidth
():
number
{
return
parseInt
(
this
.
htmlElement
.
style
.
width
);
}
/**
* 设置文本颜色
* @property color
* @param {boolean} italic true或false
* @public
* @since 1.0.3
*/
public
set
color
(
value
:
string
)
{
var
ss
=
this
.
htmlElement
.
style
;
ss
.
color
=
value
;
}
public
get
color
():
string
{
return
this
.
htmlElement
.
style
.
color
;
}
/**
* 设置或获取是否有边框
* @property property
* @param {boolean} show true或false
* @public
* @since 1.0.3
*/
public
set
border
(
show
:
boolean
)
{
let
s
=
this
;
if
(
show
)
{
s
.
htmlElement
.
style
.
borderStyle
=
"inset"
;
s
.
htmlElement
.
style
.
backgroundColor
=
"#fff"
;
}
else
{
s
.
htmlElement
.
style
.
borderStyle
=
"none"
;
s
.
htmlElement
.
style
.
backgroundColor
=
"transparent"
;
}
}
public
get
border
():
boolean
{
return
this
.
htmlElement
.
style
.
borderStyle
!=
"none"
;
}
/**
* 获取或设置输入文本的值
* 之前的getText 和setText 已废弃
* @property text
* @public
* @since 1.0.3
* @return {string}
*/
public
get
text
():
string
{
let
s
=
this
;
if
(
s
.
htmlElement
)
{
return
s
.
htmlElement
.
value
;
}
}
public
set
text
(
value
:
string
)
{
let
s
=
this
;
if
(
s
.
htmlElement
)
{
s
.
htmlElement
.
value
=
value
;
}
}
/**
* 输入文本的最大输入字数
* @public
* @since 1.1.0
* @property maxCharacters
* @return {number}
*/
public
get
maxCharacters
():
number
{
let
l
:
any
=
this
.
htmlElement
.
getAttribute
(
"maxlength"
);
if
(
l
===
null
)
{
return
0
;
}
else
{
return
l
;
}
}
public
set
maxCharacters
(
value
:
number
)
{
this
.
htmlElement
.
setAttribute
(
"maxlength"
,
value
);
}
/**
* 转换为动态文本,位置上下会有偏差,再说,基本用于截图时,需要截到输入文本时
* @param textField
*/
public
convertToTextField
(
textField
?:
TextField
):
TextField
{
if
(
!
this
.
htmlElement
||
!
this
.
text
)
return
null
;
textField
=
textField
||
new
TextField
();
textField
.
fillColor
=
this
.
color
;
textField
.
text
=
this
.
text
;
textField
.
size
=
parseInt
(
this
.
htmlElement
.
style
.
font
.
split
(
"px"
)[
0
]);
textField
.
textAlign
=
this
.
htmlElement
.
style
.
textAlign
;
textField
.
bold
=
this
.
bold
;
textField
.
italic
=
this
.
italic
;
textField
.
textWidth
=
this
.
textWidth
;
textField
.
lineType
=
this
.
inputType
==
2
?
TEXT_lINETYPE
.
MULTI
:
TEXT_lINETYPE
.
SINGLE
;
textField
.
position
.
copy
(
this
.
position
);
textField
.
scale
.
copy
(
this
.
scale
);
textField
.
rotation
=
this
.
rotation
;
return
textField
}
}
src/2d/text/index.ts
View file @
9966ede6
export
*
from
"./EditableText"
;
//淘宝不可用
export
*
from
"./EditableText"
;
//淘宝不可用
// export * from "./InputText";
// export * from "./InputText";
//问题有点多,先不用
export
*
from
"./TextField"
;
export
*
from
"./TextField"
;
export
*
from
"./BitmapText"
;
export
*
from
"./BitmapText"
;
\ No newline at end of file
src/2d/ui/FrameAni.ts
View file @
9966ede6
...
@@ -28,6 +28,14 @@ export class FrameAni extends Container {
...
@@ -28,6 +28,14 @@ export class FrameAni extends Container {
this
.
showImage
.
texture
=
null
;
this
.
showImage
.
texture
=
null
;
}
}
}
}
/**
* 不开放currentFrame的get方法,因为权限要一致的话set也要变public,
* 但其实外部set赋值是无效的,用reset才有效,所以这里同步给一个方法
* 返回0到totalFrames-1
*/
getCurrentFrame
():
number
{
return
this
.
texturesAll
.
indexOf
(
this
.
showImage
.
texture
)
}
/**
/**
* 所有帧数
* 所有帧数
*/
*/
...
...
src/2d/ui/Lottie.ts
View file @
9966ede6
...
@@ -223,7 +223,7 @@ export class Lottie extends Container {
...
@@ -223,7 +223,7 @@ export class Lottie extends Container {
}
}
private
initState
(
con
=
this
.
children
)
{
private
initState
(
con
=
this
.
children
)
{
for
(
var
i
=
0
;
i
<
con
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
con
.
length
;
i
++
)
{
var
c
:
Sprite
=
con
[
i
]
;
var
c
=
con
[
i
]
as
Sprite
;
if
(
c
[
"layerData"
])
{
if
(
c
[
"layerData"
])
{
//取第一个数据
//取第一个数据
let
data
:
LayerData
=
c
[
"layerData"
];
let
data
:
LayerData
=
c
[
"layerData"
];
...
@@ -277,7 +277,7 @@ export class Lottie extends Container {
...
@@ -277,7 +277,7 @@ export class Lottie extends Container {
private
addTweens
(
con
=
this
.
children
)
{
private
addTweens
(
con
=
this
.
children
)
{
for
(
var
i
=
0
;
i
<
con
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
con
.
length
;
i
++
)
{
let
c
:
Sprite
=
con
[
i
]
;
let
c
=
con
[
i
]
as
Sprite
;
if
(
c
[
"layerData"
])
{
if
(
c
[
"layerData"
])
{
//取第一个数据
//取第一个数据
let
data
:
LayerData
=
c
[
"layerData"
];
let
data
:
LayerData
=
c
[
"layerData"
];
...
@@ -648,14 +648,14 @@ export class Lottie extends Container {
...
@@ -648,14 +648,14 @@ export class Lottie extends Container {
this
.
_recursivePostUpdateTransformAA
(
c
);
this
.
_recursivePostUpdateTransformAA
(
c
);
})
})
this
.
children
.
forEach
((
c
)
=>
{
this
.
children
.
forEach
((
c
)
=>
{
c
.
mark
=
false
;
c
[
"mark"
]
=
false
;
})
})
}
}
private
findChildByInd
(
ind
:
number
)
{
private
findChildByInd
(
ind
:
number
)
{
for
(
var
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
if
(
this
.
children
[
i
]
.
layerData
&&
if
(
this
.
children
[
i
]
[
"layerData"
]
&&
this
.
children
[
i
]
.
layerData
.
ind
===
ind
this
.
children
[
i
]
[
"layerData"
]
.
ind
===
ind
)
return
this
.
children
[
i
]
)
return
this
.
children
[
i
]
}
}
return
null
return
null
...
...
src/2d/ui/MovieClip.ts
View file @
9966ede6
...
@@ -290,7 +290,7 @@ export class MovieClip extends Container {
...
@@ -290,7 +290,7 @@ export class MovieClip extends Container {
let
cs
:
Sprite
[]
=
[];
//找都找了,就全记录吧
let
cs
:
Sprite
[]
=
[];
//找都找了,就全记录吧
for
(
var
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
children
.
length
;
i
++
)
{
if
(
this
.
children
[
i
][
"imageKey"
]
==
imagekey
)
{
if
(
this
.
children
[
i
][
"imageKey"
]
==
imagekey
)
{
cs
.
push
(
this
.
children
[
i
])
cs
.
push
(
this
.
children
[
i
]
as
Sprite
)
}
}
}
}
if
(
!
cs
.
length
)
return
;
if
(
!
cs
.
length
)
return
;
...
...
src/2d/utils/tbminiAdapte.ts
View file @
9966ede6
...
@@ -54,6 +54,8 @@ export function getCancelAnimationFrame() {
...
@@ -54,6 +54,8 @@ export function getCancelAnimationFrame() {
//TODO上面所有的以后考虑这么些写,待测试
//TODO上面所有的以后考虑这么些写,待测试
// let env: "tb" | "web" = "web";
// let env: "tb" | "web" = "web";
// //如果是浏览器环境,声明个my为null,为了无声明不报错
// if (window) window["my"] = null;//在用webview的小程序环境内,只要在小程序的sdk前加js就无所谓,
// export function getEnv(): "tb" | "web" {
// export function getEnv(): "tb" | "web" {
// return env
// return env
// }
// }
...
...
src/spine/Bone.ts
View file @
9966ede6
...
@@ -63,7 +63,7 @@ export class Bone extends Container/*Container*/ {//为了测试用sprite
...
@@ -63,7 +63,7 @@ export class Bone extends Container/*Container*/ {//为了测试用sprite
updateTransform
()
{
updateTransform
()
{
var
sy
=
Bone
.
yDown
?
-
1
:
1
;
var
sy
=
Bone
.
yDown
?
-
1
:
1
;
if
(
this
.
parent
)
{
if
(
this
.
parent
)
{
var
parent
:
Bone
=
this
.
parent
var
parent
=
this
.
parent
if
(
this
.
parent
.
instanceType
==
"Bone"
)
{
if
(
this
.
parent
.
instanceType
==
"Bone"
)
{
// this.transform.updateLocalMatrix();//自己计算
// this.transform.updateLocalMatrix();//自己计算
this
.
transform
.
_worldID
++
;
this
.
transform
.
_worldID
++
;
...
@@ -161,7 +161,7 @@ export class Bone extends Container/*Container*/ {//为了测试用sprite
...
@@ -161,7 +161,7 @@ export class Bone extends Container/*Container*/ {//为了测试用sprite
//子级
//子级
for
(
let
i
=
0
,
j
=
this
.
children
.
length
;
i
<
j
;
++
i
)
{
for
(
let
i
=
0
,
j
=
this
.
children
.
length
;
i
<
j
;
++
i
)
{
const
child
:
Container
=
this
.
children
[
i
];
const
child
=
this
.
children
[
i
];
child
.
updateTransform
();
child
.
updateTransform
();
if
(
child
==
this
.
debugBone
)
{
if
(
child
==
this
.
debugBone
)
{
//还需要root转一次
//还需要root转一次
...
...
src/spine/Spine.ts
View file @
9966ede6
...
@@ -150,6 +150,7 @@ export class Spine extends Container {
...
@@ -150,6 +150,7 @@ export class Spine extends Container {
constructor
(
private
data
:
ISpineData
,
private
textures
:
{
[
key
:
string
]:
Texture
},
showBones
:
boolean
=
false
)
{
constructor
(
private
data
:
ISpineData
,
private
textures
:
{
[
key
:
string
]:
Texture
},
showBones
:
boolean
=
false
)
{
super
();
super
();
this
.
_instanceType
=
"Spine"
;
//自行反向?
//自行反向?
this
.
scaleY
=
-
1
;
this
.
scaleY
=
-
1
;
//骨骼处理
//骨骼处理
...
@@ -409,7 +410,7 @@ export class Spine extends Container {
...
@@ -409,7 +410,7 @@ export class Spine extends Container {
private
sortBone
(
bone
:
Bone
)
{
private
sortBone
(
bone
:
Bone
)
{
if
(
bone
.
sorted
)
return
;
if
(
bone
.
sorted
)
return
;
var
parent
=
bone
.
parent
;
var
parent
=
bone
.
parent
;
if
(
parent
)
this
.
sortBone
(
parent
);
if
(
parent
)
this
.
sortBone
(
parent
as
Bone
);
bone
.
sorted
=
true
;
bone
.
sorted
=
true
;
this
.
orderCalculations
.
push
(
bone
);
this
.
orderCalculations
.
push
(
bone
);
};
};
...
...
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