new JC.Texture(texture, options)
图片纹理类
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
texture |
string | Image |
图片url或者图片对象. |
||||||||||||
options |
object |
图片配置
|
Extends
Members
-
staticJC.Texture.height
-
获取纹理的高
Properties:
Name Type Description heightNumber 纹理的高
-
staticJC.Texture.naturalHeight
-
获取纹理的原始高
Properties:
Name Type Description naturalHeightNumber 纹理的原始高
-
staticJC.Texture.naturalWidth
-
获取纹理的原始宽
Properties:
Name Type Description naturalWidthNumber 纹理的原始宽
-
staticJC.Texture.width
-
获取纹理的宽
Properties:
Name Type Description widthNumber 纹理的宽
Methods
-
inherited emit(type, ev)
-
事件对象的触发事件函数
Name Type Description typeString 事件类型
evJC.InteractionData 事件数据
-
listen()
-
监听加载事件
-
load(url)
-
尝试加载图片
Name Type Description urlString 图片url或者图片对象.
-
inherited off(type, fn){this}
-
事件对象的事件解绑函数
Name Type Description typeString 事件类型
fnfunction 注册时回调函数的引用
Returns:
Type Description this -
inherited on(type, fn){this}
-
事件对象的事件绑定函数
Name Type Description typeString 事件类型
fnfunction 回调函数
Returns:
Type Description this -
inherited once(type, fn){this}
-
事件对象的一次性事件绑定函数
Name Type Description typeString 事件类型
fnfunction 回调函数
Returns:
Type Description this