Members
-
autoClearBoolean
-
场景是否自动清除上一帧的像素内容
-
autoStyleBoolean
-
场景是否应用style控制宽高
-
averageFpsNumber
-
渲染到目前为止的平均帧率,仅在enableFPS为true时才可用
-
canvasCANVAS
-
场景的canvas的dom
-
ctxcontext2d
-
场景的canvas的绘图环境
-
enableFPSBoolean
-
是否记录渲染性能
-
flagsnumber
-
State of the tracking data, expressed as bit flags
-
flags
-
Set the flags for the tracking data
-
fpsNumber
-
渲染的瞬时帧率,仅在enableFPS为true时才可用
-
heightNumber
-
canvas的高度
-
leftDownboolean
-
Did the left mouse button come down in the DisplayObject?
-
leftDown
-
Set the left down flag
-
constantNEWTON_ITERATIONS
-
https://github.com/gre/bezier-easing
BezierEasing - use bezier curve for transition easing function
by Gaëtan Renaudeau 2014 - 2015 – MIT License -
nonenumber
-
Is the tracked event inactive (not over or down)?
-
object3DId
-
-
overboolean
-
Is the tracked event over the DisplayObject?
-
over
-
Set the over flag
-
pausedBoolean
-
是否暂停 ticker
-
readonlypointerIdnumber
-
Unique pointer id of the event
-
resolutionNumber
-
场景分辨率
-
rightDown
-
Set the right down flag
-
rightDownboolean
-
Did the right mouse button come down in the DisplayObject?
-
rootMatrix
-
整个场景的初始矩阵
-
startedBoolean
-
是否开启 ticker
-
widthNumber
-
canvas的宽度
Methods
-
_createTypedArray(type, len){*}
-
a
Name Type Description type
* a
len
* a
Returns:
Type Description * -
_rt(val){String}
-
返回数据类型
Name Type Description val
* Returns:
Type Description String 数据类型 -
A(aA1, aA2){number}
-
公因式A
Name Type Description aA1
number 控制分量
aA2
number 控制分量
Returns:
Type Description number 整个公式中的A公因式的值 -
addDynamicProperty(prop)
-
a
Name Type Description prop
* a
-
addDynamicProperty(prop)
-
a
Name Type Description prop
* a
-
addPaths(newPaths, localShapeCollection)
-
a
Name Type Description newPaths
* a
localShapeCollection
* a
-
addProcessedElement(elem, pos)
-
a
Name Type Description elem
* a
pos
* a
-
addSegment(pt1, pt2, pt3, pt4, shapePath, pos, newShape)
-
a
Name Type Description pt1
* a
pt2
* a
pt3
* a
pt4
* a
shapePath
* a
pos
* a
newShape
* a
-
addSegmentFromArray(points, shapePath, pos, newShape)
-
a
Name Type Description points
* a
shapePath
* a
pos
* a
newShape
* a
-
addShape(data)
-
a
Name Type Description data
* a
-
a
-
addShape(shapeData)
-
a
Name Type Description shapeData
* a
-
addShapes(shapeData, shapeSegment, shapePath){*}
-
a
Name Type Description shapeData
* a
shapeSegment
* a
shapePath
* a
Returns:
Type Description * -
addShapeToModifier()
-
a
-
addShapeToModifier(shapeData)
-
a
Name Type Description shapeData
* a
-
addShapeToModifier()
-
a
-
addShapeToModifiers(data)
-
a
Name Type Description data
* a
-
addTransformSequence(transforms){*}
-
a
Name Type Description transforms
* a
Returns:
Type Description * -
addTransformToStyleList(transform)
-
a
Name Type Description transform
* a
-
applyTransforms(pMatrix, rMatrix, sMatrix, transform, perc, inv)
-
a
Name Type Description pMatrix
* a
rMatrix
* a
sMatrix
* a
transform
* a
perc
* a
inv
* a
-
B(aA1, aA2){number}
-
公因式B
Name Type Description aA1
number 控制分量1
aA2
number 控制分量2
Returns:
Type Description number 整个公式中的B公因式的值 -
BezierData(length)
-
a
Name Type Description length
* a
-
binarySubdivide(aX, aA, aB, mX1, mX2){number}
-
Name Type Description aX
number aA
number aB
number mX1
number mX2
number Returns:
Type Description number 二分法猜测t的值 -
buildBezierData(pt1, pt2, pt3, pt4){*}
-
a
Name Type Description pt1
* a
pt2
* a
pt3
* a
pt4
* a
Returns:
Type Description * -
C(aA1, aA2){number}
-
公因式C
Name Type Description aA1
number 控制分量1
aA2
number 控制分量2
Returns:
Type Description number 整个公式中的C公因式的值 -
calcBezier(aT, aA1, aA2){number}
-
获取aT处的值
Name Type Description aT
number 三次贝塞尔曲线的t自变量
aA1
number 控制分量1
aA2
number 控制分量2
Returns:
Type Description number 三次贝塞尔公式的因变量 -
calculateBounds()
-
计算包围盒子
-
Calculates all dynamic values(num, isVisible)
-
Name Type Description num
number current frame number in Layer's time
isVisible
boolean if layers is currently in range
-
calculateShapeEdges(s, e, shapeLength, addedLength, totalModifierLength){*}
-
a
Name Type Description s
* a
e
* a
shapeLength
* a
addedLength
* a
totalModifierLength
* a
Returns:
Type Description * -
changeGroupRender(elements, renderFlag)
-
a
Name Type Description elements
* a
renderFlag
* a
-
checkCollapsable()
-
a
-
clone(shape){*}
-
a
Name Type Description shape
* a
Returns:
Type Description * -
cloneElements(elements)
-
a
Name Type Description elements
* a
-
closeStyles(styles)
-
a
Name Type Description styles
* a
-
comparePoints(values, points)
-
a
Name Type Description values
* a
points
* a
-
create(){*}
-
a
Returns:
Type Description * -
create(){*}
-
a
Returns:
Type Description * -
create(){*}
-
Returns:
Type Description * -
create(){*}
-
a
Returns:
Type Description * -
createContent()
-
a
-
createGroupElement(data){*}
-
a
Name Type Description data
* a
Returns:
Type Description * -
createQuaternion(values){*}
-
a
Name Type Description values
* a
Returns:
Type Description * -
createRegularArray(type, len){*}
-
a
Name Type Description type
* a
len
* a
Returns:
Type Description * -
createShapeElement(data){*}
-
a
Name Type Description data
* a
Returns:
Type Description * -
createSizedArray(len){*}
-
a
Name Type Description len
* a
Returns:
Type Description * -
createStyleElement(data, transforms){*}
-
a
Name Type Description data
* a
transforms
* a
Returns:
Type Description * -
createTransformElement(data){*}
-
a
Name Type Description data
* a
Returns:
Type Description * -
createUrl(asset, prefix){string}
-
prefix
Name Type Description asset
object asset
prefix
string prefix
Returns:
Type Description string -
double(arr){*}
-
a
Name Type Description arr
* a
Returns:
Type Description * -
doubleArrayLength()
-
a
-
drawCurve(ctx, data)
-
a
Name Type Description ctx
* a
data
* a
-
drawInv(ctx, size)
-
a
Name Type Description ctx
* a
size
* a
-
drawLayer()
-
a
-
Euler(x, y, z, order)
-
Euler
Name Type Description x
* y
* z
* order
* -
findStep(steps, progress){number}
-
detect current frame index
Name Type Description steps
array frames array
progress
number current time
Returns:
Type Description number which frame index -
findStep(steps, progress){number}
-
判断当前进度在哪一帧内
Name Type Description steps
array 帧数组
progress
number 当前进度
Returns:
Type Description number 当前进度停留在第几帧 -
getAssets(id, assets){object}
-
get assets from keyframes assets
Name Type Description id
string assets refid
assets
object assets object
Returns:
Type Description object asset object -
getBezierLength(pt1, pt2, pt3, pt4){*}
-
a
Name Type Description pt1
* a
pt2
* a
pt3
* a
pt4
* a
Returns:
Type Description * -
getConstructorFunction(){*}
-
a
Returns:
Type Description * -
getDistancePerc(perc, bezierData){*}
-
a
Name Type Description perc
* a
bezierData
* a
Returns:
Type Description * -
getEaseing(s, e, nm, p){array}
-
根据进度获取到普通插值
Name Type Description s
number 插值起始端点
e
number 插值结束端点
nm
array 贝塞尔曲线的名字
p
number 插值进度
Returns:
Type Description array -
getEaseingPath(curve, nm, p){Point}
-
Name Type Description curve
BezierCurve nm
string p
number Returns:
Type Description Point -
getKeyframedConstructorFunction(){*}
-
a
Returns:
Type Description * -
getModifier(nm, elem, data){*}
-
a
Name Type Description nm
* a
elem
* a
data
* a
Returns:
Type Description * -
getNewKey(){*}
-
a
Returns:
Type Description * -
getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData){*}
-
a
Name Type Description pt1
* a
pt2
* a
pt3
* a
pt4
* a
startPerc
* a
endPerc
* a
bezierData
* a
Returns:
Type Description * -
getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData){*}
-
a
Name Type Description pt1
* a
pt2
* a
pt3
* a
pt4
* a
percent
* a
bezierData
* a
Returns:
Type Description * -
getSegmentsLength(shapeData){*}
-
a
Name Type Description shapeData
* a
Returns:
Type Description * -
getShapeProp(elem, data, type){*}
-
a
Name Type Description elem
* a
data
* a
type
* a
Returns:
Type Description * -
getSlope(aT, aA1, aA2){number}
-
获取aT处的斜率
Name Type Description aT
number 三次贝塞尔曲线的t自变量
aA1
number 控制分量1
aA2
number 控制分量2
Returns:
Type Description number 三次贝塞尔公式的导数 -
getTransformProperty(elem, data, container){*}
-
a
Name Type Description elem
* a
data
* a
container
* a
Returns:
Type Description * -
getValue(forceRender)
-
a
Name Type Description forceRender
* a
-
getValue(forceRender)
-
a
Name Type Description forceRender
* a
-
init(elem, arr, pos, elemsData)
-
a
Name Type Description elem
* a
arr
* a
pos
* a
elemsData
* a
-
init(elem, data)
-
a
Name Type Description elem
* a
data
* a
-
initDynamicPropertyContainer(container)
-
a
Name Type Description container
* a
-
initModifierProperties(elem, data)
-
a
Name Type Description elem
* a
data
* a
-
initModifierProperties(elem, data)
-
a
Name Type Description elem
* a
data
* a
-
initModifierProperties(elem, data)
-
a
Name Type Description elem
* a
data
* a
-
initModifierProperties()
-
a
-
initModifierProperties(elem, data)
-
a
Name Type Description elem
* a
data
* a
-
inRange(v, min, max){boolean}
-
判断数值是否在(min, max]区间内
Name Type Description v
number 待比较的值
min
number 最小区间
max
number 最大区间
Returns:
Type Description boolean 是否在(min, max]区间内 -
inRange(v, min, max){boolean}
-
detect number was in [min, max]
Name Type Description v
number value
min
number lower
max
number upper
Returns:
Type Description boolean in [min, max] range ? -
isFrame(frame){Boolean}
-
Name Type Description frame
Object object
Returns:
Type Description Boolean -
iterateDynamicProperties()
-
a
-
Matrix4()
-
Matrix4
-
Mesh(texture, geometry)
-
网格类型
Name Type Description texture
JC.Texture 图片纹理
geometry
geometry -
newShapeCollection(){*}
-
a
Returns:
Type Description * -
newtonRaphsonIterate(aX, aGuessT, mX1, mX2){number}
-
牛顿迭代算法,进一步的获取精确的T值
Name Type Description aX
number aGuessT
number mX1
number mX2
number Returns:
Type Description number 获取更精确的T值 -
Object3D()
-
3D类
-
pause()
-
暂停触发 tick
-
Plane(width, height, widthSegments, heightSegments)
-
平面
Name Type Description width
Number 宽度
height
Number 高度
widthSegments
Number 宽分隔
heightSegments
Number 高分隔
-
PointData(partial, point)
-
a
Name Type Description partial
* a
point
* a
-
pointOnLine2D(x1, y1, x2, y2, x3, y3){*}
-
a
Name Type Description x1
* a
y1
* a
x2
* a
y2
* a
x3
* a
y3
* a
Returns:
Type Description * -
pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3){*}
-
a
Name Type Description x1
* a
y1
* a
z1
* a
x2
* a
y2
* a
z2
* a
x3
* a
y3
* a
z3
* a
Returns:
Type Description * -
prepareEaseing(mX1, mY1, mX2, mY2, nm){BezierEasing}
-
准备好贝塞尔曲线
Name Type Description mX1
number 控制点1的x分量
mY1
number 控制点1的y分量
mX2
number 控制点2的x分量
mY2
number 控制点2的y分量
nm
string 控制点命名
Returns:
Type Description BezierEasing -
prepareFrame(num)
-
a
Name Type Description num
* a
-
ProcessedElement(element, position)
-
a
Name Type Description element
* a
position
* a
-
processKeys(forceRender)
-
a
Name Type Description forceRender
* a
-
processKeys()
-
a
-
processPath(path, round){*}
-
a
Name Type Description path
* a
round
* a
Returns:
Type Description * -
processPath(path, mouseCoords, positions)
-
a
Name Type Description path
* a
mouseCoords
* a
positions
* a
-
processSequence(sequence, isFirstFrame)
-
a
Name Type Description sequence
* a
isFirstFrame
* a
-
processSequences(isFirstFrame)
-
a
Name Type Description isFirstFrame
* a
-
processShapes(_isFirstFrame)
-
a
Name Type Description _isFirstFrame
* a
-
processShapes(_isFirstFrame)
-
a
Name Type Description _isFirstFrame
* a
-
processShapes(_isFirstFrame)
-
a
Name Type Description _isFirstFrame
* a
-
processShapes()
-
a
-
PropertyFactory(elem, data, type, mult, container){*}
-
a
Name Type Description elem
* a
data
* a
type
* a
mult
* a
container
* a
Returns:
Type Description * -
Quaternion(x, y, z, w)
-
Name Type Description x
* y
* z
* w
* -
quaternionToEuler(out, quat)
-
a
Name Type Description out
* a
quat
* a
-
registerModifier(nm, factory)
-
a
Name Type Description nm
* a
factory
* a
-
release(shapePath)
-
a
Name Type Description shapePath
* a
-
release(element)
-
a
Name Type Description element
* a
-
release(shapeCollection)
-
a
Name Type Description shapeCollection
* a
-
releasePathsData(pathsData){*}
-
a
Name Type Description pathsData
* a
Returns:
Type Description * -
releaseShapes()
-
a
-
removeTransformFromStyleList()
-
a
-
Renderer(options)
-
Name Type Description options
object 舞台的配置项
Name Type Description dom
string 舞台要附着的
canvas
元素resolution
number optional 设置舞台的分辨率,
默认为
1interactive
boolean optional 设置舞台是否可交互,
默认为
truewidth
number optional 设置舞台的宽,
默认为
附着的canvas.widthheight
number optional 设置舞台的高,
默认为
附着的canvas.heightbackgroundColor
string optional 设置舞台的背景颜色,
默认为
‘transparent’ -
renderFill(styleData, itemData, groupTransform)
-
a
Name Type Description styleData
* a
itemData
* a
groupTransform
* a
-
renderFrame(ctx)
-
a
Name Type Description ctx
* a
-
renderGradientFill(styleData, itemData, groupTransform)
-
a
Name Type Description styleData
* a
itemData
* a
groupTransform
* a
-
renderInnerContent()
-
a
-
renderModifiers()
-
a
-
renderPath(pathData, itemData)
-
a
Name Type Description pathData
* a
itemData
* a
-
renderShape(parentTransform, items, data, ctx)
-
a
Name Type Description parentTransform
* a
items
* a
data
* a
ctx
* a
-
renderShapeTransform(parentTransform, groupTransform)
-
a
Name Type Description parentTransform
* a
groupTransform
* a
-
renderStroke(styleData, itemData, groupTransform)
-
a
Name Type Description styleData
* a
itemData
* a
groupTransform
* a
-
renderStyledShape(styledShape, shape)
-
a
Name Type Description styledShape
* a
shape
* a
-
resetElements(elements)
-
a
Name Type Description elements
* a
-
resume()
-
恢复触发 tick
-
reverse(){*}
-
a
Returns:
Type Description * -
searchProcessedElement(elem)
-
a
Name Type Description elem
* a
-
searchShapes(arr, itemsData, prevViewData, shouldRender, transforms)
-
a
Name Type Description arr
* a
itemsData
* a
prevViewData
* a
shouldRender
* a
transforms
* a
-
setAsAnimated()
-
a
-
setLength(len)
-
a
Name Type Description len
* a
-
setPathData(closed, len)
-
a
Name Type Description closed
* a
len
* a
-
setTripleAt(vX, vY, oX, oY, iX, iY, pos, replace)
-
a
Name Type Description vX
* a
vY
* a
oX
* a
oY
* a
iX
* a
iY
* a
pos
* a
replace
* a
-
setXYAt(x, y, type, pos, replace)
-
a
Name Type Description x
* a
y
* a
type
* a
pos
* a
replace
* a
-
slerp(a, b, t){*}
-
based on @Toji's https://github.com/toji/gl-matrix/
Name Type Description a
* a
b
* a
t
* a
Returns:
Type Description * -
start()
-
渲染循环
-
stop()
-
渲染循环
-
Ticker(enableFPS)
-
ticker class
Name Type Description enableFPS
boolean -
Vector3(x, y, z)
-
Name Type Description x
* y
* z
* -
Vector4(x, y, z, w)
-
Name Type Description x
* y
* z
* w
*