annieUI.ScratchCard Class
刮刮卡类
Item Index
Methods
Properties
- _enterFrameEvent
- _isCache
- _MECO
- _offsetX
- _offsetY
- _texture
- _UI
- alpha
- anchorX
- anchorY
- bgColor
- bitmapData
- blendMode
- cAlpha
- cFilters
- cMatrix
- drawColor
- drawHeight
- drawRadius
- drawWidth
- filters
- height
- hitTestWidthPixel
- instanceId
- instanceType
- mask
- matrix
- mouseEnable
- name
- parent
- rect
- rotation
- scaleX
- scaleY
- skewX
- skewY
- stage
- visible
- width
- x
- y
Methods
_changeMouseCount
-
type
-
isAdd
增加或删除相应mouse或touch侦听记数
_onDispatchBubbledEvent
-
type
-
updateMc
调用些方法会冒泡的将事件向显示列表下方传递
addEventListener
-
type
-
listener
给对象添加一个侦听
Parameters:
Example:
this.addEventListener(annie.Event.ADD_TO_STAGE,function(e){trace(this);}.bind(this));
Bitmap
-
bitmapData
-
rect
Parameters:
-
bitmapData
Image | Video | Other一个HTMl Image的实例 -
rect
annie.Rectangle设置显示Image的区域,不设置些值则全部显示Image的内容
Example:
var imgEle=new Image();
imgEle.onload=function (e) {
var bitmap = new annie.Bitmap(imgEle)
//居中对齐
bitmap.x = (s.stage.desWidth - bitmap.width) / 2;
bitmap.y = (s.stage.desHeight - bitmap.height) / 2;
s.addChild(bitmap);
//截取图片的某一部分显示
var rect = new annie.Rectangle(0, 0, 200, 200),
rectBitmap = new annie.Bitmap(imgEle, rect);
rectBitmap.x = (s.stage.desWidth - bitmap.width) / 2;
rectBitmap.y = 100;
s.addChild(rectBitmap);
}
imgEle.src='http://test.annie2x.com/biglong/logo.jpg';
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
DrawingBoard
-
width
-
height
-
bgColor
构造函数
getWH
()
Width: number, height: number
public
如果需要同时获取宽和高的值,建议使用此方法更有效率
Returns:
}
hasEventListener
-
type
是否有添加过此类形的侦听
Parameters:
-
type
String侦听类形
Returns:
如果有则返回true
hitTestPoint
-
globalPoint
-
isMouseEvent
Parameters:
-
globalPoint
annie.Point -
isMouseEvent
Boolean
Returns:
removeAllEventListener
()
public
移除对象中所有的侦听
removeEventListener
-
type
-
listener
移除对应类型的侦听
render
-
renderObj
调用此方法将显示对象渲染到屏幕
Parameters:
-
renderObj
annie.IRender
ScratchCard
-
width
-
height
-
frontColorObj
-
backColorObj
-
drawRadius
构造函数 请监听 "onDrawTime"事件来判断刮完多少百分比了。
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
bgColor
Any
public
背景色 可以是任何的颜色类型
bitmapData
Any
public
Default: null
drawColor
Any
public
绘画颜色, 可以是任何的颜色类型
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: ""
rect
annie.Rectangle
public
Default: null
stage
Stage
public
此显示对象所在的舞台对象,如果此对象没有被添加到显示对象列表中,此对象为空。
Default: null;
width
Unknown
public
获取或者设置显示对象在父级里的x方向的宽,不到必要不要用此属性获取高 如果你要同时获取款高,建议使用getWH()方法获取宽和高