annie.Shape Class
矢量对象
Item Index
Methods
- _changeMouseCount
- _onDispatchBubbledEvent
- addDraw
- addEventListener
- arcTo
- beginBitmapFill
- beginBitmapStroke
- beginFill
- beginLinearGradientFill
- beginLinearGradientStroke
- beginRadialGradientFill
- beginRadialGradientStroke
- beginStroke
- bezierCurveTo
- changeColor
- clear
- closePath
- decodePath
- dispatchEvent
- DisplayObject
- drawArc
- drawCircle
- drawEllipse
- drawRect
- drawRoundRect
- endFill
- endStroke
- getBitmapStyle static
- getBounds
- getDrawRect
- getGradientColor static
- getRGBA static
- getWH
- globalToLocal
- hasEventListener
- hitTestPoint
- lineTo
- localToGlobal
- moveTo
- quadraticCurveTo
- removeAllEventListener
- removeEventListener
- render
- startDrag
- stopDrag
- update
Methods
_changeMouseCount
-
type
-
isAdd
增加或删除相应mouse或touch侦听记数
_onDispatchBubbledEvent
-
type
-
updateMc
调用些方法会冒泡的将事件向显示列表下方传递
addDraw
-
commandName
-
params
添加一条绘画指令,具体可以查阅Html Canvas画图方法
addEventListener
-
type
-
listener
给对象添加一个侦听
Parameters:
Example:
this.addEventListener(annie.Event.ADD_TO_STAGE,function(e){trace(this);}.bind(this));
beginBitmapFill
-
image
-
matrix
位图填充 一般给Flash2x用
Parameters:
-
image
Image -
matrix
annie.Matrix
beginBitmapStroke
-
image
-
matrix
-
lineWidth
-
cap
-
join
-
miter
线条位图填充 一般给Flash2x用
Parameters:
-
image
Image -
matrix
annie.Matrix -
lineWidth
Number -
cap
String线头的形状 butt round square 默认 butt
-
join
String线与线之间的交接处形状 bevel round miter 默认miter
-
miter
Number正数,规定最大斜接长度,如果斜接长度超过 miterLimit 的值,边角会以 lineJoin 的 "bevel" 类型来显示 默认10
beginLinearGradientFill
-
colors
-
ratios
-
points
-
matrixDate
线性渐变填充 一般给Flash2x用
beginLinearGradientStroke
-
colors
-
ratios
-
points
-
lineWidth
-
cap
-
join
-
miter
画线性渐变的线条 一般给Flash2x用
beginRadialGradientFill
-
colors
-
ratios
-
points
-
matrixDate
径向渐变填充 一般给Flash2x用
beginRadialGradientStroke
-
colors
-
ratios
-
points
-
lineWidth
-
cap
-
join
-
miter
画径向渐变的线条 一般给Flash2x用
bezierCurveTo
-
cp1X
-
cp1Y
-
cp2X
-
cp2Y
-
x
-
y
三次贝赛尔曲线 从上一点画二次贝赛尔曲线到某一点,如果没有设置上一点,则上一占默认为(0,0)
changeColor
-
infoObj
如果有的话,改变矢量对象的边框或者填充的颜色.
clear
()
public
清除掉之前所有绘画的东西
closePath
()
public
闭合一个绘画路径
dispatchEvent
-
event
-
data
广播侦听
Parameters:
-
event
annie.Event | String广播所带的事件对象,如果传的是字符串则直接自动生成一个的事件对象,事件类型就是你传入进来的字符串的值
-
data
Object广播后跟着事件一起传过去的其他任信息,默认值为null
Returns:
如果有收听者则返回true
Example:
var mySprite=new annie.Sprite(),
yourEvent=new annie.Event("yourCustomerEvent");
yourEvent.data='Flash2x';
mySprite.addEventListener("yourCustomerEvent",function(e){
trace(e.data);
})
mySprite.dispatchEvent(yourEvent);
DisplayObject
()
public
drawArc
-
x
-
y
-
radius
-
start
-
end
画一个弧形
drawRoundRect
-
x
-
y
-
w
-
h
-
rTL
-
rTR
-
rBL
-
rBR
画一个带圆角的矩形
endFill
()
public
结束填充
endStroke
()
public
结束画线
getBitmapStyle
-
image
设置位图填充时需要使用的方法,一般给用户使用较少,Flash2x工具自动使用
Parameters:
-
image
ImageHTML Image元素
Returns:
getGradientColor
-
colors
-
ratios
-
points
-
matrixDate
通过一系统参数获取生成颜色或渐变所需要的对象 一般给用户使用较少,Flash2x工具自动使用
Parameters:
-
colors
String -
ratios
Number -
points
annie.Point -
matrixDate
Object如果渐变填充有矩阵变形信息
Returns:
getWH
()
Width: number, height: number
public
如果需要同时获取宽和高的值,建议使用此方法更有效率
Returns:
}
hasEventListener
-
type
是否有添加过此类形的侦听
Parameters:
-
type
String侦听类形
Returns:
如果有则返回true
hitTestPoint
-
globalPoint
-
isMouseEvent
重写hitTestPoint
Parameters:
-
globalPoint
annie.Point -
isMouseEvent
Boolean
Returns:
quadraticCurveTo
-
cpX
-
cpX
-
x
-
y
二次贝赛尔曲线 从上一点画二次贝赛尔曲线到某一点,如果没有设置上一点,则上一占默认为(0,0)
removeAllEventListener
()
public
移除对象中所有的侦听
removeEventListener
-
type
-
listener
移除对应类型的侦听
render
-
renderObj
调用此方法将显示对象渲染到屏幕
Parameters:
-
renderObj
annie.IRender
startDrag
-
isCenter
-
bounds
启动鼠标或者触摸拖动
Parameters:
-
isCenter
Boolean指定将可拖动的对象锁定到指针位置中心 (true),还是锁定到用户第一次单击该对象的位置 (false) 默认false
-
bounds
annie.Rectangle相对于显圣对象父级的坐标的值,用于指定 Sprite 约束矩形
stopDrag
()
public
停止鼠标或者触摸拖动
update
-
isDrawUpdate
重写刷新
Parameters:
-
isDrawUpdate
Object不是因为渲染目的而调用的更新,比如有些时候的强制刷新 默认为true
Properties
_MECO
Unknown
private
全局的鼠标事件的监听数对象表
_texture
Any
protected
缓存起来的纹理对象。最后真正送到渲染器去渲染的对象
Default: null
height
Unknown
public
获取或者设置显示对象在父级里的y方向的高,不到必要不要用此属性获取高 如果你要同时获取款高,建议使用getWH()方法获取宽和高
instanceId
Unknown
public
每一个annie引擎对象都会有一个唯一的id码。
Example:
//获取 annie引擎类对象唯一码
trace(this.instanceId);
instanceType
Unknown
public
每一个annie类都有一个实例类型字符串,通过这个字符串,你能知道这个实例是从哪个类实例而来
name
String
public
每一个显示对象都可以给他启一个名字,这样我们在查找子级的时候就可以直接用this.getChildrndByName("name")获取到这个对象的引用
Default: ""
stage
Stage
public
此显示对象所在的舞台对象,如果此对象没有被添加到显示对象列表中,此对象为空。
Default: null;
width
Unknown
public
获取或者设置显示对象在父级里的x方向的宽,不到必要不要用此属性获取高 如果你要同时获取款高,建议使用getWH()方法获取宽和高