2020-06-08 11:49:45 +08:00
declare var global : any ;
declare var __global : any ;
declare let __define : any ;
declare namespace egret {
type Nullable < T > = T | null ;
/ * *
* The HashObject class is the base class for all objects in the Egret framework . The HashObject
* class includes a hashCode property , which is a unique identification number of the instance .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* Egret顶级对象 。 框 架 内 所 有 对 象 的 基 类 , 为 对 象 实 例 提 供 唯 一 的 hashCode值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface IHashObject {
/ * *
* a unique identification number assigned to this instance .
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language en_US
* /
/ * *
* 返 回 此 对 象 唯 一 的 哈 希 值 , 用 于 唯 一 确 定 一 个 对 象 。 hashCode为大于等于1的整数 。
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language zh_CN
* /
hashCode : number ;
}
/ * *
* @private
* 哈 希 计 数
* /
let $hashCount : number ;
/ * *
* The HashObject class is the base class for all objects in the Egret framework . The HashObject
* class includes a hashCode property , which is a unique identification number of the instance .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* Egret顶级对象 。 框 架 内 所 有 对 象 的 基 类 , 为 对 象 实 例 提 供 唯 一 的 hashCode值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class HashObject implements IHashObject {
/ * *
* Initializes a HashObject
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 HashObject 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
/ * *
* @private
* /
$hashCode : number ;
/ * *
* a unique identification number assigned to this instance .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 此 对 象 唯 一 的 哈 希 值 , 用 于 唯 一 确 定 一 个 对 象 。 hashCode为大于等于1的整数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly hashCode : number ;
}
}
declare namespace egret {
/ * *
* The EventDispatcher class is the base class for all classes that dispatchEvent events . The EventDispatcher class implements
* the IEventDispatcher interface and is the base class for the DisplayObject class . The EventDispatcher class allows
* any object on the display list to be an event target and as such , to use the methods of the IEventDispatcher interface .
* Event targets are an important part of the Egret event model . The event target serves as the focal point for how events
* flow through the display list hierarchy . When an event such as a touch tap , Egret dispatches an event object into the
* event flow from the root of the display list . The event object then makes its way through the display list until it
* reaches the event target , at which point it begins its return trip through the display list . This round - trip journey
* to the event target is conceptually divided into three phases : < br / >
* the capture phase comprises the journey from the root to the last node before the event target ' s node , the target
* phase comprises only the event target node , and the bubbling phase comprises any subsequent nodes encountered on
* the return trip to the root of the display list . In general , the easiest way for a user - defined class to gain event
* dispatching capabilities is to extend EventDispatcher . If this is impossible ( that is , if the class is already extending
* another class ) , you can instead implement the IEventDispatcher interface , create an EventDispatcher member , and write simple
* hooks to route calls into the aggregated EventDispatcher .
* @see egret . IEventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / EventDispatcher . ts
* @language en_US
* /
/ * *
* EventDispatcher 是 Egret 的 事 件 派 发 器 类 , 负 责 进 行 事 件 的 发 送 和 侦 听 。
* 事 件 目 标 是 事 件 如 何 通 过 显 示 列 表 层 次 结 构 这 一 问 题 的 焦 点 。 当 发 生 鼠 标 单 击 、 触 摸 或 按 键 等 事 件 时 ,
* 框 架 会 将 事 件 对 象 调 度 到 从 显 示 列 表 根 开 始 的 事 件 流 中 。 然 后 该 事 件 对 象 在 显 示 列 表 中 前 进 , 直 到 到 达 事 件 目 标 ,
* 然 后 从 这 一 点 开 始 其 在 显 示 列 表 中 的 回 程 。 在 概 念 上 , 到 事 件 目 标 的 此 往 返 行 程 被 划 分 为 三 个 阶 段 :
* 捕 获 阶 段 包 括 从 根 到 事 件 目 标 节 点 之 前 的 最 后 一 个 节 点 的 行 程 , 目 标 阶 段 仅 包 括 事 件 目 标 节 点 , 冒 泡 阶 段 包 括 回 程 上 遇 到 的 任 何 后 续 节 点 到 显 示 列 表 的 根 。
* 通 常 , 使 用 户 定 义 的 类 能 够 调 度 事 件 的 最 简 单 方 法 是 扩 展 EventDispatcher 。 如 果 无 法 扩 展 ( 即 , 如 果 该 类 已 经 扩 展 了 另 一 个 类 ) , 则 可 以 实 现
* IEventDispatcher 接 口 , 创 建 EventDispatcher 成 员 , 并 编 写 一 些 简 单 的 映 射 , 将 调 用 连 接 到 聚 合 的 EventDispatcher 中 。
* @see egret . IEventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / EventDispatcher . ts
* @language zh_CN
* /
class EventDispatcher extends HashObject implements IEventDispatcher {
/ * *
* create an instance of the EventDispatcher class .
* @param target The target object for events dispatched to the EventDispatcher object . This parameter is used when
* the EventDispatcher instance is aggregated by a class that implements IEventDispatcher ; it is necessary so that the
* containing object can be the target for events . Do not use this parameter in simple cases in which a class extends EventDispatcher .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 EventDispatcher 类 的 实 例
* @param target 此 EventDispatcher 所 抛 出 事 件 对 象 的 target 指 向 。 此 参 数 主 要 用 于 一 个 实 现 了 IEventDispatcher 接 口 的 自 定 义 类 ,
* 以 便 抛 出 的 事 件 对 象 的 target 属 性 可 以 指 向 自 定 义 类 自 身 。 请 勿 在 直 接 继 承 EventDispatcher 的 情 况 下 使 用 此 参 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( target? : IEventDispatcher ) ;
/ * *
* @private
* /
$EventDispatcher : Object ;
/ * *
* @private
*
* @param useCapture
* /
$getEventMap ( useCapture? : boolean ) : any ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : void ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
once ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : void ;
/ * *
* @private
* /
$addListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number , dispatchOnce? : boolean ) : void ;
$insertEventBin ( list : any [ ] , type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number , dispatchOnce? : boolean ) : boolean ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
removeEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean ) : void ;
$removeEventBin ( list : any [ ] , listener : Function , thisObject : any ) : boolean ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
hasEventListener ( type : string ) : boolean ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
willTrigger ( type : string ) : boolean ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
dispatchEvent ( event : Event ) : boolean ;
/ * *
* @private
* /
$notifyListener ( event : Event , capturePhase : boolean ) : boolean ;
/ * *
* Distribute a specified event parameters .
* @param type The type of the event . Event listeners can access this information through the inherited type property .
* @param bubbles Determines whether the Event object bubbles . Event listeners can access this information through
* the inherited bubbles property .
* @param data { any } data
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 派 发 一 个 指 定 参 数 的 事 件 。
* @param type { string } 事 件 类 型
* @param bubbles { boolean } 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param data { any } 事 件 data
* @param cancelable { boolean } 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
dispatchEventWith ( type : string , bubbles? : boolean , data? : any , cancelable? : boolean ) : boolean ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 事 件 信 息 对 象
* /
interface EventBin {
type : string ;
/ * *
* @private
* /
listener : Function ;
/ * *
* @private
* /
thisObject : any ;
/ * *
* @private
* /
priority : number ;
/ * *
* @private
* /
target : IEventDispatcher ;
/ * *
* @private
* /
useCapture : boolean ;
/ * *
* @private
* /
dispatchOnce : boolean ;
}
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
class Filter extends HashObject {
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
type : string ;
/ * *
* @private
* /
$id : number ;
/ * *
* @private
* /
$uniforms : any ;
/ * *
* @private
* /
protected paddingTop : number ;
/ * *
* @private
* /
protected paddingBottom : number ;
/ * *
* @private
* /
protected paddingLeft : number ;
/ * *
* @private
* /
protected paddingRight : number ;
/ * *
* @private
* @native Render
* /
$obj : any ;
constructor ( ) ;
/ * *
* @private
* /
$toJson ( ) : string ;
protected updatePadding ( ) : void ;
onPropertyChange ( ) : void ;
}
}
declare namespace egret {
/ * *
* @private
* /
const enum RenderMode {
NONE = 1 ,
FILTER = 2 ,
CLIP = 3 ,
SCROLLRECT = 4 ,
}
/ * *
* The DisplayObject class is the base class for all objects that can be placed on the display list . The display list
* manages all objects displayed in the runtime . Use the DisplayObjectContainer class to arrange the display
* objects in the display list . DisplayObjectContainer objects can have child display objects , while other display objects ,
* such as Shape and TextField objects , are "leaf" nodes that have only parents and siblings , no children .
* The DisplayObject class supports basic functionality like the x and y position of an object , as well as more advanced
* properties of the object such as its transformation matrix . < br / >
* The DisplayObject class contains several broadcast events . Normally , the target of any particular event is a specific
* DisplayObject instance . For example , the target of an added event is the specific DisplayObject instance that was added
* to the display list . Having a single target restricts the placement of event listeners to that target and in some cases
* the target ' s ancestors on the display list . With broadcast events , however , the target is not a specific DisplayObject
* instance , but rather all DisplayObject instances , including those that are not on the display list . This means that you
* can add a listener to any DisplayObject instance to listen for broadcast events .
*
* @event egret . Event . ADDED Dispatched when a display object is added to the display list .
* @event egret . Event . ADDED_TO_STAGE Dispatched when a display object is added to the on stage display list , either directly or through the addition of a sub tree in which the display object is contained .
* @event egret . Event . REMOVED Dispatched when a display object is about to be removed from the display list .
* @event egret . Event . REMOVED_FROM_STAGE Dispatched when a display object is about to be removed from the display list , either directly or through the removal of a sub tree in which the display object is contained .
* @event egret . Event . ENTER_FRAME [ broadcast event ] Dispatched when the playhead is entering a new frame .
* @event egret . Event . RENDER [ broadcast event ] Dispatched when the display list is about to be updated and rendered .
* @event egret . TouchEvent . TOUCH_MOVE Dispatched when the user touches the device , and is continuously dispatched until the point of contact is removed .
* @event egret . TouchEvent . TOUCH_BEGIN Dispatched when the user first contacts a touch - enabled device ( such as touches a finger to a mobile phone or tablet with a touch screen ) .
* @event egret . TouchEvent . TOUCH_END Dispatched when the user removes contact with a touch - enabled device ( such as lifts a finger off a mobile phone or tablet with a touch screen ) .
* @event egret . TouchEvent . TOUCH_TAP Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact was initiated on a touch - enabled device ( such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen ) .
* @event egret . TouchEvent . TOUCH_RELEASE_OUTSIDE Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact was initiated on a touch - enabled device ( such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen ) .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / DisplayObject . ts
* @language en_US
* /
/ * *
* DisplayObject 类 是 可 放 在 显 示 列 表 中 的 所 有 对 象 的 基 类 。 该 显 示 列 表 管 理 运 行 时 中 显 示 的 所 有 对 象 。 使 用 DisplayObjectContainer 类 排 列
* 显 示 列 表 中 的 显 示 对 象 。 DisplayObjectContainer 对 象 可 以 有 子 显 示 对 象 , 而 其 他 显 示 对 象 ( 如 Shape 和 TextField 对 象 ) 是 “ 叶 ” 节 点 , 没 有 子 项 , 只 有 父 级 和
* 同 级 。 DisplayObject 类 有 一 些 基 本 的 属 性 ( 如 确 定 坐 标 位 置 的 x 和 y 属 性 ) , 也 有 一 些 高 级 的 对 象 属 性 ( 如 Matrix 矩 阵 变 换 ) 。 < br / >
* DisplayObject 类 包 含 若 干 广 播 事 件 。 通 常 , 任 何 特 定 事 件 的 目 标 均 为 一 个 特 定 的 DisplayObject 实 例 。 例 如 , added 事 件 的 目 标 是 已 添 加 到 显 示 列 表
* 的 目 标 DisplayObject 实 例 。 若 只 有 一 个 目 标 , 则 会 将 事 件 侦 听 器 限 制 为 只 能 监 听 在 该 目 标 上 ( 在 某 些 情 况 下 , 可 监 听 在 显 示 列 表 中 该 目 标 的 祖 代 上 ) 。
* 但 是 对 于 广 播 事 件 , 目 标 不 是 特 定 的 DisplayObject 实 例 , 而 是 所 有 DisplayObject 实 例 ( 包 括 那 些 不 在 显 示 列 表 中 的 实 例 ) 。 这 意 味 着 您 可 以 向 任 何
* DisplayObject 实 例 添 加 侦 听 器 来 侦 听 广 播 事 件 。
*
* @event egret . Event . ADDED 将 显 示 对 象 添 加 到 显 示 列 表 中 时 调 度 。
* @event egret . Event . ADDED_TO_STAGE 在 将 显 示 对 象 直 接 添 加 到 舞 台 显 示 列 表 或 将 包 含 显 示 对 象 的 子 树 添 加 至 舞 台 显 示 列 表 中 时 调 度 。
* @event egret . Event . REMOVED 将 要 从 显 示 列 表 中 删 除 显 示 对 象 时 调 度 。
* @event egret . Event . REMOVED_FROM_STAGE 在 从 显 示 列 表 中 直 接 删 除 显 示 对 象 或 删 除 包 含 显 示 对 象 的 子 树 时 调 度 。
* @event egret . Event . ENTER_FRAME [ 广 播 事 件 ] 播 放 头 进 入 新 帧 时 调 度 。
* @event egret . Event . RENDER [ 广 播 事 件 ] 将 要 更 新 和 呈 现 显 示 列 表 时 调 度 。
* @event egret . TouchEvent . TOUCH_MOVE 当 用 户 触 碰 设 备 时 进 行 调 度 , 而 且 会 连 续 调 度 , 直 到 接 触 点 被 删 除 。
* @event egret . TouchEvent . TOUCH_BEGIN 当 用 户 第 一 次 触 摸 启 用 触 摸 的 设 备 时 ( 例 如 , 用 手 指 触 摸 手 机 屏 幕 ) 调 度 。
* @event egret . TouchEvent . TOUCH_END 当 用 户 移 除 与 启 用 触 摸 的 设 备 的 接 触 时 ( 例 如 , 将 手 指 从 屏 幕 上 抬 起 ) 调 度 。
* @event egret . TouchEvent . TOUCH_TAP 当 用 户 在 启 用 触 摸 设 备 上 的 已 启 动 接 触 的 同 一 DisplayObject 实 例 上 抬 起 接 触 点 时 ( 例 如 , 手 机 点 击 屏 幕 后 抬 起 ) 调 度 。
* @event egret . TouchEvent . TOUCH_RELEASE_OUTSIDE 当 用 户 在 启 用 触 摸 设 备 上 的 已 启 动 接 触 的 不 同 DisplayObject 实 例 上 抬 起 接 触 点 时 ( 例 如 , 按 住 屏 幕 上 的 某 个 对 象 , 然 后 从 它 上 面 挪 开 后 再 松 开 手 指 ) 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / DisplayObject . ts
* @language zh_CN
* /
class DisplayObject extends EventDispatcher {
/ * *
* Initializes a DisplayObject object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 显 示 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
$nativeDisplayObject : egret_native.NativeDisplayObject ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* 是 否 添 加 到 舞 台 上 , 防 止 重 复 发 送 removed_from_stage 消 息
* /
$hasAddToStage : boolean ;
/ * *
* @private
* 能 够 含 有 子 项 的 类 将 子 项 列 表 存 储 在 这 个 属 性 里 。
* /
$children : DisplayObject [ ] ;
private $name ;
/ * *
* Indicates the instance name of the DisplayObject . The object can be identified in the child list of its parent
* display object container by calling the getChildByName ( ) method of the display object container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 DisplayObject 的 实 例 名 称 。
* 通 过 调 用 父 显 示 对 象 容 器 的 getChildByName ( ) 方 法 , 可 以 在 父 显 示 对 象 容 器 的 子 列 表 中 标 识 该 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
name : string ;
/ * *
* @private
* /
$parent : DisplayObjectContainer ;
/ * *
* Indicates the DisplayObjectContainer object that contains this display object . Use the parent property to specify
* a relative path to display objects that are above the current display object in the display list hierarchy .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 包 含 此 显 示 对 象 的 DisplayObjectContainer 对 象 。
* 使 用 parent 属 性 可 以 指 定 高 于 显 示 列 表 层 次 结 构 中 当 前 显 示 对 象 的 显 示 对 象 的 相 对 路 径 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly parent : DisplayObjectContainer ;
/ * *
* @private
* 设 置 父 级 显 示 对 象
* /
$setParent ( parent : DisplayObjectContainer ) : void ;
/ * *
* @private
* 显 示 对 象 添 加 到 舞 台
* /
$onAddToStage ( stage : Stage , nestLevel : number ) : void ;
/ * *
* @private
* 显 示 对 象 从 舞 台 移 除
* /
$onRemoveFromStage ( ) : void ;
/ * *
* @private
* /
$stage : Stage ;
/ * *
* @private
* 这 个 对 象 在 显 示 列 表 中 的 嵌 套 深 度 , 舞 台 为 1 , 它 的 子 项 为 2 , 子 项 的 子 项 为 3 , 以 此 类 推 。 当 对 象 不 在 显 示 列 表 中 时 此 属 性 值 为 0 .
* /
$nestLevel : number ;
$useTranslate : boolean ;
protected $updateUseTransform ( ) : void ;
/ * *
* The Stage of the display object . you can create and load multiple display objects into the display list , and
* the stage property of each display object refers to the same Stage object . < br / >
* If a display object is not added to the display list , its stage property is set to null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 显 示 对 象 的 舞 台 。
* 例 如 , 您 可 以 创 建 多 个 显 示 对 象 并 加 载 到 显 示 列 表 中 , 每 个 显 示 对 象 的 stage 属 性 是 指 向 相 同 的 Stage 对 象 。 < br / >
* 如 果 显 示 对 象 未 添 加 到 显 示 列 表 , 则 其 stage 属 性 会 设 置 为 null 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly stage : Stage ;
/ * *
* A Matrix object containing values that alter the scaling , rotation , and translation of the display object . < br / >
* Note : to change the value of a display object ' s matrix , you must make a copy of the entire matrix object , then copy
* the new object into the matrix property of the display object .
* @example the following code increases the tx value of a display object ' s matrix
* < pre >
* let myMatrix :Matrix = myDisplayObject . matrix ;
* myMatrix . tx += 10 ;
* myDisplayObject . matrix = myMatrix ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 Matrix 对 象 , 其 中 包 含 更 改 显 示 对 象 的 缩 放 、 旋 转 和 平 移 的 值 。 < br / >
* 注 意 : 要 改 变 一 个 显 示 对 象 矩 阵 的 值 , 您 必 引 用 整 个 矩 阵 对 象 , 然 后 将 它 重 新 赋 值 给 显 示 对 象 的 matrix 属 性 。
* @example 以 下 代 码 改 变 了 显 示 对 象 矩 阵 的 tx属性值 :
* < pre >
* let myMatrix :Matrix = myDisplayObject . matrix ;
* myMatrix . tx += 10 ;
* myDisplayObject . matrix = myMatrix ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
matrix : Matrix ;
private $matrix ;
private $matrixDirty ;
/ * *
* @private
* 获 取 矩 阵
* /
$getMatrix ( ) : Matrix ;
/ * *
* @private
* 设 置 矩 阵
* /
$setMatrix ( matrix : Matrix , needUpdateProperties? : boolean ) : void ;
private $concatenatedMatrix ;
/ * *
* @private
* 获 得 这 个 显 示 对 象 以 及 它 所 有 父 级 对 象 的 连 接 矩 阵 。
* /
$getConcatenatedMatrix ( ) : Matrix ;
private $invertedConcatenatedMatrix ;
/ * *
* @private
* 获 取 链 接 矩 阵
* /
$getInvertedConcatenatedMatrix ( ) : Matrix ;
$x : number ;
/ * *
* Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent
* DisplayObjectContainer . < br / >
* If the object is inside a DisplayObjectContainer that has transformations , it is in
* the local coordinate system of the enclosing DisplayObjectContainer . Thus , for a DisplayObjectContainer
* rotated 90 ° counterclockwise , the DisplayObjectContainer ' s children inherit a coordinate system that is
* rotated 90 ° counterclockwise . The object ' s coordinates refer to the registration point position .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 DisplayObject 实 例 相 对 于 父 级 DisplayObjectContainer 本 地 坐 标 的 x 坐 标 。 < br / >
* 如 果 该 对 象 位 于 具 有 变 形 的 DisplayObjectContainer 内 , 则 它 也 位 于 包 含 DisplayObjectContainer 的 本 地 坐 标 系 中 。
* 因 此 , 对 于 逆 时 针 旋 转 90 度 的 DisplayObjectContainer , 该 DisplayObjectContainer 的 子 级 将 继 承 逆 时 针 旋 转 90 度 的 坐 标 系 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
x : number ;
/ * *
* @private
* 获 取 x坐标
* /
$getX ( ) : number ;
/ * *
* @private
* 设 置 x坐标
* /
$setX ( value : number ) : boolean ;
$y : number ;
/ * *
* Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent
* DisplayObjectContainer . < br / >
* If the object is inside a DisplayObjectContainer that has transformations , it is in
* the local coordinate system of the enclosing DisplayObjectContainer . Thus , for a DisplayObjectContainer rotated
* 90 ° counterclockwise , the DisplayObjectContainer ' s children inherit a coordinate system that is rotated 90 °
* counterclockwise . The object ' s coordinates refer to the registration point position .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 DisplayObject 实 例 相 对 于 父 级 DisplayObjectContainer 本 地 坐 标 的 y 坐 标 。 < br / >
* 如 果 该 对 象 位 于 具 有 变 形 的 DisplayObjectContainer 内 , 则 它 也 位 于 包 含 DisplayObjectContainer 的 本 地 坐 标 系 中 。
* 因 此 , 对 于 逆 时 针 旋 转 90 度 的 DisplayObjectContainer , 该 DisplayObjectContainer 的 子 级 将 继 承 逆 时 针 旋 转 90 度 的 坐 标 系 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
y : number ;
/ * *
* @private
* 获 取 y坐标
* /
$getY ( ) : number ;
/ * *
* @private
* 设 置 y坐标
* /
$setY ( value : number ) : boolean ;
private $scaleX ;
/ * *
* Indicates the horizontal scale ( percentage ) of the object as applied from the registration point . < br / >
* The default 1.0 equals 100 % scale .
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 从 注 册 点 开 始 应 用 的 对 象 的 水 平 缩 放 比 例 ( 百 分 比 ) 。 < br / >
* 1.0 等 于 100 % 缩 放 。
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
scaleX : number ;
/ * *
* @private
*
* @returns
* /
$getScaleX ( ) : number ;
/ * *
* @private
* 设 置 水 平 缩 放 值
* /
$setScaleX ( value : number ) : void ;
private $scaleY ;
/ * *
* Indicates the vertical scale ( percentage ) of an object as applied from the registration point of the object .
* 1.0 is 100 % scale .
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 从 对 象 注 册 点 开 始 应 用 的 对 象 的 垂 直 缩 放 比 例 ( 百 分 比 ) 。 1.0 是 100 % 缩 放 。
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
scaleY : number ;
/ * *
* @private
*
* @returns
* /
$getScaleY ( ) : number ;
/ * *
* @private
* 设 置 垂 直 缩 放 值
* /
$setScaleY ( value : number ) : void ;
private $rotation ;
/ * *
* Indicates the rotation of the DisplayObject instance , in degrees , from its original orientation . Values from
* 0 to 180 represent clockwise rotation ; values from 0 to - 180 represent counterclockwise rotation . Values outside
* this range are added to or subtracted from 360 to obtain a value within the range . For example , the statement
* myDisplayObject . rotation = 450 is the same as myDisplayObject . rotation = 90 .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 DisplayObject 实 例 距 其 原 始 方 向 的 旋 转 程 度 , 以 度 为 单 位 。
* 从 0 到 180 的 值 表 示 顺 时 针 方 向 旋 转 ; 从 0 到 - 180 的 值 表 示 逆 时 针 方 向 旋 转 。 对 于 此 范 围 之 外 的 值 , 可 以 通 过 加 上 或
* 减 去 360 获 得 该 范 围 内 的 值 。 例 如 , myDisplayObject . rotation = 450 语 句 与 myDisplayObject . rotation = 90 是 相 同 的 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
rotation : number ;
/ * *
* @private
* /
$getRotation ( ) : number ;
$setRotation ( value : number ) : void ;
private $skewX ;
private $skewXdeg ;
/ * *
* 表 示 DisplayObject的x方向斜切
* @member { number } egret . DisplayObject # skewX
* @default 0
* @version Egret 2.4
* @platform Web , Native
* /
skewX : number ;
/ * *
* @private
*
* @param value
* /
$setSkewX ( value : number ) : void ;
private $skewY ;
private $skewYdeg ;
/ * *
* 表 示 DisplayObject的y方向斜切
* @member { number } egret . DisplayObject # skewY
* @default 0
* @version Egret 2.4
* @platform Web , Native
* /
skewY : number ;
/ * *
* @private
*
* @param value
* /
$setSkewY ( value : number ) : void ;
/ * *
* Indicates the width of the display object , in pixels . The width is calculated based on the bounds of the content
* of the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 显 示 对 象 的 宽 度 , 以 像 素 为 单 位 。 宽 度 是 根 据 显 示 对 象 内 容 的 范 围 来 计 算 的 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
width : number ;
/ * *
* @private
* 获 取 显 示 宽 度
* /
$getWidth ( ) : number ;
$explicitWidth : number ;
/ * *
* @private
* 设 置 显 示 宽 度
* /
$setWidth ( value : number ) : void ;
/ * *
* Indicates the height of the display object , in pixels . The height is calculated based on the bounds of the
* content of the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 显 示 对 象 的 高 度 , 以 像 素 为 单 位 。 高 度 是 根 据 显 示 对 象 内 容 的 范 围 来 计 算 的 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
height : number ;
$explicitHeight : number ;
/ * *
* @private
* 获 取 显 示 高 度
* /
$getHeight ( ) : number ;
/ * *
* @private
* 设 置 显 示 高 度
* /
$setHeight ( value : number ) : void ;
/ * *
* 测 量 宽 度
* @returns { number }
* @member { egret . Rectangle } egret . DisplayObject # measuredWidth
* @version Egret 2.4
* @platform Web , Native
* /
readonly measuredWidth : number ;
/ * *
* 测 量 高 度
* @returns { number }
* @member { egret . Rectangle } egret . DisplayObject # measuredWidth
* @version Egret 2.4
* @platform Web , Native
* /
readonly measuredHeight : number ;
$anchorOffsetX : number ;
/ * *
* X represents the object of which is the anchor .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 从 对 象 绝 对 锚 点 X 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
anchorOffsetX : number ;
/ * *
* @private
*
* @param value
* @returns
* /
$setAnchorOffsetX ( value : number ) : void ;
$anchorOffsetY : number ;
/ * *
* Y represents the object of which is the anchor .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 从 对 象 绝 对 锚 点 Y 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
anchorOffsetY : number ;
/ * *
* @private
*
* @param value
* @returns
* /
$setAnchorOffsetY ( value : number ) : void ;
/ * *
* @private
* /
$visible : boolean ;
/ * *
* Whether or not the display object is visible . Display objects that are not visible are disabled . For example ,
* if visible = false for an DisplayObject instance , it cannot receive touch or other user input .
* @default true
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 显 示 对 象 是 否 可 见 。 不 可 见 的 显 示 对 象 将 被 禁 用 。 例 如 , 如 果 实 例 的 visible 为 false , 则 无 法 接 受 触 摸 或 用 户 交 互 操 作 。
* @default true
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
visible : boolean ;
$setVisible ( value : boolean ) : void ;
/ * *
* @private
* cacheAsBitmap创建的缓存位图节点 。
* /
$displayList : egret.sys.DisplayList ;
private $cacheAsBitmap ;
/ * *
* If set to true , Egret runtime caches an internal bitmap representation of the display object . This caching can
* increase performance for display objects that contain complex vector content . After you set the cacheAsBitmap
* property to true , the rendering does not change , however the display object performs pixel snapping automatically .
* The execution speed can be significantly faster depending on the complexity of the content . The cacheAsBitmap
* property is best used with display objects that have mostly static content and that do not scale and rotate frequently . < br / >
* Note : The display object will not create the bitmap caching when the memory exceeds the upper limit , even if you set it to true .
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 设 置 为 true , 则 Egret 运 行 时 将 缓 存 显 示 对 象 的 内 部 位 图 表 示 形 式 。 此 缓 存 可 以 提 高 包 含 复 杂 矢 量 内 容 的 显 示 对 象 的 性 能 。
* 将 cacheAsBitmap 属 性 设 置 为 true 后 , 呈 现 并 不 更 改 , 但 是 , 显 示 对 象 将 自 动 执 行 像 素 贴 紧 。 执 行 速 度 可 能 会 大 大 加 快 ,
* 具 体 取 决 于 显 示 对 象 内 容 的 复 杂 性 。 最 好 将 cacheAsBitmap 属 性 与 主 要 具 有 静 态 内 容 且 不 频 繁 缩 放 或 旋 转 的 显 示 对 象 一 起 使 用 。 < br / >
* 注 意 : 在 内 存 超 过 上 限 的 情 况 下 , 即 使 将 cacheAsBitmap 属 性 设 置 为 true , 显 示 对 象 也 不 使 用 位 图 缓 存 。
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
cacheAsBitmap : boolean ;
$setHasDisplayList ( value : boolean ) : void ;
$cacheDirty : boolean ;
$cacheDirtyUp ( ) : void ;
/ * *
* @private
* /
$alpha : number ;
/ * *
* Indicates the alpha transparency value of the object specified . Valid values are 0 ( fully transparent ) to 1 ( fully opaque ) .
* The default value is 1 . Display objects with alpha set to 0 are active , even though they are invisible .
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 指 定 对 象 的 Alpha 透 明 度 值 。
* 有 效 值 为 0 ( 完 全 透 明 ) 到 1 ( 完 全 不 透 明 ) 。 alpha 设 置 为 0 的 显 示 对 象 是 可 触 摸 的 , 即 使 它 们 不 可 见 。
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
alpha : number ;
/ * *
* @private
*
* @param value
* /
$setAlpha ( value : number ) : void ;
/ * *
* @private
* The default touchEnabled property of DisplayObject
* @default false
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* @private
* 显 示 对 象 默 认 的 touchEnabled 属 性
* @default false
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
static defaultTouchEnabled : boolean ;
$touchEnabled : boolean ;
/ * *
* Specifies whether this object receives touch or other user input . The default value is false , which means that
* by default any DisplayObject instance that is on the display list cannot receive touch events . If touchEnabled is
* set to false , the instance does not receive any touch events ( or other user input events ) . Any children of
* this instance on the display list are not affected . To change the touchEnabled behavior for all children of
* an object on the display list , use DisplayObjectContainer . touchChildren .
* @see egret . DisplayObjectContainer # touchChildren
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 定 此 对 象 是 否 接 收 触 摸 或 其 他 用 户 输 入 。 默 认 值 为 false , 这 表 示 默 认 情 况 下 , 显 示 列 表 上 的 任 何 DisplayObject 实 例 都 不 会 接 收 触 摸 事 件 或
* 其 他 用 户 输 入 事 件 。 如 果 将 touchEnabled 设 置 为 false , 则 实 例 将 不 接 收 任 何 触 摸 事 件 ( 或 其 他 用 户 输 入 事 件 ) 。 显 示 列 表 上 的 该 实 例 的 任
* 何 子 级 都 不 会 受 到 影 响 。 要 更 改 显 示 列 表 上 对 象 的 所 有 子 级 的 touchEnabled 行 为 , 请 使 用 DisplayObjectContainer . touchChildren 。
* @see egret . DisplayObjectContainer # touchChildren
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
touchEnabled : boolean ;
/ * *
* @private
* /
$getTouchEnabled ( ) : boolean ;
/ * *
* @private
* /
$setTouchEnabled ( value : boolean ) : void ;
/ * *
* @private
* /
$scrollRect : Rectangle ;
/ * *
* The scroll rectangle bounds of the display object . The display object is cropped to the size defined by the rectangle ,
* and it scrolls within the rectangle when you change the x and y properties of the scrollRect object . A scrolled display
* object always scrolls in whole pixel increments . You can scroll an object left and right by setting the x property of
* the scrollRect Rectangle object . You can scroll an object up and down by setting the y property of the scrollRect
* Rectangle object . If the display object is rotated 90 ° and you scroll it left and right , the display object actually
* scrolls up and down . < br / >
*
* Note : to change the value of a display object ' s scrollRect , you must make a copy of the entire scrollRect object , then copy
* the new object into the scrollRect property of the display object .
* @example the following code increases the x value of a display object ' s scrollRect
* < pre >
* let myRectangle :Rectangle = myDisplayObject . scrollRect ;
* myRectangle . x += 10 ;
* myDisplayObject . scrollRect = myRectangle ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 显 示 对 象 的 滚 动 矩 形 范 围 。 显 示 对 象 被 裁 切 为 矩 形 定 义 的 大 小 , 当 您 更 改 scrollRect 对 象 的 x 和 y 属 性 时 , 它 会 在 矩 形 内 滚 动 。
* 滚 动 的 显 示 对 象 始 终 以 整 像 素 为 增 量 进 行 滚 动 。 您 可 以 通 过 设 置 scrollRect Rectangle 对 象 的 x 属 性 来 左 右 滚 动 对 象 , 还 可 以 通 过 设 置
* scrollRect 对 象 的 y 属 性 来 上 下 滚 动 对 象 。 如 果 显 示 对 象 旋 转 了 90 度 , 并 且 您 左 右 滚 动 它 , 则 实 际 上 显 示 对 象 会 上 下 滚 动 。 < br / >
*
* 注 意 : 要 改 变 一 个 显 示 对 象 scrollRect 属 性 的 值 , 您 必 引 用 整 个 scrollRect 对 象 , 然 后 将 它 重 新 赋 值 给 显 示 对 象 的 scrollRect 属 性 。
* @example 以 下 代 码 改 变 了 显 示 对 象 scrollRect 的 x 属 性 值 :
* < pre >
* let myRectangle :Rectangle = myDisplayObject . scrollRect ;
* myRectangle . x += 10 ;
* myDisplayObject . scrollRect = myRectangle ; //设置完scrollRect的x、y、width、height值之后, 一定要对myDisplayObject重新赋值scrollRect, 不然会出问题。
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
scrollRect : Rectangle ;
/ * *
* @private
*
* @param value
* /
private $setScrollRect ( value ) ;
/ * *
* @private
* /
$blendMode : number ;
/ * *
* A value from the BlendMode class that specifies which blend mode to use . Determine how a source image ( new one )
* is drawn on the target image ( old one ) . < br / >
* If you attempt to set this property to an invalid value , Egret runtime set the value to BlendMode . NORMAL .
* @default egret . BlendMode . NORMAL
* @see egret . BlendMode
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* BlendMode 枚 举 中 的 一 个 值 , 用 于 指 定 要 使 用 的 混 合 模 式 , 确 定 如 何 将 一 个 源 ( 新 的 ) 图 像 绘 制 到 目 标 ( 已 有 ) 的 图 像 上 < br / >
* 如 果 尝 试 将 此 属 性 设 置 为 无 效 值 , 则 运 行 时 会 将 此 值 设 置 为 BlendMode . NORMAL 。
* @default egret . BlendMode . NORMAL
* @see egret . BlendMode
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
blendMode : string ;
/ * *
* @private
* 被 遮 罩 的 对 象
* /
$maskedObject : DisplayObject ;
/ * *
* @private
* /
$mask : DisplayObject ;
/ * *
* @private
* /
$maskRect : Rectangle ;
/ * *
* The calling display object is masked by the specified mask object . To ensure that masking works when the Stage
* is scaled , the mask display object must be in an active part of the display list . The mask object itself is not drawn .
* Set mask to null to remove the mask . To be able to scale a mask object , it must be on the display list . To be
* able to drag a mask object , it must be on the display list . < br / >
* Note : A single mask object cannot be used to mask more than one calling display object . When the mask is assigned
* to a second display object , it is removed as the mask of the first object , and that object ' s mask property becomes null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 调 用 显 示 对 象 被 指 定 的 mask 对 象 遮 罩 。 要 确 保 当 舞 台 缩 放 时 蒙 版 仍 然 有 效 , mask 显 示 对 象 必 须 处 于 显 示 列 表 的 活 动 部 分 。
* 但 不 绘 制 mask 对 象 本 身 。 将 mask 设 置 为 null 可 删 除 蒙 版 。 要 能 够 缩 放 遮 罩 对 象 , 它 必 须 在 显 示 列 表 中 。 要 能 够 拖 动 蒙 版
* 对 象 , 它 必 须 在 显 示 列 表 中 。 < br / >
* 注 意 : 单 个 mask 对 象 不 能 用 于 遮 罩 多 个 执 行 调 用 的 显 示 对 象 。 在 将 mask 分 配 给 第 二 个 显 示 对 象 时 , 会 撤 消 其 作 为 第 一 个 对 象 的 遮 罩 ,
* 该 对 象 的 mask 属 性 将 变 为 null 。
*
* 下 面 例 子 为 mask 为 Rectangle 类 型 对 象 , 这 种 情 况 下 , 修 改 mask 的 值 后 , 一 定 要 对 myDisplayObject 重 新 赋 值 mask , 不 然 会 出 问 题 。
* @example 以 下 代 码 改 变 了 显 示 对 象 mask 的 x 属 性 值 :
* < pre >
* let myMask :Rectangle = myDisplayObject . mask ;
* myMask . x += 10 ;
* myDisplayObject . mask = myMask ; //设置完 mask 的x、y、width、height值之后, 一定要对myDisplayObject重新赋值 mask, 不然会出问题。
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
mask : DisplayObject | Rectangle ;
private $setMaskRect ( value ) ;
$filters : Array < Filter | CustomFilter > ;
/ * *
* An indexed array that contains each filter object currently associated with the display object .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 包 含 当 前 与 显 示 对 象 关 联 的 每 个 滤 镜 对 象 的 索 引 数 组 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
filters : Array < Filter | CustomFilter > ;
/ * *
* Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object .
* @param targetCoordinateSpace The display object that defines the coordinate system to use .
* @param resultRect A reusable instance of Rectangle for saving the results . Passing this parameter can reduce the number of reallocate objects
* , which allows you to get better code execution performance . .
* @returns The rectangle that defines the area of the display object relative to the targetCoordinateSpace object ' s coordinate system .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 一 个 矩 形 , 该 矩 形 定 义 相 对 于 targetCoordinateSpace 对 象 坐 标 系 的 显 示 对 象 区 域 。
* @param targetCoordinateSpace 定 义 要 使 用 的 坐 标 系 的 显 示 对 象 。
* @param resultRect 一 个 用 于 存 储 结 果 的 可 复 用 Rectangle实例 , 传 入 此 参 数 能 够 减 少 内 部 创 建 对 象 的 次 数 , 从 而 获 得 更 高 的 运 行 性 能 。
* @returns 定 义 与 targetCoordinateSpace 对 象 坐 标 系 统 相 关 的 显 示 对 象 面 积 的 矩 形 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getTransformedBounds ( targetCoordinateSpace : DisplayObject , resultRect? : Rectangle ) : Rectangle ;
/ * *
* Obtain measurement boundary of display object
* @param resultRect { Rectangle } Optional . It is used to import Rectangle object for saving results , preventing duplicate object creation .
* @param calculateAnchor { boolean } Optional . It is used to determine whether to calculate anchor point .
* @returns { Rectangle }
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 显 示 对 象 的 测 量 边 界
* @param resultRect { Rectangle } 可 选 参 数 , 传 入 用 于 保 存 结 果 的 Rectangle对象 , 避 免 重 复 创 建 对 象 。
* @param calculateAnchor { boolean } 可 选 参 数 , 是 否 会 计 算 锚 点 。
* @returns { Rectangle }
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getBounds ( resultRect? : Rectangle , calculateAnchor? : boolean ) : egret . Rectangle ;
/ * *
* @private
* /
$getTransformedBounds ( targetCoordinateSpace : DisplayObject , resultRect? : Rectangle ) : Rectangle ;
/ * *
* Converts the point object from the Stage ( global ) coordinates to the display object ' s ( local ) coordinates .
* @param stageX the x value in the global coordinates
* @param stageY the y value in the global coordinates
* @param resultPoint A reusable instance of Point for saving the results . Passing this parameter can reduce the
* number of reallocate objects , which allows you to get better code execution performance .
* @returns A Point object with coordinates relative to the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 从 舞 台 ( 全 局 ) 坐 标 转 换 为 显 示 对 象 的 ( 本 地 ) 坐 标 。
* @param stageX 舞 台 坐 标 x
* @param stageY 舞 台 坐 标 y
* @param resultPoint 一 个 用 于 存 储 结 果 的 可 复 用 Point 实 例 , 传 入 此 参 数 能 够 减 少 内 部 创 建 对 象 的 次 数 , 从 而 获 得 更 高 的 运 行 性 能 。
* @returns 具 有 相 对 于 显 示 对 象 的 坐 标 的 Point 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
globalToLocal ( stageX? : number , stageY? : number , resultPoint? : Point ) : Point ;
/ * *
* Converts the point object from the display object ' s ( local ) coordinates to the Stage ( global ) coordinates .
* @param localX the x value in the local coordinates
* @param localY the x value in the local coordinates
* @param resultPoint A reusable instance of Point for saving the results . Passing this parameter can reduce the
* number of reallocate objects , which allows you to get better code execution performance .
* @returns A Point object with coordinates relative to the Stage .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 显 示 对 象 的 ( 本 地 ) 坐 标 转 换 为 舞 台 ( 全 局 ) 坐 标 。
* @param localX 本 地 坐 标 x
* @param localY 本 地 坐 标 y
* @param resultPoint 一 个 用 于 存 储 结 果 的 可 复 用 Point 实 例 , 传 入 此 参 数 能 够 减 少 内 部 创 建 对 象 的 次 数 , 从 而 获 得 更 高 的 运 行 性 能 。
* @returns 一 个 具 有 相 对 于 舞 台 坐 标 的 Point 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
localToGlobal ( localX? : number , localY? : number , resultPoint? : Point ) : Point ;
/ * *
* @private
* 获 取 显 示 对 象 占 用 的 矩 形 区 域 集 合 , 通 常 包 括 自 身 绘 制 的 测 量 区 域 , 如 果 是 容 器 , 还 包 括 所 有 子 项 占 据 的 区 域 。
* /
$getOriginalBounds ( ) : Rectangle ;
/ * *
* @private
* 测 量 子 项 占 用 的 矩 形 区 域
* @param bounds 测 量 结 果 存 储 在 这 个 矩 形 对 象 内
* /
$measureChildBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
* /
$getContentBounds ( ) : Rectangle ;
/ * *
* @private
* 测 量 自 身 占 用 的 矩 形 区 域 , 注 意 : 此 测 量 结 果 并 不 包 括 子 项 占 据 的 区 域 。
* @param bounds 测 量 结 果 存 储 在 这 个 矩 形 对 象 内
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
* /
$parentDisplayList : egret.sys.DisplayList ;
/ * *
* @private
* 渲 染 节 点 , 不 为 空 表 示 自 身 有 绘 制 到 屏 幕 的 内 容
* /
$renderNode : sys.RenderNode ;
$renderDirty : boolean ;
/ * *
* @private
* 获 取 渲 染 节 点
* /
$getRenderNode ( ) : sys . RenderNode ;
$updateRenderMode ( ) : void ;
$renderMode : RenderMode ;
/ * *
* @private
* /
private $measureFiltersOffset ( fromParent ) ;
/ * *
* @private
* 获 取 相 对 于 指 定 根 节 点 的 连 接 矩 阵 。
* @param root 根 节 点 显 示 对 象
* @param matrix 目 标 显 示 对 象 相 对 于 舞 台 的 完 整 连 接 矩 阵 。
* /
$getConcatenatedMatrixAt ( root : DisplayObject , matrix : Matrix ) : void ;
/ * *
* @private
* 更 新 renderNode
* /
$updateRenderNode ( ) : void ;
/ * *
* @private
* /
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
/ * *
* Calculate the display object to determine whether it overlaps or crosses with the points specified by the x and y parameters . The x and y parameters specify the points in the coordinates of the stage , rather than the points in the display object container that contains display objects ( except the situation where the display object container is a stage ) .
* Note : Don ' t use accurate pixel collision detection on a large number of objects . Otherwise , this will cause serious performance deterioration .
* @param x { number } x coordinate of the object to be tested .
* @param y { number } y coordinate of the object to be tested .
* @param shapeFlag { boolean } Whether to check the actual pixel of object ( true ) or check that of border ( false ) . Write realized .
* @returns { boolean } If display object overlaps or crosses with the specified point , it is true ; otherwise , it is false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 计 算 显 示 对 象 , 以 确 定 它 是 否 与 x 和 y 参 数 指 定 的 点 重 叠 或 相 交 。 x 和 y 参 数 指 定 舞 台 的 坐 标 空 间 中 的 点 , 而 不 是 包 含 显 示 对 象 的 显 示 对 象 容 器 中 的 点 ( 除 非 显 示 对 象 容 器 是 舞 台 ) 。
* 注 意 , 不 要 在 大 量 物 体 中 使 用 精 确 碰 撞 像 素 检 测 , 这 回 带 来 巨 大 的 性 能 开 销
* @param x { number } 要 测 试 的 此 对 象 的 x 坐 标 。
* @param y { number } 要 测 试 的 此 对 象 的 y 坐 标 。
* @param shapeFlag { boolean } 是 检 查 对 象 ( true ) 的 实 际 像 素 , 还 是 检 查 边 框 ( false ) 的 实 际 像 素 。
* @returns { boolean } 如 果 显 示 对 象 与 指 定 的 点 重 叠 或 相 交 , 则 为 true ; 否 则 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
hitTestPoint ( x : number , y : number , shapeFlag? : boolean ) : boolean ;
/ * *
* @private
* /
static $enterFrameCallBackList : DisplayObject [ ] ;
/ * *
* @private
* /
static $renderCallBackList : DisplayObject [ ] ;
/ * *
* @private
* /
$addListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number , dispatchOnce? : boolean ) : void ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
removeEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean ) : void ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
dispatchEvent ( event : Event ) : boolean ;
/ * *
* @private
* 获 取 事 件 流 列 表 。 注 意 : Egret框架的事件流与Flash实现并不一致 。
*
* 事 件 流 有 三 个 阶 段 : 捕 获 , 目 标 , 冒 泡 。
* Flash里默认的的事件监听若不开启useCapture将监听目标和冒泡阶段 。 若 开 始 capture将只能监听捕获当不包括目标的事件 。
* 可 以 在 Flash中写一个简单的测试 : 实 例 化 一 个 非 容 器 显 示 对 象 , 例 如 TextField 。 分 别 监 听 useCapture为true和false时的鼠标事件 。
* 点 击 后 将 只 有 useCapture为false的回调函数输出信息 。 也 就 带 来 一 个 问 题 「 Flash的捕获阶段不能监听到最内层对象本身 , 只 在 父 级 列 表 有 效 」 。
*
* 而 HTML里的事件流设置useCapture为true时是能监听到目标阶段的 , 也 就 是 目 标 阶 段 会 被 触 发 两 次 , 在 捕 获 和 冒 泡 过 程 各 触 发 一 次 。 这 样 可 以 避 免
* 前 面 提 到 的 监 听 捕 获 无 法 监 听 目 标 本 身 的 问 题 。
*
* Egret最终采用了HTML里目标节点触发两次的事件流方式 。
* /
$getPropagationList ( target : DisplayObject ) : DisplayObject [ ] ;
/ * *
* @private
* /
$dispatchPropagationEvent ( event : Event , list : DisplayObject [ ] , targetIndex : number ) : void ;
/ * *
* @inheritDoc
* @version Egret 2.4
* @platform Web , Native
* /
willTrigger ( type : string ) : boolean ;
/ * *
* inspired by pixi . js
* /
private _tint ;
/ * *
* @private
* /
$tintRGB : number ;
/ * *
* Set a tint color for the current object
* @version Egret 5.2 . 24
* @platform Web , Native
* @language en_US
* /
/ * *
* 给 当 前 对 象 设 置 填 充 色
* @version Egret 5.2 . 24
* @platform Web , Native
* @language zh_CN
* /
tint : number ;
/ * *
* @private
* inspired by pixi . js
* /
$sortDirty : boolean ;
sortChildren ( ) : void ;
/ * *
* @private
* /
private _zIndex ;
/ * *
* the z - order ( front - to - back order ) of the object
* @version Egret 5.2 . 24
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 对 象 的 Z 轴 顺 序 ( 前 后 顺 序 )
* @version Egret 5.2 . 24
* @platform Web , Native
* @language zh_CN
* /
zIndex : number ;
/ * *
* @private
* /
$lastSortedIndex : number ;
/ * *
* Allow objects to use zIndex sorting
* @version Egret 5.2 . 24
* @platform Web , Native
* @language en_US
* /
/ * *
* 允 许 对 象 使 用 zIndex 排 序
* @version Egret 5.2 . 24
* @platform Web , Native
* @language zh_CN
* /
sortableChildren : boolean ;
}
}
declare namespace egret {
let $TextureScaleFactor : number ;
/ * *
* The Texture class encapsulates different image resources on different platforms .
* In HTML5 , resource is an HTMLElement object
* In OpenGL / WebGL , resource is a texture ID obtained after the GPU is submitted
* The Texture class encapsulates the details implemented on the underlayer . Developers just need to focus on interfaces
* @see http : //edn.egret.com/cn/docs/page/135 The use of texture packs
* @see http : //edn.egret.com/cn/docs/page/123 Several ways of access to resources
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Texture . ts
* @language en_US
* /
/ * *
* 纹 理 类 是 对 不 同 平 台 不 同 的 图 片 资 源 的 封 装
* 在 HTML5中 , 资 源 是 一 个 HTMLElement对象
* 在 OpenGL / WebGL中 , 资 源 是 一 个 提 交 GPU后获取的纹理id
* Texture类封装了这些底层实现的细节 , 开 发 者 只 需 要 关 心 接 口 即 可
* @see http : //edn.egret.com/cn/docs/page/135 纹理集的使用
* @see http : //edn.egret.com/cn/docs/page/123 获取资源的几种方式
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Texture . ts
* @language zh_CN
* /
class Texture extends HashObject {
/ * *
* Create an egret . Texture object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . Texture 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
/ * *
* Whether to destroy the corresponding BitmapData when the texture is destroyed
* @version Egret 5.0 . 8
* @platform Web , Native
* @language en_US
* /
/ * *
* 销 毁 纹 理 时 是 否 销 毁 对 应 BitmapData
* @version Egret 5.0 . 8
* @platform Web , Native
* @language zh_CN
* /
disposeBitmapData : boolean ;
/ * *
* @private
* 表 示 这 个 纹 理 在 bitmapData 上 的 x 起 始 位 置
* /
$bitmapX : number ;
/ * *
* @private
* 表 示 这 个 纹 理 在 bitmapData 上 的 y 起 始 位 置
* /
$bitmapY : number ;
/ * *
* @private
* 表 示 这 个 纹 理 在 bitmapData 上 的 宽 度
* /
$bitmapWidth : number ;
/ * *
* @private
* 表 示 这 个 纹 理 在 bitmapData 上 的 高 度
* /
$bitmapHeight : number ;
/ * *
* @private
* 表 示 这 个 纹 理 显 示 了 之 后 在 x 方 向 的 渲 染 偏 移 量
* /
$offsetX : number ;
/ * *
* @private
* 表 示 这 个 纹 理 显 示 了 之 后 在 y 方 向 的 渲 染 偏 移 量
* /
$offsetY : number ;
/ * *
* @private
* 纹 理 宽 度
* /
private $textureWidth ;
/ * *
* Texture width , read only
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 纹 理 宽 度 , 只 读 属 性 , 不 可 以 设 置
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textureWidth : number ;
$getTextureWidth ( ) : number ;
/ * *
* @private
* 纹 理 高 度
* /
private $textureHeight ;
/ * *
* Texture height , read only
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 纹 理 高 度 , 只 读 属 性 , 不 可 以 设 置
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textureHeight : number ;
$getTextureHeight ( ) : number ;
$getScaleBitmapWidth ( ) : number ;
$getScaleBitmapHeight ( ) : number ;
/ * *
* @private
* 表 示 bitmapData . width
* /
$sourceWidth : number ;
/ * *
* @private
* 表 示 bitmapData . height
* /
$sourceHeight : number ;
/ * *
* @private
* /
$bitmapData : BitmapData ;
/ * *
* @private
* /
$ktxData : ArrayBuffer ;
/ * *
* @private
* /
$rotated : boolean ;
/ * *
* The BitmapData object being referenced .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 被 引 用 的 BitmapData 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bitmapData : BitmapData ;
/ * *
* Set the BitmapData object .
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 BitmapData 对 象 。
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
_setBitmapData ( value : BitmapData ) : void ;
/ * *
* The KTX object being referenced .
* @version Egret 5.2 . 21
* @platform Web , Native
* @language en_US
* /
/ * *
* 被 引 用 的 KTXData 对 象 。
* @version Egret 5.2 . 21
* @platform Web , Native
* @language zh_CN
* /
ktxData : ArrayBuffer ;
/ * *
* Set the KTXData object .
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 KTXData 对 象 。
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
_setKtxData ( value : ArrayBuffer ) : void ;
/ * *
* @private
* 设 置 Texture数据
* @param bitmapX
* @param bitmapY
* @param bitmapWidth
* @param bitmapHeight
* @param offsetX
* @param offsetY
* @param textureWidth
* @param textureHeight
* @param sourceWidth
* @param sourceHeight
* /
$initData ( bitmapX : number , bitmapY : number , bitmapWidth : number , bitmapHeight : number , offsetX : number , offsetY : number , textureWidth : number , textureHeight : number , sourceWidth : number , sourceHeight : number , rotated? : boolean ) : void ;
/ * *
* @deprecated
* /
getPixel32 ( x : number , y : number ) : number [ ] ;
/ * *
* Obtain the color value for the specified pixel region
* @param x The x coordinate of the pixel region
* @param y The y coordinate of the pixel region
* @param width The width of the pixel region
* @param height The height of the pixel region
* @returns Specifies the color value for the pixel region
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 指 定 像 素 区 域 的 颜 色 值
* @param x 像 素 区 域 的 X轴坐标
* @param y 像 素 区 域 的 Y轴坐标
* @param width 像 素 区 域 的 宽 度
* @param height 像 素 区 域 的 高 度
* @returns 指 定 像 素 区 域 的 颜 色 值
* @version Egret 3.2 . 1
* @platform Web
* @language zh_CN
* /
getPixels ( x : number , y : number , width? : number , height? : number ) : number [ ] ;
/ * *
* Convert base64 string , if the picture ( or pictures included ) cross - border or null
* @param type Type conversions , such as "image / png"
* @param rect The need to convert the area
* @param smoothing Whether to convert data to the smoothing process
* @returns { any } base64 string
* @version Egret 2.4
* @language en_US
* /
/ * *
* 转 换 成 base64字符串 , 如 果 图 片 ( 或 者 包 含 的 图 片 ) 跨 域 , 则 返 回 null
* @param type 转 换 的 类 型 , 如 "image/png"
* @param rect 需 要 转 换 的 区 域
* @param { any } encoderOptions 编 码 用 的 参 数
* @returns { any } base64字符串
* @version Egret 2.4
* @language zh_CN
* /
toDataURL ( type : string , rect? : egret.Rectangle , encoderOptions? : any ) : string ;
/ * *
* Crop designated area and save it as image .
* native support only "image / png" and "image / jpeg" ; Web browser because of the various implementations are not the same , it is recommended to use only these two kinds .
* @param type Type conversions , such as "image / png"
* @param filePath The path name of the image ( the home directory for the game ' s private space , the path can not have "../" , Web supports only pass names . )
* @param rect The need to convert the area
* @version Egret 2.4
* @platform Native
* @language en_US
* /
/ * *
* 裁 剪 指 定 区 域 并 保 存 成 图 片 。
* native只支持 "image/png" 和 "image/jpeg" ; Web中由于各个浏览器的实现不一样 , 因 此 建 议 也 只 用 这 2 种 。
* @param type 转 换 的 类 型 , 如 "image/png"
* @param filePath 图 片 的 名 称 的 路 径 ( 主 目 录 为 游 戏 的 私 有 空 间 , 路 径 中 不 能 有 "../" , Web只支持传名称 。 )
* @param rect 需 要 转 换 的 区 域
* @version Egret 2.4
* @platform Native
* @language zh_CN
* /
saveToFile ( type : string , filePath : string , rect? : egret.Rectangle ) : void ;
/ * *
* dispose texture
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 纹 理
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
dispose ( ) : void ;
}
}
declare namespace egret {
/ * *
* The Event class is used as the base class for the creation of Event objects , which are passed as parameters to event
* listeners when an event occurs . The properties of the Event class carry basic information about an event , such as
* the event 's type or whether the event' s default behavior can be canceled . For many events , such as the events represented
* by the Event class constants , this basic information is sufficient . Other events , however , may require more detailed
* information . Events associated with a touch tap , for example , need to include additional information about the
* location of the touch event . You can pass such additional information to event listeners by extending the Event class ,
* which is what the TouchEvent class does . Egret API defines several Event subclasses for common events that require
* additional information . Events associated with each of the Event subclasses are described in the documentation for
* each class . The methods of the Event class can be used in event listener functions to affect the behavior of the event
* object . Some events have an associated default behavior . Your event listener can cancel this behavior by calling the
* preventDefault ( ) method . You can also make the current event listener the last one to process an event by calling
* the stopPropagation ( ) or stopImmediatePropagation ( ) method .
* @see egret . EventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / Event . ts
* @see http : //edn.egret.com/cn/docs/page/798 取消触摸事件
* @language en_US
* /
/ * *
* Event 类 作 为 创 建 事 件 实 例 的 基 类 , 当 发 生 事 件 时 , Event 实 例 将 作 为 参 数 传 递 给 事 件 侦 听 器 。 Event 类 的 属 性 包 含 有 关 事 件 的 基 本 信 息 , 例 如 事 件
* 的 类 型 或 者 是 否 可 以 取 消 事 件 的 默 认 行 为 。 对 于 许 多 事 件 ( 如 由 Event 类 常 量 表 示 的 事 件 ) , 此 基 本 信 息 就 足 够 了 。 但 其 他 事 件 可 能 需 要 更 详 细 的 信 息 。
* 例 如 , 与 触 摸 关 联 的 事 件 需 要 包 括 有 关 触 摸 事 件 的 位 置 信 息 。 您 可 以 通 过 扩 展 Event 类 ( TouchEvent 类 执 行 的 操 作 ) 将 此 类 其 他 信 息 传 递 给 事 件 侦 听 器 。
* Egret API 为 需 要 其 他 信 息 的 常 见 事 件 定 义 多 个 Event 子 类 。 与 每 个 Event 子 类 关 联 的 事 件 将 在 每 个 类 的 文 档 中 加 以 介 绍 。 Event 类 的 方 法 可 以 在
* 事 件 侦 听 器 函 数 中 使 用 以 影 响 事 件 对 象 的 行 为 。 某 些 事 件 有 关 联 的 默 认 行 为 , 通 过 调 用 preventDefault ( ) 方 法 , 您 的 事 件 侦 听 器 可 以 取 消 此 行 为 。
* 可 以 通 过 调 用 stopPropagation ( ) 或 stopImmediatePropagation ( ) 方 法 , 将 当 前 事 件 侦 听 器 作 为 处 理 事 件 的 最 后 一 个 事 件 侦 听 器 。
* @see egret . EventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / Event . ts
* @see http : //edn.egret.com/cn/docs/page/798 取消触摸事件
* @language zh_CN
* /
class Event extends HashObject {
/ * *
* Dispatched when a display object is added to the on stage display list , either directly or through the addition
* of a sub tree in which the display object is contained .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 将 显 示 对 象 直 接 添 加 到 舞 台 显 示 列 表 或 将 包 含 显 示 对 象 的 子 树 添 加 至 舞 台 显 示 列 表 中 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ADDED_TO_STAGE : string ;
/ * *
* Dispatched when a display object is about to be removed from the display list , either directly or through the removal
* of a sub tree in which the display object is contained .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 从 显 示 列 表 中 直 接 删 除 显 示 对 象 或 删 除 包 含 显 示 对 象 的 子 树 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static REMOVED_FROM_STAGE : string ;
/ * *
* Dispatched when a display object is added to the display list .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 显 示 对 象 添 加 到 显 示 列 表 中 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ADDED : string ;
/ * *
* Dispatched when a display object is about to be removed from the display list .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 要 从 显 示 列 表 中 删 除 显 示 对 象 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static REMOVED : string ;
/ * *
* [ broadcast event ] Dispatched when the playhead is entering a new frame .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* [ 广 播 事 件 ] 进 入 新 的 一 帧 , 监 听 此 事 件 将 会 在 下 一 帧 开 始 时 触 发 一 次 回 调 。 这 是 一 个 广 播 事 件 , 可 以 在 任 何 一 个 显 示 对 象 上 监 听 , 无 论 它 是 否 在 显 示 列 表 中 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ENTER_FRAME : string ;
/ * *
* Dispatched when the display list is about to be updated and rendered .
* Note : Every time you want to receive a render event , you must call the stage . invalidate ( ) method .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 渲 染 事 件 , 监 听 此 事 件 将 会 在 本 帧 末 即 将 开 始 渲 染 的 前 一 刻 触 发 回 调 , 这 是 一 个 广 播 事 件 , 可 以 在 任 何 一 个 显 示 对 象 上 监 听 , 无 论 它 是 否 在 显 示 列 表 中 。
* 注 意 : 每 次 您 希 望 Egret 发 送 Event . RENDER 事 件 时 , 都 必 须 调 用 stage . invalidate ( ) 方 法 , 由 于 每 帧 只 会 触 发 一 次 屏 幕 刷 新 ,
* 若 在 Event . RENDER 回 调 函 数 执 行 期 间 再 次 调 用 stage . invalidate ( ) , 将 会 被 忽 略 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static RENDER : string ;
/ * *
* Dispatched when the size of stage or UIComponent is changed .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 舞 台 尺 寸 或 UI组件尺寸发生改变
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static RESIZE : string ;
/ * *
* Dispatched when the value or selection of a property is chaned .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 属 性 值 或 状 态 发 生 改 变 。 通 常 是 按 钮 的 选 中 状 态 , 或 者 列 表 的 选 中 项 索 引 改 变 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static CHANGE : string ;
/ * *
* Dispatched when the value or selection of a property is going to change . you can cancel this by calling the
* preventDefault ( ) method .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 属 性 值 或 状 态 即 将 发 生 改 变 , 通 常 是 按 钮 的 选 中 状 态 , 或 者 列 表 的 选 中 项 索 引 改 变 。 可 以 通 过 调 用 preventDefault ( ) 方 法 阻 止 索 引 发 生 更 改 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static CHANGING : string ;
/ * *
* Dispatched when the net request is complete .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 网 络 请 求 加 载 完 成
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static COMPLETE : string ;
/ * *
* Dispatched when loop completed .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 循 环 完 成 。 循 环 最 后 一 次 只 派 发 COMPLETE 事 件 , 不 派 发 LOOP_COMPLETE 事 件 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static LOOP_COMPLETE : string ;
/ * *
* Dispatched when the TextInput instance gets focus .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* TextInput实例获得焦点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static FOCUS_IN : string ;
/ * *
* Dispatched when the TextInput instance loses focus .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* TextInput实例失去焦点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static FOCUS_OUT : string ;
/ * *
* Dispatched when the playback is ended .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 动 画 声 音 等 播 放 完 成
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ENDED : string ;
/ * *
* 游 戏 激 活
* @version Egret 2.4
* @platform Web , Native
* /
static ACTIVATE : string ;
/ * *
* 取 消 激 活
* @version Egret 2.4
* @platform Web , Native
* /
static DEACTIVATE : string ;
/ * *
* Event . CLOSE 常 量 定 义 close 事 件 对 象 的 type 属 性 的 值 。
* @version Egret 2.4
* @platform Web , Native
* /
static CLOSE : string ;
/ * *
* Event . CONNECT 常 量 定 义 connect 事 件 对 象 的 type 属 性 的 值 。
* @version Egret 2.4
* @platform Web , Native
* /
static CONNECT : string ;
/ * *
* Event . LEAVE_STAGE 常 量 定 义 leaveStage 事 件 对 象 的 type 属 性 的 值 。
* @version Egret 2.4
* @platform Web , Native
* /
static LEAVE_STAGE : string ;
/ * *
* Event . SOUND_COMPLETE 常 量 定 义 在 声 音 完 成 播 放 后 调 度 。
* @version Egret 2.4
* @platform Web , Native
* /
static SOUND_COMPLETE : string ;
/ * *
* Creates an Event object to pass as a parameter to event listeners .
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @param data the optional data associated with this event
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 作 为 参 数 传 递 给 事 件 侦 听 器 的 Event 对 象 。
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @param data 与 此 事 件 对 象 关 联 的 可 选 数 据 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean , data? : any ) ;
/ * *
* the optional data associated with this event
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 与 此 事 件 对 象 关 联 的 可 选 数 据 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
data : any ;
/ * *
* @private
* /
$type : string ;
/ * *
* The type of event . The type is case - sensitive .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 的 类 型 。 类 型 区 分 大 小 写 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly type : string ;
/ * *
* @private
* /
$bubbles : boolean ;
/ * *
* Indicates whether an event is a bubbling event .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 事 件 是 否 为 冒 泡 事 件 。 如 果 事 件 可 以 冒 泡 , 则 此 值 为 true ; 否 则 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly bubbles : boolean ;
/ * *
* @private
* /
$cancelable : boolean ;
/ * *
* Indicates whether the behavior associated with the event can be prevented . If the behavior can be
* canceled , this value is true ; otherwise it is false .
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 是 否 可 以 阻 止 与 事 件 相 关 联 的 行 为 。 如 果 可 以 取 消 该 行 为 , 则 此 值 为 true ; 否 则 为 false 。
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly cancelable : boolean ;
/ * *
* @private
* /
$eventPhase : number ;
/ * *
* The current phase in the event flow . This property can contain the following numeric values :
* The capture phase ( EventPhase . CAPTURING_PHASE ) .
* The target phase ( EventPhase . AT_TARGET )
* The bubbling phase ( EventPhase . BUBBLING_PHASE ) .
* @see egret . EventPhase
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 流 中 的 当 前 阶 段 。 此 属 性 可 以 包 含 以 下 数 值 :
* 捕 获 阶 段 ( EventPhase . CAPTURING_PHASE ) 。
* 目 标 阶 段 ( EventPhase . AT_TARGET ) 。
* 冒 泡 阶 段 ( EventPhase . BUBBLING_PHASE ) 。
* @see egret . EventPhase
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly eventPhase : number ;
/ * *
* @private
* /
$currentTarget : any ;
/ * *
* The object that is actively processing the Event object with an event listener . For example , if a
* user clicks an OK button , the current target could be the node containing that button or one of its ancestors
* that has registered an event listener for that event .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 正 在 使 用 某 个 事 件 侦 听 器 处 理 Event 对 象 的 对 象 。 例 如 , 如 果 用 户 单 击 “ 确 定 ” 按 钮 ,
* 则 当 前 目 标 可 以 是 包 含 该 按 钮 的 节 点 , 也 可 以 是 它 的 已 为 该 事 件 注 册 了 事 件 侦 听 器 的 始 祖 之 一 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly currentTarget : any ;
/ * *
* @private
* /
$target : any ;
/ * *
* The event target . This property contains the target node . For example , if a user clicks an OK button ,
* the target node is the display list node containing that button .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 目 标 。 此 属 性 包 含 目 标 节 点 。 例 如 , 如 果 用 户 单 击 “ 确 定 ” 按 钮 , 则 目 标 节 点 就 是 包 含 该 按 钮 的 显 示 列 表 节 点 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly target : any ;
$setTarget ( target : any ) : boolean ;
/ * *
* @private
* /
$isDefaultPrevented : boolean ;
/ * *
* Checks whether the preventDefault ( ) method has been called on the event . If the preventDefault ( ) method has been
* called , returns true ; otherwise , returns false .
* @returns If preventDefault ( ) has been called , returns true ; otherwise , returns false .
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 检 查 是 否 已 对 事 件 调 用 preventDefault ( ) 方 法 。
* @returns 如 果 已 调 用 preventDefault ( ) 方 法 , 则 返 回 true ; 否 则 返 回 false 。
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
isDefaultPrevented ( ) : boolean ;
/ * *
* Cancels an event ' s default behavior if that behavior can be canceled . Many events have associated behaviors that
* are carried out by default . For example , if a user types a character into a text input , the default behavior
* is that the character is displayed in the text input . Because the TextEvent . TEXT_INPUT event ' s default behavior
* can be canceled , you can use the preventDefault ( ) method to prevent the character from appearing .
* You can use the Event . cancelable property to check whether you can prevent the default behavior associated with
* a particular event . If the value of Event . cancelable is true , then preventDefault ( ) can be used to cancel the event ;
* otherwise , preventDefault ( ) has no effect .
* @see # cancelable
* @see # isDefaultPrevented
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 可 以 取 消 事 件 的 默 认 行 为 , 则 取 消 该 行 为 。
* 许 多 事 件 都 有 默 认 执 行 的 关 联 行 为 。 例 如 , 如 果 用 户 在 文 本 字 段 中 键 入 一 个 字 符 , 则 默 认 行 为 就 是 在 文 本 字 段 中 显 示 该 字 符 。
* 由 于 可 以 取 消 TextEvent . TEXT_INPUT 事 件 的 默 认 行 为 , 因 此 您 可 以 使 用 preventDefault ( ) 方 法 来 防 止 显 示 该 字 符 。
* 您 可 以 使 用 Event . cancelable 属 性 来 检 查 是 否 可 以 防 止 与 特 定 事 件 关 联 的 默 认 行 为 。 如 果 Event . cancelable 的 值 为 true ,
* 则 可 以 使 用 preventDefault ( ) 来 取 消 事 件 ; 否 则 , preventDefault ( ) 无 效 。
* @see # cancelable
* @see # isDefaultPrevented
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
preventDefault ( ) : void ;
/ * *
* @private
* /
$isPropagationStopped : boolean ;
/ * *
* Prevents processing of any event listeners in nodes subsequent to the current node in the event flow . This method
* does not affect any event listeners in the current node ( currentTarget ) . In contrast , the stopImmediatePropagation ( )
* method prevents processing of event listeners in both the current node and subsequent nodes . Additional calls to this
* method have no effect . This method can be called in any phase of the event flow . < br / >
* Note : This method does not cancel the behavior associated with this event ; see preventDefault ( ) for that functionality .
* @see # stopImmediatePropagation ( )
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 防 止 对 事 件 流 中 当 前 节 点 的 后 续 节 点 中 的 所 有 事 件 侦 听 器 进 行 处 理 。 此 方 法 不 会 影 响 当 前 节 点 currentTarget 中 的 任 何 事 件 侦 听 器 。
* 相 比 之 下 , stopImmediatePropagation ( ) 方 法 可 以 防 止 对 当 前 节 点 中 和 后 续 节 点 中 的 事 件 侦 听 器 进 行 处 理 。
* 对 此 方 法 的 其 它 调 用 没 有 任 何 效 果 。 可 以 在 事 件 流 的 任 何 阶 段 中 调 用 此 方 法 。 < br / >
* 注 意 : 此 方 法 不 会 取 消 与 此 事 件 相 关 联 的 行 为 ; 有 关 此 功 能 的 信 息 , 请 参 阅 preventDefault ( ) 。
* @see # stopImmediatePropagation ( )
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
stopPropagation ( ) : void ;
/ * *
* @private
* /
$isPropagationImmediateStopped : boolean ;
/ * *
* Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow .
* This method takes effect immediately , and it affects event listeners in the current node . In contrast , the
* stopPropagation ( ) method doesn ' t take effect until all the event listeners in the current node finish processing . < br / >
* Note : This method does not cancel the behavior associated with this event ; see preventDefault ( ) for that functionality .
* @see # stopPropagation ( )
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 防 止 对 事 件 流 中 当 前 节 点 中 和 所 有 后 续 节 点 中 的 事 件 侦 听 器 进 行 处 理 。 此 方 法 会 立 即 生 效 , 并 且 会 影 响 当 前 节 点 中 的 事 件 侦 听 器 。
* 相 比 之 下 , 在 当 前 节 点 中 的 所 有 事 件 侦 听 器 都 完 成 处 理 之 前 , stopPropagation ( ) 方 法 不 会 生 效 。 < br / >
* 注 意 : 此 方 法 不 会 取 消 与 此 事 件 相 关 联 的 行 为 ; 有 关 此 功 能 的 信 息 , 请 参 阅 preventDefault ( ) 。
* @see # stopPropagation ( )
* @see # preventDefault ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
stopImmediatePropagation ( ) : void ;
/ * *
* This method will be called automatically when you pass the event object as the parameters to the Event . release ( ) method .
* If your custom event is designed for reusable , you should override this method to make sure all the references to external
* objects are cleaned . if not , it may cause memory leaking .
* @see egret . Event . create ( )
* @see egret . Event . release ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 事 件 实 例 传 递 给 Event . release ( ) 静 态 方 法 时 , 实 例 上 的 clean ( ) 方 法 将 会 被 自 动 调 用 。
* 若 此 自 定 义 事 件 的 实 例 设 计 为 可 以 循 环 复 用 的 , 为 了 避 免 引 起 内 存 泄 露 , 自 定 义 事 件 需 要 覆 盖 此 方 法 来 确 保 实 例 被 缓 存 前 断 开 对 外 部 对 象 的 一 切 引 用 。
* @see egret . Event . create ( )
* @see egret . Event . release ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
protected clean ( ) : void ;
/ * *
* EventDispatcher object using the specified event object thrown Event . Objects thrown objects will be cached in the pool for the next round robin .
* @param target the event target
* @param type The type of the event . Event listeners can access this information through the inherited type property .
* @param bubbles Determines whether the Event object bubbles . Event listeners can access this information through
* the inherited bubbles property .
* @param data { any } data
* @method egret . Event . dispatchEvent
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher 对 象 来 抛 出 Event 事 件 对 象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target { egret . IEventDispatcher } 派 发 事 件 目 标
* @param type { string } 事 件 类 型
* @param bubbles { boolean } 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param data { any } 事 件 data
* @method egret . Event . dispatchEvent
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchEvent ( target : IEventDispatcher , type : string , bubbles? : boolean , data? : any ) : boolean ;
/ * *
* @private
*
* @param EventClass
* @returns
* /
static _getPropertyData ( EventClass : any ) : any ;
/ * *
* Gets one event instance from the object pool or create a new one . We highly recommend using the Event . create ( )
* and Event . release ( ) methods to create and release an event object , it can reduce the number of reallocate objects ,
* which allows you to get better code execution performance . < br / >
* Note : If you want to use this method to initialize your custom event object , you must make sure the constructor
* of your custom event is the same as the constructor of egret . Event .
* @param EventClass Event Class 。
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @example
* < pre >
* let event = Event . create ( Event , type , bubbles ) ;
* event . data = data ; //optional,initializes custom data here
* this . dispatchEvent ( event ) ;
* Event . release ( event ) ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 对 象 池 中 取 出 或 创 建 一 个 新 的 事 件 实 例 。 我 们 建 议 您 尽 可 能 使 用 Event . create ( ) 和 Event . release ( ) 这 一 对 方 法 来 创 建 和 释 放 事 件 对 象 ,
* 这 一 对 方 法 会 将 事 件 实 例 在 内 部 缓 存 下 来 供 下 次 循 环 使 用 , 减 少 对 象 的 创 建 次 数 , 从 而 获 得 更 高 的 代 码 运 行 性 能 。 < br / >
* 注 意 : 若 使 用 此 方 法 来 创 建 自 定 义 事 件 的 实 例 , 自 定 义 的 构 造 函 数 参 数 列 表 必 须 跟 Event类一致 。
* @param EventClass Event类名 。
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @example
* < pre >
* let event = Event . create ( Event , type , bubbles ) ;
* event . data = data ; //可选,若指定义事件上需要附加其他参数,可以在获取实例后在此处设置。
* this . dispatchEvent ( event ) ;
* Event . release ( event ) ;
* < / pre >
* @see # clean ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static create < T extends Event > ( EventClass : {
new ( type : string , bubbles? : boolean , cancelable? : boolean ) : T ;
eventPool? : Event [ ] ;
} , type : string , bubbles? : boolean , cancelable? : boolean ) : T ;
/ * *
* Releases an event object and cache it into the object pool . We highly recommend using the Event . create ( )
* and Event . release ( ) methods to create and release an event object , it can reduce the number of reallocate objects ,
* which allows you to get better code execution performance . < br / >
* Note : The parameters of this method only accepts an instance created by the Event . create ( ) method .
* if not , it may throw an error .
* @example
* < pre >
* let event = Event . create ( Event , type , bubbles ) ;
* event . data = data ; //optional,initializes custom data here
* this . dispatchEvent ( event ) ;
* Event . release ( event ) ;
* < / pre >
* @see # clean ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 一 个 事 件 对 象 , 并 缓 存 到 对 象 池 。 我 们 建 议 您 尽 可 能 使 用 Event . create ( ) 和 Event . release ( ) 这 一 对 方 法 来 创 建 和 释 放 事 件 对 象 ,
* 这 一 对 方 法 会 将 事 件 实 例 在 内 部 缓 存 下 来 供 下 次 循 环 使 用 , 减 少 对 象 的 创 建 次 数 , 从 而 获 得 更 高 的 代 码 运 行 性 能 。 < br / >
* 注 意 : 此 方 法 只 能 传 入 由 Event . create ( ) 创 建 的 事 件 实 例 , 传 入 非 法 对 象 实 例 可 能 会 导 致 报 错 。
* @example
* < pre >
* let event = Event . create ( Event , type , bubbles ) ;
* event . data = data ; //可选,若指定义事件上需要附加其他参数,可以在获取实例后在此处设置。
* this . dispatchEvent ( event ) ;
* Event . release ( event ) ;
* < / pre >
* @see # clean ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static release ( event : Event ) : void ;
}
}
/ * *
* Is debug mode .
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 为 debug 模 式 。
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
declare let DEBUG : boolean ;
/ * *
* Is release mode .
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 为 release 模 式 。
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
declare let RELEASE : boolean ;
declare namespace egret {
/ * *
* @private
* /
function $error ( code : number , . . . params : any [ ] ) : void ;
/ * *
* @private
* /
function $warn ( code : number , . . . params : any [ ] ) : void ;
/ * *
* @private
* /
function getString ( code : number , . . . params : any [ ] ) : string ;
/ * *
* @private
* /
function $markCannotUse ( instance : any , property : string , defaultVale : any ) : void ;
}
declare namespace egret {
/ * *
* The Point object represents a location in a two - dimensional coordinate system , where x represents the horizontal
* axis and y represents the vertical axis .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Point . ts
* @language en_US
* /
/ * *
* Point 对 象 表 示 二 维 坐 标 系 统 中 的 某 个 位 置 , 其 中 x 表 示 水 平 轴 , y 表 示 垂 直 轴 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Point . ts
* @language zh_CN
* /
class Point extends HashObject {
/ * *
* Releases a point instance to the object pool
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 一 个 Point实例到对象池
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static release ( point : Point ) : void ;
/ * *
* get a point instance from the object pool or create a new one .
* @param x The horizontal coordinate .
* @param y The vertical coordinate .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 对 象 池 中 取 出 或 创 建 一 个 新 的 Point对象 。
* @param x 该 对 象 的 x属性值 , 默 认 为 0
* @param y 该 对 象 的 y属性值 , 默 认 为 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static create ( x : number , y : number ) : Point ;
/ * *
* Creates a new point . If you pass no parameters to this method , a point is created at ( 0 , 0 ) .
* @param x The horizontal coordinate .
* @param y The vertical coordinate .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . Point 对 象 . 若 不 传 入 任 何 参 数 , 将 会 创 建 一 个 位 于 ( 0 , 0 ) 位 置 的 点 。
* @param x 该 对 象 的 x属性值 , 默 认 为 0
* @param y 该 对 象 的 y属性值 , 默 认 为 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( x? : number , y? : number ) ;
/ * *
* The horizontal coordinate .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 该 点 的 水 平 坐 标 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
x : number ;
/ * *
* The vertical coordinate .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 该 点 的 垂 直 坐 标 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
y : number ;
/ * *
* The length of the line segment from ( 0 , 0 ) to this point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 ( 0 , 0 ) 到 此 点 的 线 段 长 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly length : number ;
/ * *
* Sets the members of Point to the specified values
* @param x The horizontal coordinate .
* @param y The vertical coordinate .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 Point 的 成 员 设 置 为 指 定 值
* @param x 该 对 象 的 x属性值
* @param y 该 对 象 的 y属性值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setTo ( x : number , y : number ) : Point ;
/ * *
* Creates a copy of this Point object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 克 隆 点 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
clone ( ) : Point ;
/ * *
* Determines whether two points are equal . Two points are equal if they have the same x and y values .
* @param toCompare The point to be compared .
* @returns A value of true if the object is equal to this Point object ; false if it is not equal .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 两 个 点 是 否 相 同 。 如 果 两 个 点 具 有 相 同 的 x 和 y 值 , 则 它 们 是 相 同 的 点 。
* @param toCompare 要 比 较 的 点 。
* @returns 如 果 该 对 象 与 此 Point 对 象 相 同 , 则 为 true 值 , 如 果 不 相 同 , 则 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
equals ( toCompare : Point ) : boolean ;
/ * *
* Returns the distance between pt1 and pt2 .
* @param p1 The first point .
* @param p2 The second point .
* @returns The distance between the first and second points .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 pt1 和 pt2 之 间 的 距 离 。
* @param p1 第 一 个 点
* @param p2 第 二 个 点
* @returns 第 一 个 点 和 第 二 个 点 之 间 的 距 离 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static distance ( p1 : Point , p2 : Point ) : number ;
/ * *
* Copies all of the point data from the source Point object into the calling Point object .
* @param sourcePoint The Point object from which to copy the data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 源 Point 对 象 中 的 所 有 点 数 据 复 制 到 调 用 方 Point 对 象 中 。
* @param sourcePoint 要 从 中 复 制 数 据 的 Point 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
copyFrom ( sourcePoint : Point ) : void ;
/ * *
* Adds the coordinates of another point to the coordinates of this point to create a new point .
* @param v The point to be added .
* @returns The new point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 另 一 个 点 的 坐 标 添 加 到 此 点 的 坐 标 以 创 建 一 个 新 点 。
* @param v 要 添 加 的 点 。
* @returns 新 点 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
add ( v : Point ) : Point ;
/ * *
* Determines a point between two specified points .
* The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2 . The closer the value of the parameter f is to 1.0 , the closer the interpolated point is to the first point ( parameter pt1 ) . The closer the value of the parameter f is to 0 , the closer the interpolated point is to the second point ( parameter pt2 ) .
* @param pt1 The first point .
* @param pt2 The second point .
* @param f The level of interpolation between the two points . Indicates where the new point will be , along the line between pt1 and pt2 . If f = 1 , pt1 is returned ; if f = 0 , pt2 is returned .
* @returns The new interpolated point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 两 个 指 定 点 之 间 的 点 。
* 参 数 f 确 定 新 的 内 插 点 相 对 于 参 数 pt1 和 pt2 指 定 的 两 个 端 点 所 处 的 位 置 。 参 数 f 的 值 越 接 近 1.0 , 则 内 插 点 就 越 接 近 第 一 个 点 ( 参 数 pt1 ) 。 参 数 f 的 值 越 接 近 0 , 则 内 插 点 就 越 接 近 第 二 个 点 ( 参 数 pt2 ) 。
* @param pt1 第 一 个 点 。
* @param pt2 第 二 个 点 。
* @param f 两 个 点 之 间 的 内 插 级 别 。 表 示 新 点 将 位 于 pt1 和 pt2 连 成 的 直 线 上 的 什 么 位 置 。 如 果 f = 1 , 则 返 回 pt1 ; 如 果 f = 0 , 则 返 回 pt2 。
* @returns 新 的 内 插 点 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static interpolate ( pt1 : Point , pt2 : Point , f : number ) : Point ;
/ * *
* Scales the line segment between ( 0 , 0 ) and the current point to a set length .
* @param thickness The scaling value . For example , if the current point is ( 0 , 5 ) , and you normalize it to 1 , the point returned is at ( 0 , 1 ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 ( 0 , 0 ) 和 当 前 点 之 间 的 线 段 缩 放 为 设 定 的 长 度 。
* @param thickness 缩 放 值 。 例 如 , 如 果 当 前 点 为 ( 0 , 5 ) 并 且 您 将 它 规 范 化 为 1 , 则 返 回 的 点 位 于 ( 0 , 1 ) 处 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
normalize ( thickness : number ) : void ;
/ * *
* Offsets the Point object by the specified amount . The value of dx is added to the original value of x to create the new x value . The value of dy is added to the original value of y to create the new y value .
* @param dx The amount by which to offset the horizontal coordinate , x .
* @param dy The amount by which to offset the vertical coordinate , y .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 按 指 定 量 偏 移 Point 对 象 。 dx 的 值 将 添 加 到 x 的 原 始 值 中 以 创 建 新 的 x 值 。 dy 的 值 将 添 加 到 y 的 原 始 值 中 以 创 建 新 的 y 值 。
* @param dx 水 平 坐 标 x 的 偏 移 量 。
* @param dy 水 平 坐 标 y 的 偏 移 量 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
offset ( dx : number , dy : number ) : void ;
/ * *
* Converts a pair of polar coordinates to a Cartesian point coordinate .
* @param len The length coordinate of the polar pair .
* @param angle The angle , in radians , of the polar pair .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 一 对 极 坐 标 转 换 为 笛 卡 尔 点 坐 标 。
* @param len 极 坐 标 对 的 长 度 。
* @param angle 极 坐 标 对 的 角 度 ( 以 弧 度 表 示 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static polar ( len : number , angle : number ) : Point ;
/ * *
* Subtracts the coordinates of another point from the coordinates of this point to create a new point .
* @param v The point to be subtracted .
* @returns The new point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 此 点 的 坐 标 中 减 去 另 一 个 点 的 坐 标 以 创 建 一 个 新 点 。
* @param v 要 减 去 的 点 。
* @returns 新 点 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
subtract ( v : Point ) : Point ;
/ * *
* Returns a string that contains the values of the x and y coordinates . The string has the form "(x=x, y=y)" , so calling the toString ( ) method for a point at 23 , 17 would return "(x=23, y=17)" .
* @returns The string representation of the coordinates .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 包 含 x 和 y 坐 标 的 值 的 字 符 串 。 该 字 符 串 的 格 式 为 "(x=x, y=y)" , 因 此 为 点 23 , 17 调 用 toString ( ) 方 法 将 返 回 "(x=23, y=17)" 。
* @returns 坐 标 的 字 符 串 表 示 形 式 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
toString ( ) : string ;
}
/ * *
* @private
* 仅 供 框 架 内 复 用 , 要 防 止 暴 露 引 用 到 外 部 。
* /
let $TempPoint : Point ;
}
declare namespace egret {
/ * *
* The DisplayObjectContainer class is a basic display list building block : a display list node that can contain children .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / DisplayObjectContainer . ts
* @language en_US
* /
/ * *
* DisplayObjectContainer 类 是 基 本 显 示 列 表 构 造 块 : 一 个 可 包 含 子 项 的 显 示 列 表 节 点 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / DisplayObjectContainer . ts
* @language zh_CN
* /
class DisplayObjectContainer extends DisplayObject {
/ * *
* @private
* /
static $EVENT_ADD_TO_STAGE_LIST : DisplayObject [ ] ;
/ * *
* @private
* /
static $EVENT_REMOVE_FROM_STAGE_LIST : DisplayObject [ ] ;
/ * *
* Creates a new DisplayObjectContainer instance .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 实 例 化 一 个 容 器
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
/ * *
* Returns the number of children of this object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 此 对 象 的 子 项 数 目 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly numChildren : number ;
/ * *
* Set children sort mode .
* @param value { string } The sort mode
* @see egret . ChildrenSortMode
* @version Egret 5.2 . 19
* @platform Native
* @language en_US
* /
/ * *
* 设 置 子 项 目 的 排 序 方 式
* @param value { string } 排 序 方 式
* @see egret . ChildrenSortMode
* @version Egret 5.2 . 19
* @platform Native
* @language en_US
* /
setChildrenSortMode ( value : string ) : void ;
/ * *
* Adds a child DisplayObject instance to this DisplayObjectContainer instance . The child is added to the front
* ( top ) of all other children in this DisplayObjectContainer instance . ( To add a child to a specific index position ,
* use the addChildAt ( ) method . ) If you add a child object that already has a different display object container
* as a parent , the object is removed from the child list of the other display object container .
* @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance .
* @returns 在 child The DisplayObject instance that you pass in the child parameter .
* @see # addChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 一 个 DisplayObject 子 实 例 添 加 到 该 DisplayObjectContainer 实 例 中 。 子 项 将 被 添 加 到 该 DisplayObjectContainer 实 例 中 其 他
* 所 有 子 项 的 前 ( 上 ) 面 。 ( 要 将 某 子 项 添 加 到 特 定 索 引 位 置 , 请 使 用 addChildAt ( ) 方 法 。 )
* @param child 要 作 为 该 DisplayObjectContainer 实 例 的 子 项 添 加 的 DisplayObject 实 例 。
* @returns 在 child 参 数 中 传 递 的 DisplayObject 实 例 。
* @see # addChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
addChild ( child : DisplayObject ) : DisplayObject ;
/ * *
* Adds a child DisplayObject instance to this DisplayObjectContainer instance . The child is added at the index position
* specified . An index of 0 represents the back ( bottom ) of the display list for this DisplayObjectContainer object .
* If you add a child object that already has a different display object container as a parent , the object is removed
* from the child list of the other display object container .
* @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance .
* @param index The index position to which the child is added . If you specify a currently occupied index position ,
* the child object that exists at that position and all higher positions are moved up one position in the child list .
* @returns The DisplayObject instance that you pass in the child parameter .
* @see # addChild ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 一 个 DisplayObject 子 实 例 添 加 到 该 DisplayObjectContainer 实 例 中 。 该 子 项 将 被 添 加 到 指 定 的 索 引 位 置 。 索 引 为 0 表 示 该
* DisplayObjectContainer 对 象 的 显 示 列 表 的 后 ( 底 ) 部 。 如 果 添 加 一 个 已 将 其 它 显 示 对 象 容 器 作 为 父 项 的 子 对 象 , 则 会 从 其 它 显 示 对 象 容 器 的 子 列 表 中 删 除 该 对 象 。
* @param child 要 作 为 该 DisplayObjectContainer 实 例 的 子 项 添 加 的 DisplayObject 实 例 。
* @param index 添 加 该 子 项 的 索 引 位 置 。 如 果 指 定 当 前 占 用 的 索 引 位 置 , 则 该 位 置 以 及 所 有 更 高 位 置 上 的 子 对 象 会 在 子 级 列 表 中 上 移 一 个 位 置 。
* @returns 在 child 参 数 中 传 递 的 DisplayObject 实 例 。
* @see # addChild ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
addChildAt ( child : DisplayObject , index : number ) : DisplayObject ;
/ * *
* @private
* /
$doAddChild ( child : DisplayObject , index : number , notifyListeners? : boolean ) : DisplayObject ;
/ * *
* Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance
* itself . The search includes the entire display list including this DisplayObjectContainer instance . Grandchildren ,
* great - grandchildren , and so on each return true .
* @param child The child object to test .
* @returns true if the child object is a child of the DisplayObjectContainer or the container itself ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 指 定 显 示 对 象 是 DisplayObjectContainer 实 例 的 子 项 或 该 实 例 本 身 。 搜 索 包 括 整 个 显 示 列 表 ( 其 中 包 括 此 DisplayObjectContainer 实 例 ) 。
* 孙 项 、 曾 孙 项 等 , 每 项 都 返 回 true 。
* @param child 要 测 试 的 子 对 象 。
* @returns 如 果 child 对 象 是 DisplayObjectContainer 的 子 项 或 容 器 本 身 , 则 为 true ; 否 则 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
contains ( child : DisplayObject ) : boolean ;
/ * *
* Returns the child display object instance that exists at the specified index .
* @param index The index position of the child object .
* @returns The child display object at the specified index position .
* @see # getChildByName ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 位 于 指 定 索 引 处 的 子 显 示 对 象 实 例 。
* @param index 子 对 象 的 索 引 位 置 。
* @returns 位 于 指 定 索 引 位 置 处 的 子 显 示 对 象 。
* @see # getChildByName ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getChildAt ( index : number ) : DisplayObject ;
/ * *
* Returns the index position of a child DisplayObject instance .
* @param child The DisplayObject instance to identify .
* @returns The index position of the child display object to identify .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 DisplayObject 的 child 实 例 的 索 引 位 置 。
* @param child 要 测 试 的 子 对 象 。
* @returns 要 查 找 的 子 显 示 对 象 的 索 引 位 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getChildIndex ( child : egret.DisplayObject ) : number ;
/ * *
* Returns the child display object that exists with the specified name . If more that one child display object has
* the specified name , the method returns the first object in the child list . The getChildAt ( ) method is faster than
* the getChildByName ( ) method . The getChildAt ( ) method accesses a child from a cached array , whereas the getChildByName ( )
* method has to traverse a linked list to access a child .
* @param name The name of the child to return .
* @returns The child display object with the specified name .
* @see # getChildAt ( )
* @see egret . DisplayObject # name
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 具 有 指 定 名 称 的 子 显 示 对 象 。 如 果 多 个 子 显 示 对 象 具 有 指 定 名 称 , 则 该 方 法 会 返 回 子 级 列 表 中 的 第 一 个 对 象 。
* getChildAt ( ) 方 法 比 getChildByName ( ) 方 法 快 。 getChildAt ( ) 方 法 从 缓 存 数 组 中 访 问 子 项 , 而 getChildByName ( ) 方 法 则 必 须 遍 历 链 接 的 列 表 来 访 问 子 项 。
* @param name 要 返 回 的 子 项 的 名 称 。
* @returns 具 有 指 定 名 称 的 子 显 示 对 象 。
* @see # getChildAt ( )
* @see egret . DisplayObject # name
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getChildByName ( name : string ) : DisplayObject ;
/ * *
* Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance .
* The parent property of the removed child is set to null , and the object is garbage collected if no other references
* to the child exist . The index positions of any display objects above the child in the DisplayObjectContainer are
* decreased by 1 .
* @param child The DisplayObject instance to remove .
* @returns The DisplayObject instance that you pass in the child parameter .
* @see # removeChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 DisplayObjectContainer 实 例 的 子 列 表 中 删 除 指 定 的 child DisplayObject 实 例 。 将 已 删 除 子 项 的 parent 属 性 设 置 为 null ;
* 如 果 不 存 在 对 该 子 项 的 任 何 其 它 引 用 , 则 将 该 对 象 作 为 垃 圾 回 收 。 DisplayObjectContainer 中 该 子 项 之 上 的 任 何 显 示 对 象 的 索 引 位 置 都 减 去 1 。
* @param child 要 删 除 的 DisplayObject 实 例 。
* @returns 在 child 参 数 中 传 递 的 DisplayObject 实 例 。
* @see # removeChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
removeChild ( child : DisplayObject ) : DisplayObject ;
/ * *
* Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer .
* The parent property of the removed child is set to null , and the object is garbage collected if no other references
* to the child exist . The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1 .
* @param index The child index of the DisplayObject to remove .
* @returns The DisplayObject instance that was removed .
* @see # removeChild ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 DisplayObjectContainer 的 子 列 表 中 指 定 的 index 位 置 删 除 子 DisplayObject 。 将 已 删 除 子 项 的 parent 属 性 设 置 为 null ;
* 如 果 没 有 对 该 子 项 的 任 何 其 他 引 用 , 则 将 该 对 象 作 为 垃 圾 回 收 。 DisplayObjectContainer 中 该 子 项 之 上 的 任 何 显 示 对 象 的 索 引 位 置 都 减 去 1 。
* @param index 要 删 除 的 DisplayObject 的 子 索 引 。
* @returns 已 删 除 的 DisplayObject 实 例 。
* @see # removeChild ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
removeChildAt ( index : number ) : DisplayObject ;
/ * *
* @private
* /
$doRemoveChild ( index : number , notifyListeners? : boolean ) : DisplayObject ;
/ * *
* Changes the position of an existing child in the display object container . This affects the layering of child objects .
* @param child The child DisplayObject instance for which you want to change the index number .
* @param index The resulting index number for the child display object .
* @see # addChildAt ( )
* @see # getChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 更 改 现 有 子 项 在 显 示 对 象 容 器 中 的 位 置 。 这 会 影 响 子 对 象 的 分 层 。
* @param child 要 为 其 更 改 索 引 编 号 的 DisplayObject 子 实 例 。
* @param index 生 成 的 child 显 示 对 象 的 索 引 编 号 。 当 新 的 索 引 编 号 小 于 0 或 大 于 已 有 子 元 件 数 量 时 , 新 加 入 的 DisplayObject对象将会放置于最上层 。
* @see # addChildAt ( )
* @see # getChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setChildIndex ( child : DisplayObject , index : number ) : void ;
/ * *
* @private
* /
private doSetChildIndex ( child , index ) ;
/ * *
* Swaps the z - order ( front - to - back order ) of the child objects at the two specified index positions in the child
* list . All other child objects in the display object container remain in the same index positions .
* @param index1 The index position of the first child object .
* @param index2 The index position of the second child object .
* @see # swapChildren ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 子 级 列 表 中 两 个 指 定 的 索 引 位 置 , 交 换 子 对 象 的 Z 轴 顺 序 ( 前 后 顺 序 ) 。 显 示 对 象 容 器 中 所 有 其 他 子 对 象 的 索 引 位 置 保 持 不 变 。
* @param index1 第 一 个 子 对 象 的 索 引 位 置 。
* @param index2 第 二 个 子 对 象 的 索 引 位 置 。
* @see # swapChildren ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
swapChildrenAt ( index1 : number , index2 : number ) : void ;
/ * *
* Swaps the z - order ( front - to - back order ) of the two specified child objects . All other child objects in the
* display object container remain in the same index positions .
* @param child1 The first child object .
* @param child2 The second child object .
* @see # swapChildrenAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 交 换 两 个 指 定 子 对 象 的 Z 轴 顺 序 ( 从 前 到 后 顺 序 ) 。 显 示 对 象 容 器 中 所 有 其 他 子 对 象 的 索 引 位 置 保 持 不 变 。
* @param child1 第 一 个 子 对 象 。
* @param child2 第 二 个 子 对 象 。
* @see # swapChildrenAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
swapChildren ( child1 : DisplayObject , child2 : DisplayObject ) : void ;
/ * *
* @private
* /
private doSwapChildrenAt ( index1 , index2 ) ;
/ * *
* Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance . The parent
* property of the removed children is set to null , and the objects are garbage collected if no other references to the children exist .
* @see # removeChild ( )
* @see # removeChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 DisplayObjectContainer 实 例 的 子 级 列 表 中 删 除 所 有 child DisplayObject 实 例 。
* @see # removeChild ( )
* @see # removeChildAt ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
removeChildren ( ) : void ;
/ * *
* @private
* 一 个 子 项 被 添 加 到 容 器 内 , 此 方 法 不 仅 在 操 作 addChild ( ) 时 会 被 回 调 , 在 操 作 setChildIndex ( ) 或 swapChildren时也会回调 。
* 当 子 项 索 引 发 生 改 变 时 , 会 先 触 发 $childRemoved ( ) 方 法 , 然 后 触 发 $childAdded ( ) 方 法 。
* /
$childAdded ( child : DisplayObject , index : number ) : void ;
/ * *
* @private
* 一 个 子 项 从 容 器 内 移 除 , 此 方 法 不 仅 在 操 作 removeChild ( ) 时 会 被 回 调 , 在 操 作 setChildIndex ( ) 或 swapChildren时也会回调 。
* 当 子 项 索 引 发 生 改 变 时 , 会 先 触 发 $childRemoved ( ) 方 法 , 然 后 触 发 $childAdded ( ) 方 法 。
* /
$childRemoved ( child : DisplayObject , index : number ) : void ;
/ * *
* @private
* /
$onAddToStage ( stage : Stage , nestLevel : number ) : void ;
/ * *
* @private
*
* /
$onRemoveFromStage ( ) : void ;
/ * *
* @private
* /
$measureChildBounds ( bounds : Rectangle ) : void ;
$touchChildren : boolean ;
/ * *
* Determines whether or not the children of the object are touch , or user input device , enabled . If an object is
* enabled , a user can interact with it by using a touch or user input device .
* @default true
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 对 象 的 子 级 是 否 支 持 触 摸 或 用 户 输 入 设 备 。 如 果 对 象 支 持 触 摸 或 用 户 输 入 设 备 , 用 户 可 以 通 过 使 用 触 摸 或 用 户 输 入 设 备 与 之 交 互 。
* @default true
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
touchChildren : boolean ;
/ * *
* @private
*
* @returns
* /
$getTouchChildren ( ) : boolean ;
/ * *
* @private
* /
$setTouchChildren ( value : boolean ) : boolean ;
/ * *
* @private
* /
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
private _sortChildrenFunc ( a , b ) ;
sortChildren ( ) : void ;
}
}
declare namespace egret {
/ * *
* SpriteSheet is a mosaic of multiple sub - bitmaps , comprising a plurality of Texture objects .
* Each Texture object shares the set bitmap of SpriteSheet , but it points to its different areas .
* On WebGL / OpenGL , this operation can significantly improve performance .
* At the same time , SpriteSheet can carry out material integration easily to reduce the number of HTTP requests
* For specification of the SpriteSheet format , see the document https : //github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification
* @see http : //edn.egret.com/cn/docs/page/135 The use of texture packs
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / SpriteSheet . ts
* @language en_US
* /
/ * *
* SpriteSheet 是 一 张 由 多 个 子 位 图 拼 接 而 成 的 集 合 位 图 , 它 包 含 多 个 Texture 对 象 。
* 每 一 个 Texture 都 共 享 SpriteSheet 的 集 合 位 图 , 但 是 指 向 它 的 不 同 的 区 域 。
* 在 WebGL / OpenGL上 , 这 种 做 法 可 以 显 著 提 升 性 能
* 同 时 , SpriteSheet可以很方便的进行素材整合 , 降 低 HTTP请求数量
* SpriteSheet 格 式 的 具 体 规 范 可 以 参 见 此 文 档 https : //github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification
* @see http : //edn.egret.com/cn/docs/page/135 纹理集的使用
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / SpriteSheet . ts
* @language zh_CN
* /
class SpriteSheet extends HashObject {
/ * *
* Create an egret . SpriteSheet object
* @param texture { Texture } Texture
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . SpriteSheet 对 象
* @param texture { Texture } 纹 理
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( texture : Texture ) ;
/ * *
* @private
* 表 示 这 个 SpriteSheet的位图区域在bitmapData上的起始位置x 。
* /
private _bitmapX ;
/ * *
* @private
* 表 示 这 个 SpriteSheet的位图区域在bitmapData上的起始位置y 。
* /
private _bitmapY ;
/ * *
* @private
* 共 享 的 位 图 数 据
* /
$texture : Texture ;
/ * *
* @private
* 纹 理 缓 存 字 典
* /
_textureMap : MapLike < Texture > ;
/ * *
* Obtain a cached Texture object according to the specified texture name
* @param name { string } Cache the name of this Texture object
* @returns { egret . Texture } The Texture object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 根 据 指 定 纹 理 名 称 获 取 一 个 缓 存 的 Texture 对 象
* @param name { string } 缓 存 这 个 Texture 对 象 所 使 用 的 名 称
* @returns { egret . Texture } Texture 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getTexture ( name : string ) : Texture ;
/ * *
* Create a new Texture object for the specified area on SpriteSheet and cache it
* @param name { string } Cache the name of this Texture object . If the name already exists , the previous Texture object will be overwrited .
* @param bitmapX { number } Starting coordinate x of texture area on bitmapData
* @param bitmapY { number } Starting coordinate y of texture area on bitmapData
* @param bitmapWidth { number } Width of texture area on bitmapData
* @param bitmapHeight { number } Height of texture area on bitmapData
* @param offsetX { number } Starting point x for a non - transparent area of the original bitmap
* @param offsetY { number } Starting point y for a non - transparent area of the original bitmap
* @param textureWidth { number } Width of the original bitmap . If it is not passed , use the bitmapWidth value .
* @param textureHeight { number } Height of the original bitmap . If it is not passed , use the bitmapHeight value .
* @returns { egret . Texture } The created Texture object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 为 SpriteSheet 上 的 指 定 区 域 创 建 一 个 新 的 Texture 对 象 并 缓 存 它
* @param name { string } 缓 存 这 个 Texture 对 象 所 使 用 的 名 称 , 如 果 名 称 已 存 在 , 将 会 覆 盖 之 前 的 Texture 对 象
* @param bitmapX { number } 纹 理 区 域 在 bitmapData 上 的 起 始 坐 标 x
* @param bitmapY { number } 纹 理 区 域 在 bitmapData 上 的 起 始 坐 标 y
* @param bitmapWidth { number } 纹 理 区 域 在 bitmapData 上 的 宽 度
* @param bitmapHeight { number } 纹 理 区 域 在 bitmapData 上 的 高 度
* @param offsetX { number } 原 始 位 图 的 非 透 明 区 域 x 起 始 点
* @param offsetY { number } 原 始 位 图 的 非 透 明 区 域 y 起 始 点
* @param textureWidth { number } 原 始 位 图 的 高 度 , 若 不 传 入 , 则 使 用 bitmapWidth 的 值 。
* @param textureHeight { number } 原 始 位 图 的 宽 度 , 若 不 传 入 , 则 使 用 bitmapHeight 的 值 。
* @returns { egret . Texture } 创 建 的 Texture 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
createTexture ( name : string , bitmapX : number , bitmapY : number , bitmapWidth : number , bitmapHeight : number , offsetX? : number , offsetY? : number , textureWidth? : number , textureHeight? : number ) : Texture ;
/ * *
* dispose texture
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 纹 理
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
dispose ( ) : void ;
}
}
declare namespace egret {
/ * *
* @private
* /
let $locale_strings : any ;
/ * *
* @private
* /
let $language : string ;
}
declare namespace egret . sys {
/ * *
* @private
* 全 局 多 语 言 翻 译 函 数
* @param code 要 查 询 的 字 符 串 代 码
* @param args 替 换 字 符 串 中 { 0 } 标 志 的 参 数 列 表
* @returns 返 回 拼 接 后 的 字 符 串
* /
function tr ( code : number , . . . args : any [ ] ) : string ;
}
declare namespace egret {
/ * *
* The Bitmap class represents display objects that represent bitmap images .
* The Bitmap ( ) constructor allows you to create a Bitmap object that contains a reference to a BitmapData object .
* After you create a Bitmap object , use the addChild ( ) or addChildAt ( ) method of the parent DisplayObjectContainer
* instance to place the bitmap on the display list . A Bitmap object can share its texture reference among several
* Bitmap objects , independent of translation or rotation properties . Because you can create multiple Bitmap objects
* that reference the same texture object , multiple display objects can use the same complex texture object
* without incurring the memory overhead of a texture object for each display object instance .
*
* @see egret . Texture
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Bitmap . ts
* @language en_US
* /
/ * *
* Bitmap 类 表 示 用 于 显 示 位 图 图 片 的 显 示 对 象 。
* 利 用 Bitmap ( ) 构 造 函 数 , 可 以 创 建 包 含 对 BitmapData 对 象 引 用 的 Bitmap 对 象 。 创 建 了 Bitmap 对 象 后 ,
* 使 用 父 级 DisplayObjectContainer 实 例 的 addChild ( ) 或 addChildAt ( ) 方 法 可 以 将 位 图 放 在 显 示 列 表 中 。
* 一 个 Bitmap 对 象 可 在 若 干 Bitmap 对 象 之 中 共 享 其 texture 引 用 , 与 缩 放 或 旋 转 属 性 无 关 。
* 由 于 能 够 创 建 引 用 相 同 texture 对 象 的 多 个 Bitmap 对 象 , 因 此 , 多 个 显 示 对 象 可 以 使 用 相 同 的 texture 对 象 ,
* 而 不 会 因 为 每 个 显 示 对 象 实 例 使 用 一 个 texture 对 象 而 产 生 额 外 内 存 开 销 。
*
* @see egret . Texture
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Bitmap . ts
* @language zh_CN
* /
class Bitmap extends DisplayObject {
/ * *
* Initializes a Bitmap object to refer to the specified Texture object .
* @param value The Texture object being referenced .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 引 用 指 定 Texture 实 例 的 Bitmap 对 象
* @param value 被 引 用 的 Texture 实 例
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( value? : Texture ) ;
protected $texture : Texture ;
$bitmapData : BitmapData ;
protected $bitmapX : number ;
protected $bitmapY : number ;
protected $bitmapWidth : number ;
protected $bitmapHeight : number ;
protected $offsetX : number ;
protected $offsetY : number ;
protected $textureWidth : number ;
protected $textureHeight : number ;
protected $sourceWidth : number ;
protected $sourceHeight : number ;
protected $smoothing : boolean ;
protected $explicitBitmapWidth : number ;
protected $explicitBitmapHeight : number ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* 显 示 对 象 添 加 到 舞 台
* /
$onAddToStage ( stage : Stage , nestLevel : number ) : void ;
/ * *
* @private
* 显 示 对 象 从 舞 台 移 除
* /
$onRemoveFromStage ( ) : void ;
/ * *
* The Texture object being referenced .
* If you pass the constructor of type BitmapData or last set for bitmapData , this value returns null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 被 引 用 的 Texture 对 象 。
* 如 果 传 入 构 造 函 数 的 类 型 为 BitmapData 或 者 最 后 设 置 的 为 bitmapData , 则 此 值 返 回 null 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
texture : Texture ;
/ * *
* @private
* /
$setTexture ( value : Texture ) : boolean ;
$setBitmapData ( value : any ) : void ;
/ * *
* @private
* /
protected setBitmapDataToWasm ( data? : Texture ) : void ;
/ * *
* @private
* /
$refreshImageData ( ) : void ;
/ * *
* @private
* /
private setImageData ( bitmapData , bitmapX , bitmapY , bitmapWidth , bitmapHeight , offsetX , offsetY , textureWidth , textureHeight , sourceWidth , sourceHeight ) ;
/ * *
* @private
* /
$scale9Grid : egret.Rectangle ;
/ * *
* Represent a Rectangle Area that the 9 scale area of Image .
* Notice : This property is valid only when < code > fillMode < / code >
* is < code > BitmapFillMode . SCALE < / code > .
*
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 区 域 , 它 定 义 素 材 对 象 的 九 个 缩 放 区 域 。
* 注意 :此属性仅在 < code > fillMode < / code > 为 < code > BitmapFillMode . SCALE < / code > 时 有 效 。
*
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
scale9Grid : egret.Rectangle ;
protected $setScale9Grid ( value : egret.Rectangle ) : void ;
/ * *
* @private
* /
$fillMode : string ;
/ * *
* Determines how the bitmap fills in the dimensions .
* < p > When set to < code > BitmapFillMode . REPEAT < / code > , the bitmap
* repeats to fill the region . < / p >
* < p > When set to < code > BitmapFillMode . SCALE < / code > , the bitmap
* stretches to fill the region . < / p >
*
* @default < code > BitmapFillMode . SCALE < / code >
*
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 确 定 位 图 填 充 尺 寸 的 方 式 。
* < p > 设 置 为 < code > BitmapFillMode . REPEAT < / code > 时 , 位 图 将 重 复 以 填 充 区 域 。 < / p >
* < p > 设 置 为 < code > BitmapFillMode . SCALE < / code > 时 , 位 图 将 拉 伸 以 填 充 区 域 。 < / p >
*
* @default < code > BitmapFillMode . SCALE < / code >
*
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
fillMode : string ;
$setFillMode ( value : string ) : boolean ;
/ * *
* The default value of whether or not is smoothed when scaled .
* When object such as Bitmap is created , smoothing property will be set to this value .
* @default true 。
* @version Egret 3.0
* @platform Web
* @language en_US
* /
/ * *
* 控 制 在 缩 放 时 是 否 进 行 平 滑 处 理 的 默 认 值 。
* 在 Bitmap 等 对 象 创 建 时 , smoothing 属 性 会 被 设 置 为 该 值 。
* @default true 。
* @version Egret 3.0
* @platform Web
* @language zh_CN
* /
static defaultSmoothing : boolean ;
/ * *
* Whether or not the bitmap is smoothed when scaled .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 控 制 在 缩 放 时 是 否 对 位 图 进 行 平 滑 处 理 。
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
smoothing : boolean ;
/ * *
* @private
*
* @param value
* /
$setWidth ( value : number ) : boolean ;
/ * *
* @private
*
* @param value
* /
$setHeight ( value : number ) : boolean ;
/ * *
* @private
* 获 取 显 示 宽 度
* /
$getWidth ( ) : number ;
/ * *
* @private
* 获 取 显 示 宽 度
* /
$getHeight ( ) : number ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
* /
$updateRenderNode ( ) : void ;
private _pixelHitTest ;
/ * *
* Specifies whether this object use precise hit testing by checking the alpha value of each pixel . If pixelHitTest
* is set to true , the transparent area of the bitmap will be touched through . < br / >
* Note :If the image is loaded from cross origin , that we can ' t access to the pixel data , so it might cause
* the pixelHitTest property invalid .
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 开 启 精 确 像 素 碰 撞 。 设 置 为 true显示对象本身的透明区域将能够被穿透 。 < br / >
* 注 意 : 若 图 片 资 源 是 以 跨 域 方 式 从 外 部 服 务 器 加 载 的 , 将 无 法 访 问 图 片 的 像 素 数 据 , 而 导 致 此 属 性 失 效 。
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
pixelHitTest : boolean ;
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 渲 染 节 点 类 型
* /
const enum RenderNodeType {
/ * *
* 位 图 渲 染 节 点
* /
BitmapNode = 1 ,
/ * *
* 文 本 渲 染 节 点
* /
TextNode = 2 ,
/ * *
* 矢 量 渲 染 节 点
* /
GraphicsNode = 3 ,
/ * *
* 组 渲 染 节 点
* /
GroupNode = 4 ,
/ * *
* Mesh 节 点
* /
MeshNode = 5 ,
/ * *
* 普 通 位 图 渲 染 节 点
* /
NormalBitmapNode = 6 ,
}
/ * *
* @private
* 渲 染 节 点 基 类
* /
class RenderNode {
/ * *
* 节 点 类 型 . .
* /
type : number ;
/ * *
* 绘 制 数 据
* /
drawData : any [ ] ;
/ * *
* 绘 制 次 数
* /
protected renderCount : number ;
/ * *
* 在 显 示 对 象 的 $updateRenderNode ( ) 方 法 被 调 用 前 , 自 动 清 空 自 身 的 drawData数据 。
* /
cleanBeforeRender ( ) : void ;
$getRenderCount ( ) : number ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 路 径 类 型
* /
const enum PathType {
/ * *
* 纯 色 填 充 路 径
* /
Fill = 1 ,
/ * *
* 渐 变 填 充 路 径
* /
GradientFill = 2 ,
/ * *
* 线 条 路 径
* /
Stroke = 3 ,
}
/ * *
* @private
* 2 D路径命令
* /
const enum PathCommand {
MoveTo = 1 ,
LineTo = 2 ,
CurveTo = 3 ,
CubicCurveTo = 4 ,
}
/ * *
* @private
* 2 D路径
* /
class Path2D {
/ * *
* 路 径 类 型
* /
type : number ;
$commands : number [ ] ;
$data : number | number [ ] [ ] ;
protected commandPosition : number ;
protected dataPosition : number ;
/ * *
* 当 前 移 动 到 的 坐 标 X
* 注 意 : 目 前 只 有 drawArc之前会被赋值
* /
$lastX : number ;
/ * *
* 当 前 移 动 到 的 坐 标 Y
* 注 意 : 目 前 只 有 drawArc之前会被赋值
* /
$lastY : number ;
/ * *
* 将 当 前 绘 图 位 置 移 动 到 ( x , y ) 。 如 果 缺 少 任 何 一 个 参 数 , 则 此 方 法 将 失 败 , 并 且 当 前 绘 图 位 置 不 改 变 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* /
moveTo ( x : number , y : number ) : void ;
/ * *
* 使 用 当 前 线 条 样 式 绘 制 一 条 从 当 前 绘 图 位 置 开 始 到 ( x , y ) 结 束 的 直 线 ; 当 前 绘 图 位 置 随 后 会 设 置 为 ( x , y ) 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* /
lineTo ( x : number , y : number ) : void ;
/ * *
* 使 用 当 前 线 条 样 式 和 由 ( controlX , controlY ) 指 定 的 控 制 点 绘 制 一 条 从 当 前 绘 图 位 置 开 始 到 ( anchorX , anchorY ) 结 束 的 二 次 贝 塞 尔 曲 线 。 当 前 绘 图 位 置 随 后 设 置 为 ( anchorX , anchorY ) 。
* 如 果 在 调 用 moveTo ( ) 方 法 之 前 调 用 了 curveTo ( ) 方 法 , 则 当 前 绘 图 位 置 的 默 认 值 为 ( 0 , 0 ) 。 如 果 缺 少 任 何 一 个 参 数 , 则 此 方 法 将 失 败 , 并 且 当 前 绘 图 位 置 不 改 变 。
* 绘 制 的 曲 线 是 二 次 贝 塞 尔 曲 线 。 二 次 贝 塞 尔 曲 线 包 含 两 个 锚 点 和 一 个 控 制 点 。 该 曲 线 内 插 这 两 个 锚 点 , 并 向 控 制 点 弯 曲 。
* @param controlX 一 个 数 字 , 指 定 控 制 点 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 。
* @param controlY 一 个 数 字 , 指 定 控 制 点 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 。
* @param anchorX 一 个 数 字 , 指 定 下 一 个 锚 点 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 。
* @param anchorY 一 个 数 字 , 指 定 下 一 个 锚 点 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 。
* /
curveTo ( controlX : number , controlY : number , anchorX : number , anchorY : number ) : void ;
/ * *
* 从 当 前 绘 图 位 置 到 指 定 的 锚 点 绘 制 一 条 三 次 贝 塞 尔 曲 线 。 三 次 贝 塞 尔 曲 线 由 两 个 锚 点 和 两 个 控 制 点 组 成 。 该 曲 线 内 插 这 两 个 锚 点 , 并 向 两 个 控 制 点 弯 曲 。
* @param controlX1 指 定 首 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param controlY1 指 定 首 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* @param controlX2 指 定 第 二 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param controlY2 指 定 第 二 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* @param anchorX 指 定 锚 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param anchorY 指 定 锚 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* /
cubicCurveTo ( controlX1 : number , controlY1 : number , controlX2 : number , controlY2 : number , anchorX : number , anchorY : number ) : void ;
/ * *
* 绘 制 一 个 矩 形
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* /
drawRect ( x : number , y : number , width : number , height : number ) : void ;
/ * *
* 绘 制 一 个 圆 角 矩 形 。
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @param ellipseWidth 用 于 绘 制 圆 角 的 椭 圆 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param ellipseHeight 用 于 绘 制 圆 角 的 椭 圆 的 高 度 ( 以 像 素 为 单 位 ) 。 ( 可 选 ) 如 果 未 指 定 值 , 则 默 认 值 与 为 ellipseWidth 参 数 提 供 的 值 相 匹 配 。
* /
drawRoundRect ( x : number , y : number , width : number , height : number , ellipseWidth : number , ellipseHeight? : number ) : void ;
/ * *
* 绘 制 一 个 圆 。
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param radius 圆 的 半 径 ( 以 像 素 为 单 位 ) 。
* /
drawCircle ( x : number , y : number , radius : number ) : void ;
/ * *
* 绘 制 一 个 椭 圆 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* /
drawEllipse ( x : number , y : number , width : number , height : number ) : void ;
/ * *
* 绘 制 一 段 圆 弧 路 径 。 圆 弧 路 径 的 圆 心 在 ( x , y ) 位 置 , 半 径 为 r , 根 据 anticlockwise ( 默 认 为 顺 时 针 ) 指 定 的 方 向 从 startAngle 开 始 绘 制 , 到 endAngle 结 束 。
* @param x 圆 弧 中 心 ( 圆 心 ) 的 x 轴 坐 标 。
* @param y 圆 弧 中 心 ( 圆 心 ) 的 y 轴 坐 标 。
* @param radius 圆 弧 的 半 径 。
* @param startAngle 圆 弧 的 起 始 点 , x轴方向开始计算 , 单 位 以 弧 度 表 示 。
* 注 意 , 必 须 在 0 ~ 2 π 之 间 。
* @param endAngle 圆 弧 的 终 点 , 单 位 以 弧 度 表 示 。
* 注 意 , 必 须 在 0 ~ 2 π 之 间 。
* @param anticlockwise 如 果 为 true , 逆 时 针 绘 制 圆 弧 , 反 之 , 顺 时 针 绘 制 。
* /
drawArc ( x : number , y : number , radius : number , startAngle : number , endAngle : number , anticlockwise : boolean ) : void ;
/ * *
* 绘 制 一 段 圆 弧 路 径
* @param x 圆 弧 中 心 ( 圆 心 ) 的 x 轴 坐 标 。
* @param y 圆 弧 中 心 ( 圆 心 ) 的 y 轴 坐 标 。
* @param radiusX 圆 弧 的 半 径 x 。
* @param radiusY 圆 弧 的 半 径 y 。
* @param startAngle 圆 弧 的 起 始 点 , x轴方向开始计算 , 单 位 以 弧 度 表 示 。
* 注 意 : 必 须 为 正 数 。
* @param endAngle 圆 弧 的 终 点 , 单 位 以 弧 度 表 示 。
* 注 意 : 与 startAngle差值必须在0 ~ 2 π 之 间 。
* @param anticlockwise 如 果 为 true , 逆 时 针 绘 制 圆 弧 , 反 之 , 顺 时 针 绘 制 。
* 注 意 : 如 果 为 true , endAngle必须小于startAngle , 反 之 必 须 大 于 。
* /
private arcToBezier ( x , y , radiusX , radiusY , startAngle , endAngle , anticlockwise ? ) ;
}
}
declare namespace egret {
/ * *
* Writes an error message to the console if the assertion is false . If the assertion is true , nothing will happen .
* @param assertion Any boolean expression . If the assertion is false , the message will get written to the console .
* @param message the message written to the console
* @param optionalParams the extra messages written to the console
* @language en_US
* /
/ * *
* 判 断 参 数 assertion是否为true , 若 为 false则抛出异常并且在console输出相应信息 , 反 之 什 么 也 不 做 。
* @param assertion 一 个 boolean 表 达 式 , 若 结 果 为 false , 则 抛 出 错 误 并 输 出 信 息 。
* @param message 要 输 出 到 控 制 台 的 信 息
* @param optionalParams 要 输 出 到 控 制 台 的 额 外 可 选 信 息
* @language zh_CN
* /
function assert ( assertion? : boolean , message? : string , . . . optionalParams : any [ ] ) : void ;
/ * *
* Writes a warning message to the console .
* @param message the message written to the console
* @param optionalParams the extra messages written to the console
* @language en_US
* /
/ * *
* 输 出 一 个 警 告 信 息 到 控 制 台 。
* @param message 要 输 出 到 控 制 台 的 信 息
* @param optionalParams 要 输 出 到 控 制 台 的 额 外 信 息
* @language zh_CN
* /
function warn ( message? : any , . . . optionalParams : any [ ] ) : void ;
/ * *
* Writes an error message to the console .
* @param message the message written to the console
* @param optionalParams the extra messages written to the console
* @language en_US
* /
/ * *
* 输 出 一 个 错 误 信 息 到 控 制 台 。
* @param message 要 输 出 到 控 制 台 的 信 息
* @param optionalParams 要 输 出 到 控 制 台 的 额 外 信 息
* @language zh_CN
* /
function error ( message? : any , . . . optionalParams : any [ ] ) : void ;
/ * *
* Writes an message to the console .
* @param message the message written to the console
* @param optionalParams the extra messages written to the console
* @language en_US
* /
/ * *
* 输 出 一 个 日 志 信 息 到 控 制 台 。
* @param message 要 输 出 到 控 制 台 的 信 息
* @param optionalParams 要 输 出 到 控 制 台 的 额 外 信 息
* @language zh_CN
* /
function log ( message? : any , . . . optionalParams : any [ ] ) : void ;
}
/ * *
* @private
* /
declare namespace egret {
/ * *
* @private
* /
let fontMapping : { } ;
}
/ * *
* @private
* /
declare namespace egret_native {
function readUpdateFileSync ( filePath : any ) : any ;
function readResourceFileSync ( filePath : any ) : any ;
function sendInfoToPlugin ( info : string ) : void ;
function receivedPluginInfo ( info : string ) : void ;
function nrInit ( ) : void ;
function nrDownloadBuffers ( callback : ( displayCmdBuffer : Float32Array ) = > void ) : void ;
function nrSetRenderMode ( mode : number ) : void ;
function nrRenderDisplayObject ( id : number , scale : number , useClip : boolean , clipX : number , clipY : number , clipW : number , clipH : number ) : void ;
function nrRenderDisplayObject2 ( id : number , offsetX : number , offsetY : number , forHitTest : boolean ) : void ;
function nrLocalToGlobal ( id : number , localX : number , localY : number ) : string ;
function nrGlobalToLocal ( id : number , globalX : number , globalY : number ) : string ;
function nrGetTextFieldWidth ( id : number ) : number ;
function nrGetTextFieldHeight ( id : number ) : number ;
function nrGetTextWidth ( id : number ) : number ;
function nrGetTextHeight ( id : number ) : number ;
function nrResize ( width : number , height : number ) : void ;
function nrSetCanvasScaleFactor ( factor : number , scalex : number , scaley : number ) : void ;
function nrUpdate ( ) : void ;
function nrRender ( ) : void ;
function nrSendTextFieldData ( textFieldId : number , strData : string ) : void ;
function nrUpdateCallbackList ( dt : number ) : void ;
function nrActiveBuffer ( id : number , width : number , height : number ) : void ;
function nrGetPixels ( x : number , y : number , width : number , height : number , pixels : Uint8Array ) : void ;
function nrGetCustomImageId ( type : number ) : number ;
function nrSetCustomImageData ( customImageId : number , pvrtcData : any , width : any , height : any , mipmapsCount : any , format : any ) : void ;
class NrNode {
constructor ( id : number , type : number ) ;
}
}
/ * *
* @private
* /
declare namespace egret_native {
let rootWebGLBuffer : egret.sys.RenderBuffer ;
let forHitTest : boolean ;
let addModuleCallback : ( callback : Function , thisObj : any ) = > void ;
let initNativeRender : ( ) = > void ;
let updateNativeRender : ( ) = > void ;
let activateBuffer : ( buffer : egret.sys.RenderBuffer ) = > void ;
let getJsCustomFilterVertexSrc : ( key : any ) = > any ;
let getJsCustomFilterFragSrc : ( key : any ) = > any ;
let getJsCustomFilterUniforms : ( key : any ) = > any ;
let nrABIVersion : number ;
let nrMinEgretVersion : string ;
}
declare namespace egret_native {
/ * *
* @private
* /
class NativeRenderSurface {
width : number ;
height : number ;
constructor ( currRenderBuffer : any , w? : number , h? : number , root? : boolean ) ;
resize ( w : number , h : number ) : void ;
}
/ * *
* @private
* /
class NativeBitmapData {
$init ( ) : any ;
$id : any ;
}
/ * *
* @private
* /
class NativeDisplayObject {
id : number ;
constructor ( type : number ) ;
setChildrenSortMode ( mode : string ) : void ;
addChildAt ( childId : number , index : number ) : void ;
removeChild ( childId : number ) : void ;
swapChild ( index1 : number , index2 : number ) : void ;
setX ( value : number ) : void ;
setY ( value : number ) : void ;
setRotation ( value : number ) : void ;
setScaleX ( value : number ) : void ;
setScaleY ( value : number ) : void ;
setSkewX ( value : number ) : void ;
setSkewY ( value : number ) : void ;
setAlpha ( value : number ) : void ;
setAnchorOffsetX ( value : number ) : void ;
setAnchorOffsetY ( value : number ) : void ;
setVisible ( value : boolean ) : void ;
setBlendMode ( value : number ) : void ;
setMaskRect ( x : number , y : number , w : number , h : number ) : void ;
setScrollRect ( x : number , y : number , w : number , h : number ) : void ;
setFilters ( filters : Array < egret.Filter > ) : void ;
static createFilter ( filter : egret.Filter ) : void ;
static setFilterPadding ( filterId : number , paddingTop : number , paddingBottom : number , paddingLeft : number , paddingRight : number ) : void ;
setMask ( value : number ) : void ;
static setSourceToNativeBitmapData ( nativeBitmapData : egret_native.NativeBitmapData , source : any ) : any ;
setTexture ( texture : egret.Texture ) : void ;
setBitmapDataToMesh ( texture : egret.Texture ) : void ;
setBitmapDataToParticle ( texture : egret.Texture ) : void ;
setWidth ( value : number ) : void ;
setHeight ( value : number ) : void ;
setCacheAsBitmap ( value : boolean ) : void ;
setBitmapFillMode ( fillMode : string ) : void ;
setScale9Grid ( x : number , y : number , w : number , h : number ) : void ;
setMatrix ( a : number , b : number , c : number , d : number , tx : number , ty : number ) : void ;
setIsTyping ( value : boolean ) : void ;
setDataToBitmapNode ( id : number , texture : egret.Texture , arr : number [ ] ) : void ;
setDataToMesh ( vertexArr : number [ ] , indiceArr : number [ ] , uvArr : number [ ] ) : void ;
static setDataToFilter ( currFilter : egret.Filter ) : void ;
static disposeNativeBitmapData ( nativeBitmapData : egret_native.NativeBitmapData ) : void ;
static disposeTextData ( node : egret.TextField ) : void ;
static disposeGraphicData ( graphic : egret.Graphics ) : void ;
setFontSize ( value : number ) : void ;
setLineSpacing ( value : number ) : void ;
setTextColor ( value : number ) : void ;
setTextFieldWidth ( value : number ) : void ;
setTextFieldHeight ( value : number ) : void ;
setFontFamily ( value : string ) : void ;
setTextFlow ( textArr : Array < egret.ITextElement > ) : void ;
setTextAlign ( value : string ) : void ;
setVerticalAlign ( value : string ) : void ;
setText ( value : string ) : void ;
setBold ( value : boolean ) : void ;
setItalic ( value : boolean ) : void ;
setWordWrap ( value : boolean ) : void ;
setMaxChars ( value : number ) : void ;
setType ( value : string ) : void ;
setStrokeColor ( value : number ) : void ;
setStroke ( value : number ) : void ;
setScrollV ( value : number ) : void ;
setMultiline ( value : boolean ) : void ;
setBorder ( value : boolean ) : void ;
setBorderColor ( value : number ) : void ;
setBackground ( value : boolean ) : void ;
setBackgroundColor ( value : number ) : void ;
setInputType ( value : string ) : void ;
setBeginFill ( color : number , alpha? : number ) : void ;
setBeginGradientFill ( type : string , colors : number [ ] , alphas : number [ ] , ratios : number [ ] , matrix : egret.Matrix ) : void ;
setEndFill ( ) : void ;
setLineStyle ( thickness? : number , color? : number , alpha? : number , pixelHinting? : boolean , scaleMode? : string , caps? : string , joints? : string , miterLimit? : number , lineDash? : number [ ] ) : void ;
setDrawRect ( x : number , y : number , width : number , height : number ) : void ;
setDrawRoundRect ( x : number , y : number , width : number , height : number , ellipseWidth : number , ellipseHeight? : number ) : void ;
setDrawCircle ( x : number , y : number , radius : number ) : void ;
setDrawEllipse ( x : number , y : number , width : number , height : number ) : void ;
setMoveTo ( x : number , y : number ) : void ;
setLineTo ( x : number , y : number ) : void ;
setCurveTo ( controlX : number , controlY : number , anchorX : number , anchorY : number ) : void ;
setCubicCurveTo ( controlX1 : number , controlY1 : number , controlX2 : number , controlY2 : number , anchorX : number , anchorY : number ) : void ;
setDrawArc ( x : number , y : number , radius : number , startAngle : number , endAngle : number , anticlockwise? : boolean ) : void ;
setGraphicsClear ( ) : void ;
}
}
/ * *
* @private
* /
declare namespace egret_native {
/ * *
* @private
* /
const enum NativeObjectType {
/ * *
* 容 器
* /
CONTAINER = 0 ,
/ * *
* 位 图
* /
BITMAP = 1 ,
/ * *
* 位 图 数 据
* /
BITMAP_DATA = 2 ,
/ * *
* 滤 镜
* /
FILTER = 6 ,
/ * *
* 文 本
* /
TEXT = 7 ,
/ * *
* 矢 量 绘 图
* /
GRAPHICS = 8 ,
/ * *
* 含 一 个 适 量 绘 图 的 容 器
* /
SPRITE = 9 ,
/ * *
* 粒 子 系 统
* /
PARTICLE_SYSTEM = 10 ,
/ * *
* 位 图 文 本
* /
BITMAP_TEXT = 11 ,
/ * *
* 网 格
* /
MESH = 12 ,
/ * *
* 舞 台 ( 根 容 器 )
* /
STAGE = 13 ,
}
}
declare namespace egret {
/ * *
* @private
* /
interface MapLike < T > {
[ key : string ] : T ;
[ key : number ] : T ;
}
/ * *
* @private
* /
function createMap < T > ( ) : MapLike < T > ;
}
declare namespace egret {
/ * *
* @class egret . GlowFilter
* @classdesc
* 使 用 GlowFilter 类 可 以 对 显 示 对 象 应 用 发 光 效 果 。 在 投 影 滤 镜 的 distance 和 angle 属 性 设 置 为 0 时 , 发 光 滤 镜 与 投 影 滤 镜 极 为 相 似 。
* @extends egret . Filter
* @version Egret 3.1 . 4
* @platform Web , Native
* /
class GlowFilter extends Filter {
/ * *
* @private
* /
$red : number ;
/ * *
* @private
* /
$green : number ;
/ * *
* @private
* /
$blue : number ;
/ * *
* Initializes a new GlowFilter instance .
* @method egret . GlowFilter # constructor
* @param color { number } The color of the glow . Valid values are in the hexadecimal format 0 xRRGGBB . The default value is 0xFF0000 .
* @param alpha { number } The alpha transparency value for the color . Valid values are 0 to 1 . For example , . 25 sets a transparency value of 25 % . The default value is 1 .
* @param blurX { number } The amount of horizontal blur . Valid values are 0 to 255 ( floating point ) .
* @param blurY { number } The amount of vertical blur . Valid values are 0 to 255 ( floating point ) .
* @param strength { number } The strength of the imprint or spread . The higher the value , the more color is imprinted and the stronger the contrast between the glow and the background . Valid values are 0 to 255 .
* @param quality { number } The number of times to apply the filter .
* @param inner { boolean } Specifies whether the glow is an inner glow . The value true indicates an inner glow . The default is false , an outer glow ( a glow around the outer edges of the object ) .
* @param knockout { number } Specifies whether the object has a knockout effect . A value of true makes the object ' s fill transparent and reveals the background color of the document . The default value is false ( no knockout effect ) .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 初 始 化 GlowFilter 对 象
* @method egret . GlowFilter # constructor
* @param color { number } 光 晕 颜 色 , 采 用 十 六 进 制 格 式 0 xRRGGBB 。 默 认 值 为 0xFF0000 。
* @param alpha { number } 颜 色 的 Alpha 透 明 度 值 。 有 效 值 为 0 到 1 。 例 如 , 0.25 设 置 透 明 度 值 为 25 % 。
* @param blurX { number } 水 平 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param blurY { number } 垂 直 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param strength { number } 印 记 或 跨 页 的 强 度 。 该 值 越 高 , 压 印 的 颜 色 越 深 , 而 且 发 光 与 背 景 之 间 的 对 比 度 也 越 强 。 有 效 值 为 0 到 255 。
* @param quality { number } 应 用 滤 镜 的 次 数 。 暂 未 实 现 。
* @param inner { boolean } 指 定 发 光 是 否 为 内 侧 发 光 。 值 true 指 定 发 光 是 内 侧 发 光 。 值 false 指 定 发 光 是 外 侧 发 光 ( 对 象 外 缘 周 围 的 发 光 ) 。
* @param knockout { number } 指 定 对 象 是 否 具 有 挖 空 效 果 。 值 为 true 将 使 对 象 的 填 充 变 为 透 明 , 并 显 示 文 档 的 背 景 颜 色 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
constructor ( color? : number , alpha? : number , blurX? : number , blurY? : number , strength? : number , quality? : number , inner? : boolean , knockout? : boolean ) ;
/ * *
* @private
* /
$color : number ;
/ * *
* The color of the glow .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 光 晕 颜 色 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
color : number ;
/ * *
* @private
* /
$alpha : number ;
/ * *
* The alpha transparency value for the color .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 颜 色 的 Alpha 透 明 度 值 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
alpha : number ;
/ * *
* @private
* /
$blurX : number ;
/ * *
* The amount of horizontal blur .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 水 平 模 糊 量 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
blurX : number ;
/ * *
* @private
* /
$blurY : number ;
/ * *
* The amount of vertical blur .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 垂 直 模 糊 量 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
blurY : number ;
/ * *
* @private
* /
$strength : number ;
/ * *
* The strength of the imprint or spread .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 印 记 或 跨 页 的 强 度 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
strength : number ;
/ * *
* @private
* /
$quality : number ;
/ * *
* The number of times to apply the filter .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 应 用 滤 镜 的 次 数 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
quality : number ;
/ * *
* @private
* /
$inner : boolean ;
/ * *
* Specifies whether the glow is an inner glow .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 指 定 发 光 是 否 为 内 侧 发 光 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
inner : boolean ;
/ * *
* @private
* /
$knockout : boolean ;
/ * *
* Specifies whether the object has a knockout effect .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 指 定 对 象 是 否 具 有 挖 空 效 果 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
knockout : boolean ;
/ * *
* @private
* /
$toJson ( ) : string ;
protected updatePadding ( ) : void ;
}
}
declare namespace egret {
/ * *
* The Stage class represents the main drawing area . The Stage object is not globally accessible . You need to access
* it through the stage property of a DisplayObject instance . < br / >
* The Stage class has several ancestor classes — Sprite , DisplayObject , and EventDispatcher — from which it inherits
* properties and methods . Many of these properties and methods are inapplicable to Stage objects .
* @event egret . Event . RESIZE Dispatched when the stageWidth or stageHeight property of the Stage object is changed .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Stage . ts
* @language en_US
* /
/ * *
* Stage 类 代 表 主 绘 图 区 。
* 可 以 利 用 DisplayObject 实 例 的 stage 属 性 进 行 访 问 。 < br / >
* Stage 类具有多个祖代类 : Sprite 、 DisplayObject 和 EventDispatcher , 属 性 和 方 法 便 是 从 这 些 类 继 承 而 来 的 。
* 从 这 些 继 承 的 许 多 属 性 和 方 法 不 适 用 于 Stage 对 象 。
* @event egret . Event . RESIZE 当 stageWidth或stageHeight属性发生改变时调度
* @event egret . Event . DEACTIVATE 当 stage失去焦点后调度
* @event egret . Event . ACTIVATE 当 stage获得焦点后调度
*
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Stage . ts
* @language zh_CN
* /
class Stage extends DisplayObjectContainer {
/ * *
* @private
* Stage不许允许自行实例化
* @version Egret 2.4
* @platform Web , Native
* /
constructor ( ) ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* Gets and sets the frame rate of the stage . The frame rate is defined as frames per second . Valid range for the
* frame rate is from 0.01 to 1000 frames per second . < br / >
* Note : setting the frameRate property of one Stage object changes the frame rate for all Stage objects
* @default 30
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 并 设 置 舞 台 的 帧 速 率 。 帧 速 率 是 指 每 秒 显 示 的 帧 数 。 帧 速 率 的 有 效 范 围 为 每 秒 0.01 到 60 个 帧 。 < br / >
* 注意 : 修改任何一个Stage的frameRate属性都会同步修改其他Stage的帧率 。
* @default 30
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
frameRate : number ;
/ * *
* @private
* /
$stageWidth : number ;
/ * *
* Indicates the width of the stage , in pixels .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 舞 台 的 当 前 宽 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly stageWidth : number ;
/ * *
* @private
* /
$stageHeight : number ;
/ * *
* Indicates the height of the stage , in pixels .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 舞 台 的 当 前 高 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly stageHeight : number ;
/ * *
* After you call the invalidate ( ) method , when the display list is next rendered , the Egret runtime sends a render
* event to each display object that has registered to listen for the render event . You must call the invalidate ( )
* method each time you want the Egret runtime to send render events .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 调 用 invalidate ( ) 方 法 后 , 在 显 示 列 表 下 次 呈 现 时 , Egret 会 向 每 个 已 注 册 侦 听 Event . RENDER 事 件 的 显 示 对 象 发 送 一 个 Event . RENDER 事 件 。
* 每 次 您 希 望 Egret 发 送 Event . RENDER 事 件 时 , 都 必 须 调 用 invalidate ( ) 方 法 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
invalidate ( ) : void ;
/ * *
* @deprecated
* /
registerImplementation ( interfaceName : string , instance : any ) : void ;
/ * *
* @deprecated
* /
getImplementation ( interfaceName : string ) : any ;
/ * *
* @private
* 设 备 屏 幕 引 用
* /
$screen : egret.sys.Screen ;
$scaleMode : string ;
/ * *
* A StageScaleMode class that specifies which scale mode to use . The following are valid values : < br / >
* < ul >
* < li > StageScaleMode . EXACT_FIT -- The entire application be visible in the specified area without trying to preserve the original aspect ratio . Distortion can occur , the application may be stretched or compressed . < / li >
* < li > StageScaleMode . SHOW_ALL -- The entire application is visible in the specified area without distortion while maintaining the application of the original aspect ratio . Applications may display border . < / li >
* < li > StageScaleMode . NO_SCALE -- The size of the entire application is fixed , so that even if the size of the player window changes , it remains unchanged . If the player window is smaller than the content , it may do some trimming . < / li >
* < li > StageScaleMode . NO_BORDER -- Keep the original aspect ratio scaling application content , after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut . < / li >
* < li > StageScaleMode . FIXED_WIDTH -- Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , but only to keep the contents of the original application constant width , height may change . < / li >
* < li > StageScaleMode . FIXED_HEIGHT -- Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , but only to keep the contents of the original application constant height , width may change . < / li >
* < / ul >
* @default egret . StageScaleMode . SHOW_ALL
* @language en_US
* /
/ * *
* 一 个 StageScaleMode 类 中 指 定 要 使 用 哪 种 缩 放 模 式 的 值 。 以 下 是 有 效 值 : < br / >
* < ul >
* < li > StageScaleMode . EXACT_FIT -- 整 个 应 用 程 序 在 指 定 区 域 中 可 见 , 但 不 尝 试 保 持 原 始 高 宽 比 。 可 能 会 发 生 扭 曲 , 应 用 程 序 可 能 会 拉 伸 或 压 缩 显 示 。 < / li >
* < li > StageScaleMode . SHOW_ALL -- 整 个 应 用 程 序 在 指 定 区 域 中 可 见 , 且 不 发 生 扭 曲 , 同 时 保 持 应 用 程 序 的 原 始 高 宽 比 。 应 用 程 序 的 可 能 会 显 示 边 框 。 < / li >
* < li > StageScaleMode . NO_SCALE -- 整 个 应 用 程 序 的 大 小 固 定 , 因 此 , 即 使 播 放 器 窗 口 的 大 小 更 改 , 它 也 会 保 持 不 变 。 如 果 播 放 器 窗 口 比 内 容 小 , 则 可 能 进 行 一 些 裁 切 。 < / li >
* < li > StageScaleMode . NO_BORDER -- 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 的 较 窄 方 向 填 满 播 放 器 视 口 , 另 一 个 方 向 的 两 侧 可 能 会 超 出 播 放 器 视 口 而 被 裁 切 。 < / li >
* < li > StageScaleMode . FIXED_WIDTH -- 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 但 只 保 持 应 用 程 序 内 容 的 原 始 宽 度 不 变 , 高 度 可 能 会 改 变 。 < / li >
* < li > StageScaleMode . FIXED_HEIGHT -- 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 但 只 保 持 应 用 程 序 内 容 的 原 始 高 度 不 变 , 宽 度 可 能 会 改 变 。 < / li >
* < / ul >
* @default egret . StageScaleMode . SHOW_ALL
* @language zh_CN
* /
scaleMode : string ;
$orientation : string ;
/ * *
* Horizontal and vertical screen display screen , can only be set under the current Native in the configuration file . A egret . OrientationMode class that specifies which display mode to use . The following are valid values : < br / >
* < ul >
* < li > egret . OrientationMode . AUTO -- Always follow the direction of application display screen , always guaranteed by the look down . < / li >
* < li > egret . OrientationMode . PORTRAIT -- Applications remain portrait mode , namely horizontal screen look , the screen from left to right . < / li >
* < li > egret . OrientationMode . LANDSCAPE -- Applications remain horizontal screen mode , namely vertical screen , the screen from right to left . < / li >
* < li > egret . OrientationMode . LANDSCAPE_FLIPPED -- Applications remain horizontal screen mode , namely vertical screen , the screen from left to right . < / li >
* < / ul >
* @platform Web
* @version 2.4
* @language en_US
* /
/ * *
* 屏 幕 横 竖 屏 显 示 方 式 , 目 前 Native 下 只 能 在 配 置 文 件 里 设 置 。 一 个 egret . OrientationMode 类 中 指 定 要 使 用 哪 种 显 示 方 式 。 以 下 是 有 效 值 : < br / >
* < ul >
* < li > egret . OrientationMode . AUTO -- 应 用 始 终 跟 随 屏 幕 的 方 向 显 示 , 始 终 保 证 由 上 往 下 看 。 < / li >
* < li > egret . OrientationMode . PORTRAIT -- 应 用 始 终 保 持 竖 屏 模 式 , 即 横 屏 看 时 , 屏 幕 由 左 往 右 看 。 < / li >
* < li > egret . OrientationMode . LANDSCAPE -- 应 用 始 终 保 持 横 屏 模 式 , 即 竖 屏 看 时 , 屏 幕 显 示 由 右 往 左 。 < / li >
* < li > egret . OrientationMode . LANDSCAPE_FLIPPED -- 应 用 始 终 保 持 横 屏 模 式 , 即 竖 屏 看 时 , 屏 幕 显 示 由 左 往 右 。 < / li >
* < / ul >
* @platform Web
* @version 2.4
* @language zh_CN
* /
orientation : string ;
/ * *
* Draw texture zoom ratio
* @default 1
* @language en_US
* /
/ * *
* 绘 制 纹 理 的 缩 放 比 率 , 默 认 值 为 1
* @default 1
* @language zh_CN
* /
textureScaleFactor : number ;
$maxTouches : number ;
/ * *
* Set the number of screens can simultaneously touch . Above this amount will not be triggered in response .
* @default 99
* @language en_US
* /
/ * *
* 设 置 屏 幕 同 时 可 以 触 摸 的 数 量 。 高 于 这 个 数 量 将 不 会 被 触 发 响 应 。
* @default 99
* @language zh_CN
* /
maxTouches : number ;
/ * *
* Set resolution size
* @param width width
* @param height height
* @version Egret 2.5 . 5
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 分 辨 率 尺 寸
* @param width 宽 度
* @param height 高 度
* @version Egret 2.5 . 5
* @platform Web , Native
* @language zh_CN
* /
setContentSize ( width : number , height : number ) : void ;
}
}
declare namespace egret {
/ * *
* A class that provides constant values for visual blend mode effects . These constants are used in the blendMode
* property of the DisplayObject class .
* @see egret . DisplayObject # blendMode
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / BlendMode . ts
* @see http : //edn.egret.com/cn/docs/page/108 显示容器的概念与实现
* @language en_US
* /
/ * *
* 提 供 混 合 模 式 可 视 效 果 的 常 量 值 的 类 , 通 常 用 于 DisplayObject 的 blendMode 属 性 上 。
* @see egret . DisplayObject # blendMode
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / BlendMode . ts
* @see http : //edn.egret.com/cn/docs/page/108 显示容器的概念与实现
* @language zh_CN
* /
class BlendMode {
/ * *
* The display object appears in front of the background . Pixel values of the display object override the pixel
* values of the background . Where the display object is transparent , the background is visible .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 该 显 示 对 象 出 现 在 背 景 前 面 。 显 示 对 象 的 像 素 值 会 覆 盖 背 景 的 像 素 值 。 在 显 示 对 象 为 透 明 的 区 域 , 背 景 是 可 见 的 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static NORMAL : string ;
/ * *
* Adds the values of the constituent colors of the display object to the colors of its background , applying a
* ceiling of 0xFF . This setting is commonly used for animating a lightening dissolve between two objects . < br / >
* For example , if the display object has a pixel with an RGB value of 0xAAA633 , and the background pixel has an
* RGB value of 0xDD2200 , the resulting RGB value for the displayed pixel is 0xFFC833 ( because 0xAA + 0xDD > 0xFF ,
* 0xA6 + 0x22 = 0xC8 , and 0x33 + 0x00 = 0x33 ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 显 示 对 象 的 原 色 值 添 加 到 它 的 背 景 颜 色 中 , 上 限 值 为 0xFF 。 此 设 置 通 常 用 于 使 两 个 对 象 间 的 加 亮 溶 解 产 生 动 画 效 果 。 < br / >
* 例 如 , 如 果 显 示 对 象 的 某 个 像 素 的 RGB 值 为 0xAAA633 , 背 景 像 素 的 RGB 值 为 0xDD2200 , 则 显 示 像 素 的 结 果 RGB 值 为 0xFFC833
* ( 因 为 0xAA + 0xDD > 0xFF , 0xA6 + 0x22 = 0xC8 , 且 0x33 + 0x00 = 0x33 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ADD : string ;
/ * *
* Erases the background based on the alpha value of the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 根 据 显 示 对 象 的 Alpha 值 擦 除 背 景 。 Alpha 值 不 为 0 的 区 域 将 被 擦 除 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ERASE : string ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 转 换 blendMode 字 符 串 为 数 字 。
* /
function blendModeToNumber ( blendMode : string ) : number ;
/ * *
* @private
* 转 换 数 字 为 blendMode 字 符 串 。
* /
function numberToBlendMode ( blendMode : number ) : string ;
}
declare namespace egret {
/ * *
* The ChildrenSortMode class defines a pattern enumeration for children sort mode of egret . DisplayObjectContainer .
* @version Egret 5.2 . 19
* @platform Native
* @language en_US
* /
/ * *
* BitmapFillMode 类 定 义 egret . DisplayObjectContainer的子项目排序方式 。
* @version Egret 5.2 . 19
* @platform Native
* @language zh_CN
* /
const ChildrenSortMode : {
DEFAULT : string ;
INCREASE_Y : string ;
DECREASE_Y : string ;
} ;
}
declare namespace egret {
/ * *
* The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines .
* The constants are provided for use as values in the caps parameter of the egret . Graphics . lineStyle ( ) method .
* @see egret . Graphics # lineStyle ( )
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* CapsStyle 类 是 可 指 定 在 绘 制 线 条 中 使 用 的 端 点 样 式 的 常 量 值 枚 举 。 常 量 可 用 作 egret . Graphics . lineStyle ( ) 方 法 的 caps 参 数 中 的 值 。
* @see egret . Graphics # lineStyle ( )
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
const CapsStyle : {
NONE : string ;
ROUND : string ;
SQUARE : string ;
} ;
}
declare namespace egret {
/ * *
* @private
* /
class WebGLUtils {
static compileProgram ( gl : WebGLRenderingContext , vertexSrc : string , fragmentSrc : string ) : WebGLProgram ;
static compileFragmentShader ( gl : WebGLRenderingContext , shaderSrc : string ) : WebGLShader ;
static compileVertexShader ( gl : WebGLRenderingContext , shaderSrc : string ) : WebGLShader ;
private static _compileShader ( gl , shaderSrc , shaderType ) ;
private static canUseWebGL ;
static checkCanUseWebGL ( ) : boolean ;
static deleteWebGLTexture ( webglTexture : WebGLTexture ) : void ;
/ * *
* inspired by pixi . js
* /
static premultiplyTint ( tint : number , alpha : number ) : number ;
}
}
declare namespace egret {
/ * *
* The EventPhase class provides values for the eventPhase property of the Event class .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / EventPhase . ts
* @language en_US
* /
/ * *
* EventPhase 可 为 Event 类 的 eventPhase 属 性 提 供 值 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / EventPhase . ts
* @language zh_CN
* /
const enum EventPhase {
/ * *
* The capturing phase , which is the first phase of the event flow .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 捕 获 阶 段 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
CAPTURING_PHASE = 1 ,
/ * *
* The target phase , which is the second phase of the event flow .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 目 标 阶 段 , 是 事 件 流 的 第 二 个 阶 段 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
AT_TARGET = 2 ,
/ * *
* The bubbling phase , which is the third phase of the event flow .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 冒 泡 阶 段 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
BUBBLING_PHASE = 3 ,
}
}
declare namespace egret {
/ * *
* When the user changes the focus from one object in the display list to another object , the object dispatches a FocusEvent object . Currently only supports input text .
* Focus events : FocusEvent.FOCUS_IN FocusEvent . FOCUS_OUT
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 户 将 焦 点 从 显 示 列 表 中 的 一 个 对 象 更 改 到 另 一 个 对 象 时 , 对 象 将 调 度 FocusEvent 对 象 。 目 前 只 支 持 输 入 文 本 。
* 焦 点 事 件 : FocusEvent . FOCUS_IN FocusEvent . FOCUS_OUT
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class FocusEvent extends egret . Event {
/ * *
* Gets focus
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 得 焦 点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static FOCUS_IN : "focusIn" ;
/ * *
* Loses focus
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 失 去 焦 点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static FOCUS_OUT : "focusOut" ;
/ * *
* Create a egret . FocusEvent objects
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . FocusEvent 对 象
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean ) ;
}
}
declare namespace egret {
interface Geolocation {
addEventListener < Z > ( type : "ioError" , listener : ( this : Z , e : GeolocationEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* The GeolocationEvent represents the position and altitude of the device on Earth ,
* and show errors occurred while getting the location of the device .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / Geolocation . ts
* @see http : //edn.egret.com/cn/docs/page/662 获取位置信息
* @language en_US
* /
/ * *
* GeolocationEvent 提 供 设 备 的 地 理 位 置 信 息 和 获 取 位 置 时 发 生 的 错 误 信 息
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / Geolocation . ts
* @see http : //edn.egret.com/cn/docs/page/662 获取位置信息
* @language zh_CN
* /
class GeolocationEvent extends Event {
/ * *
* The acquisition of the location information failed because of app don ' t have permission .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 由 于 用 户 拒 绝 访 问 位 置 信 息 , 获 取 位 置 信 息 失 败
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static PERMISSION_DENIED : string ;
/ * *
* The acquisition of the location failed because at least one internal source of position returned an internal error .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 备 位 置 服 务 不 可 用 或 者 超 时 等 原 因 没 有 得 到 位 置 信 息
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static UNAVAILABLE : string ;
/ * *
* The position ' s longitude in decimal degrees .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 位 置 的 经 度 信 息
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
longitude : number ;
/ * *
* The position ' s latitude in decimal degrees .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 位 置 的 纬 度 信 息
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
latitude : number ;
/ * *
* The velocity of the device in meters per second . This value can be null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 设 备 的 速 度 单 位 是 米 / 秒 , 这 个 值 可 能 为 null
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
speed : number ;
/ * *
* The direction in which the device is traveling . This value , specified in degrees ,
* indicates how far off from heading due north the device is . 0 degrees represents
* true true north , and the direction is determined clockwise ( which means that east
* is 90 degrees and west is 270 degrees ) . If speed is 0 , heading is NaN . If the
* device is unable to provide heading information , this value is null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 设 备 正 在 前 进 的 方 向 , 单 位 是 度 。 heading 表 示 从 正 北 开 始 顺 时 针 旋 转 到 当 前 方 向 的 角 度 ,
* 比 如 正 东 是 90 度 , 正 西 是 270 度 , 如 果 speed 是 0 , heading 为 NaN 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
heading : number ;
/ * *
* The position ' s altitude in metres , relative to sea level .
* This value can be null if the implementation cannot provide the data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 该 位 置 的 海 拔 信 息 , 如 果 设 备 没 有 实 现 这 个 属 性 时 , 这 个 值 有 可 能 为 null
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
altitude : number ;
/ * *
* The accuracy of the latitude and longitude properties , expressed in meters .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 经 纬 度 的 准 确 性 , 单 位 是 米
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
accuracy : number ;
/ * *
* The accuracy of the altitude expressed in meters . This value can be null .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 该 位 置 海 拔 信 息 的 准 确 性 , 单 位 是 米 , 这 个 值 有 可 能 为 null
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
altitudeAccuracy : number ;
/ * *
* The type of error occurred while get the location of the device . The value could be :
* @see egret . GeolocationEvent . PERMISSION_DENIED
* @see egret . GeolocationEvent . UNAVAILABLE
*
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 位 置 信 息 错 误 时 的 错 误 类 型 。 值 可 能 为 :
* @see egret . GeolocationEvent . PERMISSION_DENIED
* @see egret . GeolocationEvent . UNAVAILABLE
*
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
errorType : string ;
/ * *
* The error message occurred while get the location of the device .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 位 置 信 息 错 误 的 错 误 信 息
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
errorMessage : string ;
}
}
declare namespace egret {
/ * *
* When a network request returns an HTTP status code , the application dispatches HTTPStatusEvent objects .
* Before error or completion events will always send HTTPStatusEvent object . HTTPStatusEvent object does not necessarily indicate an error condition ; it simply reflects the HTTP status code provided by the network stack ( if any ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 网 络 请 求 返 回 HTTP 状 态 代 码 时 , 应 用 程 序 将 调 度 HTTPStatusEvent 对 象 。
* 在 错 误 或 完 成 事 件 之 前 , 将 始 终 发 送 HTTPStatusEvent 对 象 。 HTTPStatusEvent 对 象 不 一 定 表 示 错 误 条 件 ; 它 仅 反 映 网 络 堆 栈 提 供 的 HTTP 状 态 代 码 ( 如 果 有 的 话 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class HTTPStatusEvent extends Event {
/ * *
* HTTPStatusEvent . HTTP_STATUS constant defines the value of the type property httpStatus event object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* HTTPStatusEvent . HTTP_STATUS 常 量 定 义 httpStatus 事 件 对 象 的 type 属 性 值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static HTTP_STATUS : "httpStatus" ;
/ * *
* Create a egret . HTTPStatusEvent objects
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . HTTPStatusEvent 对 象
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean ) ;
/ * *
* @private
* /
private _status ;
/ * *
* he server returns the HTTP status code .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 由 服 务 器 返 回 的 HTTP 状 态 代 码 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly status : number ;
/ * *
* EventDispatcher object using the specified event object thrown Event . The objects will be thrown in the object cache pool for the next round robin .
* @param target { egret . IEventDispatcher } Distribute event target
* @param status { number } The server returns the HTTP status code
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出Event事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target { egret . IEventDispatcher } 派 发 事 件 目 标
* @param status { number } 由 服 务 器 返 回 的 HTTP 状 态 代 码
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchHTTPStatusEvent ( target : IEventDispatcher , status : number ) : boolean ;
}
}
declare namespace egret {
/ * *
* The IEventDispatcher interface defines methods for adding or removing event listeners , checks whether specific types
* of event listeners are registered , and dispatches events . Event targets are an important part of the Egret event model .
* The event target serves as the focal point for how events flow through the display list hierarchy . When an event
* such as a touch tap occurs , an event object is dispatched into the event flow from the root of the display list .
* The event object makes a round - trip journey to the event target , which is conceptually divided into three phases : < br / >
* the capture phase includes the journey from the root to the last node before the event target ' s node ; the target
* phase includes only the event target node ; and the bubbling phase includes any subsequent nodes encountered on the
* return trip to the root of the display list . In general , the easiest way for a user - defined class to gain event
* dispatching capabilities is to extend EventDispatcher . If this is impossible ( that is , if the class is already
* extending another class ) , you can instead implement the IEventDispatcher interface , create an EventDispatcher member ,
* and write simple hooks to route calls into the aggregated EventDispatcher .
* @see egret . EventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / IEventDispatcher . ts
* @language en_US
* /
/ * *
* IEventDispatcher 接 口 定 义 用 于 添 加 或 删 除 事 件 侦 听 器 的 方 法 , 检 查 是 否 已 注 册 特 定 类 型 的 事 件 侦 听 器 , 并 调 度 事 件 。
* 事 件 目 标 是 Egret 事 件 模 型 的 重 要 组 成 部 分 。 事 件 目 标 是 事 件 如 何 通 过 显 示 列 表 层 次 结 构 这 一 问 题 的 焦 点 。 当 发 生 触 摸 轻 拍 事 件 时 ,
* 会 将 事 件 对 象 调 度 到 从 显 示 列 表 根 开 始 的 事 件 流 中 。 事 件 对 象 进 行 到 事 件 目 标 的 往 返 行 程 , 在 概 念 上 , 此 往 返 行 程 被 划 分 为 三 个 阶 段 : < br / >
* 捕 获 阶 段 包 括 从 根 到 事 件 目 标 节 点 之 前 的 最 后 一 个 节 点 的 行 程 , 目 标 阶 段 仅 包 括 事 件 目 标 节 点 , 冒 泡 阶 段 包 括 到 显 示 列 表 的 根 的 回 程 上 遇 到 的 任 何 后 续 节 点 。
* 通 常 , 使 用 户 定 义 的 类 能 够 调 度 事 件 的 最 简 单 方 法 是 扩 展 EventDispatcher 。 如 果 无 法 扩 展 ( 即 , 如 果 该 类 已 经 扩 展 了 另 一 个 类 ) ,
* 则 可 以 实 现 IEventDispatcher 接 口 , 创 建 EventDispatcher 成 员 , 并 编 写 一 些 简 单 的 挂 钩 , 将 调 用 连 接 到 聚 合 的 EventDispatcher 中 。
* @see egret . EventDispatcher
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / IEventDispatcher . ts
* @language zh_CN
* /
interface IEventDispatcher extends HashObject {
/ * *
* Registers an event listener object with an EventDispatcher object so that the listener receives notification of an
* event . You can register event listeners on all nodes in the display list for a specific type of event , phase ,
* and priority . After you successfully register an event listener , you cannot change its priority through additional
* calls to on ( ) . To change a listener ' s priority , you must first call removeEventListener ( ) . Then you can register the
* listener again with the new priority level . After the listener is registered , subsequent calls to on ( ) with a
* different value for either type or useCapture result in the creation of a separate listener registration . < br / >
* When you no longer need an event listener , remove it by calling EventDispatcher . removeEventListener ( ) ; otherwise , memory
* problems might result . Objects with registered event listeners are not automatically removed from memory because
* the garbage collector does not remove objects that still have references . Copying an EventDispatcher instance does
* not copy the event listeners attached to it . ( If your newly created node needs an event listener , you must attach
* the listener after creating the node . ) However , if you move an EventDispatcher instance , the event listeners attached
* to it move along with it . If the event listener is being registered on a node while an event is also being processed
* on this node , the event listener is not triggered during the current phase but may be triggered during a later phase
* in the event flow , such as the bubbling phase . If an event listener is removed from a node while an event is being
* processed on the node , it is still triggered by the current actions . After it is removed , the event listener is
* never invoked again ( unless it is registered again for future processing ) .
* @param type The type of event .
* @param listener The listener function that processes the event . This function must accept an event object as
* its only parameter and must return nothing , as this example shows : function ( evt :Event ) : void The function can
* have any name .
* @param thisObject the listener function ' s "this"
* @param useCapture Determines whether the listener works in the capture phase or the bubbling phases . If useCapture
* is set to true , the listener processes the event only during the capture phase and not in the bubbling phase .
* If useCapture is false , the listener processes the event only during the bubbling phase . To listen for the event
* in all three phases , call on ( ) twice , once with useCapture set to true , then again with useCapture set to false .
* @param priority The priority level of the event listener . Priorities are designated by a integer . The higher
* the number , the higher the priority . All listeners with priority n are processed before listeners of priority n - 1 .
* If two or more listeners share the same priority , they are processed in the order in which they were added .
* The default priority is
* @see # once ( )
* @see # removeEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 EventDispatcher 对 象 注 册 事 件 侦 听 器 对 象 , 以 使 侦 听 器 能 够 接 收 事 件 通 知 。 可 以 为 特 定 类 型 的 事 件 、 阶 段 和 优 先 级 在 显 示 列 表 的 所 有 节
* 点 上 注 册 事 件 侦 听 器 。 成 功 注 册 一 个 事 件 侦 听 器 后 , 无 法 通 过 额 外 调 用 on ( ) 来 更 改 其 优 先 级 。 要 更 改 侦 听 器 的 优 先 级 , 必 须
* 先 调 用 removeEventListener ( ) 。 然 后 , 可 以 使 用 新 的 优 先 级 再 次 注 册 该 侦 听 器 。 注 册 该 侦 听 器 后 , 如 果 继 续 调 用 具 有 不 同 type 或 useCapture
* 值 的 on ( ) , 则 会 创 建 单 独 的 侦 听 器 注 册 。 < br / >
* 如 果 不 再 需 要 某 个 事 件 侦 听 器 , 可 调 用 EventDispatcher . removeEventListener ( )
* 删 除 它 ; 否 则 会 产 生 内 存 问 题 。 由 于 垃 圾 回 收 器 不 会 删 除 仍 包 含 引 用 的 对 象 , 因 此 不 会 从 内 存 中 自 动 删 除 使 用 已 注 册 事 件 侦 听 器 的 对 象 。 复 制
* EventDispatcher 实 例 时 并 不 复 制 其 中 附 加 的 事 件 侦 听 器 。 ( 如 果 新 近 创 建 的 节 点 需 要 一 个 事 件 侦 听 器 , 必 须 在 创 建 该 节 点 后 附 加 该 侦 听 器 。 )
* 但 是 , 如 果 移 动 EventDispatcher 实 例 , 则 其 中 附 加 的 事 件 侦 听 器 也 会 随 之 移 动 。 如 果 在 正 在 处 理 事 件 的 节 点 上 注 册 事 件 侦 听 器 , 则 不 会 在 当
* 前 阶 段 触 发 事 件 侦 听 器 , 但 会 在 事 件 流 的 稍 后 阶 段 触 发 , 如 冒 泡 阶 段 。 如 果 从 正 在 处 理 事 件 的 节 点 中 删 除 事 件 侦 听 器 , 则 该 事 件 侦 听 器 仍 由 当 前 操
* 作 触 发 。 删 除 事 件 侦 听 器 后 , 决 不 会 再 次 调 用 该 事 件 侦 听 器 ( 除 非 再 次 注 册 以 备 将 来 处 理 ) 。
* @param type 事 件 的 类 型 。
* @param listener 处 理 事 件 的 侦 听 器 函 数 。 此 函 数 必 须 接 受 Event 对 象 作 为 其 唯 一 的 参 数 , 并 且 不 能 返 回 任 何 结 果 ,
* 如 下 面 的 示 例 所 示 : function ( evt :Event ) : void 函 数 可 以 有 任 何 名 称 。
* @param thisObject 侦 听 函 数 绑 定 的 this对象
* @param useCapture 确 定 侦 听 器 是 运 行 于 捕 获 阶 段 还 是 运 行 于 冒 泡 阶 段 。 如 果 将 useCapture 设 置 为 true ,
* 则 侦 听 器 只 在 捕 获 阶 段 处 理 事 件 , 而 不 在 冒 泡 阶 段 处 理 事 件 。 如 果 useCapture 为 false , 则 侦 听 器 只 在 冒 泡 阶 段 处 理 事 件 。
* 要 在 两 个 阶 段 都 侦 听 事 件 , 请 调 用 on ( ) 两 次 : 一 次 将 useCapture 设 置 为 true , 一 次 将 useCapture 设 置 为 false 。
* @param priority 事 件 侦 听 器 的 优 先 级 。 优 先 级 由 一 个 带 符 号 的 整 数 指 定 。 数 字 越 大 , 优 先 级 越 高 。 优 先 级 为 n 的 所 有 侦 听 器 会 在
* 优 先 级 为 n - 1 的 侦 听 器 之 前 得 到 处 理 。 如 果 两 个 或 更 多 个 侦 听 器 共 享 相 同 的 优 先 级 , 则 按 照 它 们 的 添 加 顺 序 进 行 处 理 。 默 认 优 先 级 为 0 。
* @see # once ( )
* @see # removeEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : void ;
/ * *
* Registers an event listener object with an EventDispatcher object so that the listener receives notification of an
* event . Different from the on ( ) method , the listener receives notification only once , and then it will be removed
* automatically .
* @param type The type of event .
* @param listener The listener function that processes the event . This function must accept an event object as
* its only parameter and must return nothing , as this example shows : function ( evt :Event ) : void The function can
* have any name .
* @param thisObject the listener function ' s "this"
* @param useCapture Determines whether the listener works in the capture phase or the bubbling phases . If useCapture
* is set to true , the listener processes the event only during the capture phase and not in the bubbling phase .
* If useCapture is false , the listener processes the event only during the bubbling phase . To listen for the event
* in all three phases , call on ( ) twice , once with useCapture set to true , then again with useCapture set to false .
* @param priority The priority level of the event listener . Priorities are designated by a integer . The higher
* the number , the higher the priority . All listeners with priority n are processed before listeners of priority n - 1 .
* If two or more listeners share the same priority , they are processed in the order in which they were added .
* The default priority is
* @see # on ( )
* @see # removeEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 添 加 仅 回 调 一 次 的 事 件 侦 听 器 , 此 方 法 与 on ( ) 方 法 不 同 , on ( ) 方 法 会 持 续 产 生 回 调 , 而 此 方 法 在 第 一 次 回 调 时 就 会 自 动 移 除 监 听 。
* @param type 事 件 的 类 型 。
* @param listener 处 理 事 件 的 侦 听 器 函 数 。 此 函 数 必 须 接 受 Event 对 象 作 为 其 唯 一 的 参 数 , 并 且 不 能 返 回 任 何 结 果 ,
* 如 下 面 的 示 例 所 示 : function ( evt :Event ) : void 函 数 可 以 有 任 何 名 称 。
* @param thisObject 侦 听 函 数 绑 定 的 this对象
* @param useCapture 确 定 侦 听 器 是 运 行 于 捕 获 阶 段 还 是 运 行 于 冒 泡 阶 段 。 如 果 将 useCapture 设 置 为 true ,
* 则 侦 听 器 只 在 捕 获 阶 段 处 理 事 件 , 而 不 在 冒 泡 阶 段 处 理 事 件 。 如 果 useCapture 为 false , 则 侦 听 器 只 在 冒 泡 阶 段 处 理 事 件 。
* 要 在 两 个 阶 段 都 侦 听 事 件 , 请 调 用 once ( ) 两 次 : 一 次 将 useCapture 设 置 为 true , 一 次 将 useCapture 设 置 为 false 。
* @param priority 事 件 侦 听 器 的 优 先 级 。 优 先 级 由 一 个 带 符 号 整 数 指 定 。 数 字 越 大 , 优 先 级 越 高 。 优 先 级 为 n 的 所 有 侦 听 器 会 在
* 优 先 级 为 n - 1 的 侦 听 器 之 前 得 到 处 理 。 如 果 两 个 或 更 多 个 侦 听 器 共 享 相 同 的 优 先 级 , 则 按 照 它 们 的 添 加 顺 序 进 行 处 理 。 默 认 优 先 级 为 0 。
* @see # on ( )
* @see # removeEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
once ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : void ;
/ * *
* Removes a listener from the EventDispatcher object . If there is no matching listener registered with the
* EventDispatcher object , a call to this method has no effect .
* @param type The type of event .
* @param listener The listener object to remove .
* @param thisObject the listener function ' s "this"
* @param useCapture Specifies whether the listener was registered for the capture phase or the bubbling phases .
* If the listener was registered for both the capture phase and the bubbling phases , two calls to removeEventListener ( )
* are required to remove both : one call with useCapture set to true , and another call with useCapture set to false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 EventDispatcher 对 象 中 删 除 侦 听 器 。 如 果 没 有 向 EventDispatcher 对 象 注 册 任 何 匹 配 的 侦 听 器 , 则 对 此 方 法 的 调 用 没 有 任 何 效 果 。
* @param type 事 件 的 类 型 。
* @param listener 要 删 除 的 侦 听 器 对 象
* @param thisObject 侦 听 函 数 绑 定 的 this对象
* @param useCapture 指 出 是 为 捕 获 阶 段 还 是 为 冒 泡 阶 段 注 册 了 侦 听 器 。 如 果 为 捕 获 阶 段 以 及 冒 泡 阶 段 注 册 了 侦 听 器 , 则 需 要 对
* removeEventListener ( ) 进 行 两 次 调 用 才 能 将 这 两 个 侦 听 器 删 除 : 一 次 调 用 将 useCapture 设 置 为 true , 另 一 次 调 用 将 useCapture 设 置 为 false 。 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
removeEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean ) : void ;
/ * *
* Checks whether the EventDispatcher object has any listeners registered for a specific type of event . This allows
* you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy .
* To determine whether a specific event type will actually trigger an event listener , use IEventDispatcher . willTrigger ( ) .
* The difference between hasEventListener ( ) and willTrigger ( ) is that hasEventListener ( ) examines only the object to
* which it belongs , whereas willTrigger ( ) examines the entire event flow for the event specified by the type parameter .
* @param type The type of event .
* @returns A value of true if a listener of the specified type is registered ; false otherwise .
* @see # willTrigger ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 检 查 EventDispatcher 对 象 是 否 为 特 定 事 件 类 型 注 册 了 任 何 侦 听 器 。 这 样 , 您 就 可 以 确 定 EventDispatcher 对 象 在 事 件 流 层 次 结 构 中 的 哪 个
* 位 置 改 变 了 对 事 件 类 型 的 处 理 。 要 确 定 特 定 事 件 类 型 是 否 确 实 会 触 发 事 件 侦 听 器 , 请 使 用 IEventDispatcher . willTrigger ( ) 。 hasEventListener ( )
* 与 willTrigger ( ) 的 区 别 是 : hasEventListener ( ) 只 检 查 它 所 属 的 对 象 , 而 willTrigger ( ) 检 查 整 个 事 件 流 以 查 找 由 type 参 数 指 定 的 事 件 。
* @param type 事 件 的 类 型 。
* @returns 如 果 指 定 类 型 的 侦 听 器 已 注 册 , 则 值 为 true ; 否 则 , 值 为 false 。
* @see # willTrigger ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
hasEventListener ( type : string ) : boolean ;
/ * *
* Dispatches an event into the event flow . The event target is the EventDispatcher object upon which dispatchEvent ( ) is called .
* @param event The event object dispatched into the event flow .
* @returns A value of true unless preventDefault ( ) is called on the event , in which case it returns false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 事 件 分 派 到 事 件 流 中 。 事 件 目 标 是 对 其 调 用 dispatchEvent ( ) 方 法 的 EventDispatcher 对 象 。
* @param event 调 度 到 事 件 流 中 的 Event 对 象 。
* @returns 如 果 成 功 调 度 了 事 件 , 则 值 为 true 。 值 false 表 示 失 败 或 对 事 件 调 用 了 preventDefault ( ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
dispatchEvent ( event : Event ) : boolean ;
/ * *
* Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the
* specified event type . This method returns true if an event listener is triggered during any phase of the event
* flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants .
* @param type The type of event .
* @returns A value of true if a listener of the specified type will be triggered ; false otherwise .
* @see # hasEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 检 查 是 否 用 此 EventDispatcher 对 象 或 其 任 何 始 祖 为 指 定 事 件 类 型 注 册 了 事 件 侦 听 器 。 将 指 定 类 型 的 事 件 调 度 给 此
* EventDispatcher 对 象 或 其 任 一 后 代 时 , 如 果 在 事 件 流 的 任 何 阶 段 触 发 了 事 件 侦 听 器 , 则 此 方 法 返 回 true 。
* hasEventListener ( ) 与 willTrigger ( ) 方 法 的 区 别 是 : hasEventListener ( ) 只 检 查 它 所 属 的 对 象 ,
* 而 willTrigger ( ) 方 法 检 查 整 个 事 件 流 以 查 找 由 type 参 数 指 定 的 事 件 。
* @param type 事 件 类 型
* @returns 是 否 注 册 过 监 听 器 , 如 果 注 册 过 返 回 true , 反 之 返 回 false
* @see # hasEventListener ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
willTrigger ( type : string ) : boolean ;
}
}
declare namespace egret {
interface HttpRequest {
addEventListener < Z > ( type : "ioError" , listener : ( this : Z , e : IOErrorEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* @classdesc IO流事件 , 当 错 误 导 致 输 入 或 输 出 操 作 失 败 时 调 度 IOErrorEvent 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / IOErrorEvent . ts
* @language en_US
* /
/ * *
* @classdesc IO流事件 , 当 错 误 导 致 输 入 或 输 出 操 作 失 败 时 调 度 IOErrorEvent 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / IOErrorEvent . ts
* @language zh_CN
* /
class IOErrorEvent extends Event {
/ * *
* io error
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* io发生错误
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static IO_ERROR : "ioError" ;
/ * *
* Create a egret . IOErrorEvent objects
* @param type { string } Type of event , accessible as Event . type .
* @param bubbles { boolean } Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable { boolean } Determine whether the Event object can be canceled . The default value is false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . IOErrorEvent 对 象
* @param type { string } 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles { boolean } 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable { boolean } 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean ) ;
/ * *
* EventDispatcher object using the specified event object thrown Event . The objects will be thrown in the object cache pool for the next round robin .
* @param target { egret . IEventDispatcher } Distribute event target
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出Event事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target { egret . IEventDispatcher } 派 发 事 件 目 标
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchIOErrorEvent ( target : IEventDispatcher ) : boolean ;
}
}
declare namespace egret {
/ * *
* MotionEvent represents the device ' s movement
* Acceleration and accelerationIncludingGravity to represents the device ' s acceleration
* RotationRate to represents the device ' s rotation
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / Motion . ts
* @language en_US
* /
/ * *
* MotionEvent 类 呈 现 设 备 运 动 的 具 体 信 息
* Acceleration 和 accelerationIncludingGravity 呈 现 设 备 三 个 维 度 的 加 速 度 信 息
* RotationRate 呈 现 设 备 的 旋 转 状 态 信 息
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / Motion . ts
* @language zh_CN
* /
class MotionEvent extends Event {
/ * *
* An object giving the acceleration of the device on the three axis X , Y and Z . Acceleration is expressed in m / s2 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* acceleration 表 示 设 备 在 X Y Z 轴 方 将 的 加 速 度 信 息 , 单 位 是 m / s2 , 不 包 含 重 力
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
acceleration : DeviceAcceleration ;
/ * *
* An object giving the acceleration of the device on the three axis X , Y and Z with the effect of gravity . Acceleration is expressed in m / s2 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* acceleration 表 示 设 备 在 X Y Z 轴 方 将 的 加 速 度 信 息 , 单 位 是 m / s2 , 包 含 重 力
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
accelerationIncludingGravity : DeviceAcceleration ;
/ * *
* An object giving the rate of change of the device ' s orientation on the three orientation axis alpha , beta and gamma . Rotation rate is express in degrees per seconds .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* rotationRate 表 示 设 备 在 alpha 、 beta 和 gamma 三 个 轴 向 的 角 速 度 信 息 , 单 位 是 角 度 每 秒
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
rotationRate : DeviceRotationRate ;
}
}
declare namespace egret {
/ * *
* The OrientationEvent provides information from the physical orientation of the device .
* Note : Currently , Browsers on the iOS and Android does not handle the coordinates the same way .
* Take care about this while using them .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / DeviceOrientation . ts
* @language en_US
* /
/ * *
* OrientationEvent 提 供 设 备 的 方 向 信 息
* 注意 : 目前各个浏览器和操作系统处理方向的方式不完全相同 , 请 根 据 使 用 场 景 做 相 应 的 校 正 ,
* 比 如 使 用 两 次 方 向 数 据 的 变 化 而 不 是 直 接 使 用 方 向 的 值
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / sensor / DeviceOrientation . ts
* @language zh_CN
* /
class OrientationEvent extends Event {
/ * *
* A number representing the motion of the device around the z axis ,
* express in degrees with values ranging from 0 to 360
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 设 备 绕 Z 轴 的 角 度 , 单 位 是 角 度 范 围 是 0 到 360
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
alpha : number ;
/ * *
* A number representing the motion of the device around the x axis ,
* express in degrees with values ranging from - 180 to 180 .
* This represents a front to back motion of the device .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 设 备 绕 X 轴 的 角 度 , 单 位 是 角 度 范 围 是 - 180 到 180 .
* 这 个 值 表 示 设 备 从 前 向 后 的 旋 转 状 态
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
beta : number ;
/ * *
* A number representing the motion of the device around the y axis ,
* express in degrees with values ranging from - 90 to 90 .
* This represents a left to right motion of the device .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 设 备 绕 Y 轴 的 角 度 , 单 位 是 角 度 范 围 是 - 90 到 90 .
* 这 个 值 表 示 设 备 从 前 向 后 的 旋 转 状 态
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
gamma : number ;
}
}
declare namespace egret {
interface HttpRequest {
addEventListener < Z > ( type : "progress" , listener : ( this : Z , e : ProgressEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* When a load operation has begun or a socket has received data , ProgressEvent object is dispatched .
* There are two types of progress events : ProgressEvent.PROGRESS and ProgressEvent . SOCKET_DATA .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 加 载 操 作 已 开 始 或 套 接 字 已 接 收 到 数 据 时 , 将 调 度 ProgressEvent 对 象 。
* 有 两 种 类 型 的 进 程 事 件 : ProgressEvent . PROGRESS 和 ProgressEvent . SOCKET_DATA 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class ProgressEvent extends egret . Event {
/ * *
* Changes in the loading progress
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 加 载 进 度 发 生 变 化
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static PROGRESS : "progress" ;
/ * *
* Get the data
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 到 数 据
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static SOCKET_DATA : "socketData" ;
/ * *
* Number of items or bytes when the listener processes the event 。
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 侦 听 器 处 理 事 件 时 加 载 的 项 数 或 字 节 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bytesLoaded : number ;
/ * *
* If the loading process succeeds , the total number or the total number of bytes that will be loaded term .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 加 载 过 程 成 功 , 将 加 载 的 总 项 数 或 总 字 节 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bytesTotal : number ;
/ * *
* 创 建 一 个 egret . ProgressEvent 对 象
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @param bytesLoaded { number } Number of items or bytes loaded
* @param bytesTotal { number } The total number of items or bytes loaded
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . ProgressEvent 对 象
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @param bytesLoaded { number } 加 载 的 项 数 或 字 节 数
* @param bytesTotal { number } 加 载 的 总 项 数 或 总 字 节 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean , bytesLoaded? : number , bytesTotal? : number ) ;
/ * *
* EventDispatcher object using the specified event object thrown Event . The objects will be thrown in the object cache pool for the next round robin .
* @param target { egret . IEventDispatcher } Distribute event target
* @param type The type of the event , accessible as Event . type .
* @param bytesLoaded { number } Number of items or bytes loaded
* @param bytesTotal { number } The total number of items or bytes loaded
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出Event事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target { egret . IEventDispatcher } 派 发 事 件 目 标
* @param type { string } 事 件 类 型
* @param bytesLoaded { number } 加 载 的 项 数 或 字 节 数
* @param bytesTotal { number } 加 载 的 总 项 数 或 总 字 节 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchProgressEvent ( target : IEventDispatcher , type : string , bytesLoaded? : number , bytesTotal? : number ) : boolean ;
}
}
declare namespace egret {
interface Stage {
addEventListener < Z > ( type : "orientationChange" , listener : ( this : Z , e : StageOrientationEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* When the direction of the stage of change , Stage object dispatches StageOrientationEvent object .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / StageOrientationEvent . ts
* @language en_US
* /
/ * *
* 当 舞 台 的 方 向 更 改 时 , Stage 对 象 将 调 度 StageOrientationEvent 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / StageOrientationEvent . ts
* @language zh_CN
* /
class StageOrientationEvent extends Event {
/ * *
* After screen rotation distribute events .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 屏 幕 旋 转 后 派 发 的 事 件 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ORIENTATION_CHANGE : "orientationChange" ;
/ * *
* Creating contains specific information related to the event and the stage direction of StageOrientationEvent object .
* @param type Event types :StageOrientationEvent.ORIENTATION_CHANGE
* @param bubbles It indicates whether the Event object participates in the bubbling stage of the event flow .
* @param cancelable It indicates whether the Event object can be canceled .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 包 含 与 舞 台 方 向 事 件 相 关 的 特 定 信 息 的 StageOrientationEvent 对 象 。
* @param type 事 件 的 类 型 : StageOrientationEvent . ORIENTATION_CHANGE
* @param bubbles 表 示 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。
* @param cancelable 表 示 是 否 可 以 取 消 Event 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean ) ;
/ * *
* 派 发 一 个 屏 幕 旋 转 的 事 件 。
* @param target { egret . IEventDispatcher } 派 发 事 件 目 标
* @param type { egret . IEventDispatcher } 派 发 事 件 类 型
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 派 发 一 个 屏 幕 旋 转 的 事 件 。
* @param target { egret . IEventDispatcher } Distribute event target
* @param type { egret . IEventDispatcher } Distribute event type
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchStageOrientationEvent ( target : IEventDispatcher , type : string ) : boolean ;
}
}
declare namespace egret {
/ * *
* When a user clicks a hyperlink rich text object dispatches TextEvent object . Text Event Type : TextEvent.LINK.
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TextEvent . ts
* @language en_US
* /
/ * *
* 用 户 在 富 文 本 中 单 击 超 链 接 时 , 对 象 将 调 度 TextEvent 对 象 。 文 本 事 件 类 型 : TextEvent . LINK 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TextEvent . ts
* @language zh_CN
* /
class TextEvent extends Event {
/ * *
* TextEvent create an object that contains information about text events .
* @param type Type of event , you can access the TextEvent . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determine whether the Event object can be canceled . The default value is false .
* @param text One or more characters of text entered by the user . Event listeners can access this information through the text property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 TextEvent 对 象 , 其 中 包 含 有 关 文 本 事 件 的 信 息 。
* @param type 事 件 的 类 型 , 可 以 作 为 TextEvent . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @param text 用 户 输 入 的 一 个 或 多 个 文 本 字 符 。 事 件 侦 听 器 可 以 通 过 text 属 性 访 问 此 信 息 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean , text? : string ) ;
/ * *
* It defines the value of the type property of a link event object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 定 义 link 事 件 对 象 的 type 属 性 值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static LINK : "link" ;
/ * *
* In TextEvent . LINK event , event corresponding string .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 TextEvent . LINK 事 件 中 , event对应的字符串 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
text : string ;
/ * *
* EventDispatcher object using the specified event object thrown TextEvent . The objects will be thrown in the object cache pool for the next round robin .
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param text Text TextEvent object assignment
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出TextEvent事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target 派 发 事 件 目 标
* @param type 事 件 类 型
* @param text TextEvent对象的text赋值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchTextEvent ( target : IEventDispatcher , type : string , text : string ) : boolean ;
}
}
declare namespace egret {
interface Timer {
addEventListener < Z > ( type : "timer" | "timerComplete" , listener : ( this : Z , e : TimerEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer . delay property .
* @see egret . Timer
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TimerEvent . ts
* @language en_US
* /
/ * *
* 每 当 Timer 对 象 达 到 由 Timer . delay 属 性 指 定 的 间 隔 时 , Timer 对 象 即 会 调 度 TimerEvent 对 象 。
* @see egret . Timer
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TimerEvent . ts
* @language zh_CN
* /
class TimerEvent extends Event {
/ * *
* Dispatched whenever a Timer object reaches an interval specified according to the Timer . delay property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 每 当 Timer 对 象 达 到 根 据 Timer . delay 属 性 指 定 的 间 隔 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TIMER : "timer" ;
/ * *
* Dispatched whenever it has completed the number of requests set by Timer . repeatCount .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 每 当 它 完 成 Timer . repeatCount 设 置 的 请 求 数 后 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TIMER_COMPLETE : "timerComplete" ;
/ * *
* Creates an Event object with specific information relevant to timer events .
* @param type The type of the event . Event listeners can access this information through the inherited type property .
* @param bubbles Determines whether the Event object bubbles . Event listeners can access this information through
* the inherited bubbles property .
* @param cancelable Determines whether the Event object can be canceled . Event listeners can access this information
* through the inherited cancelable property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 Event 对 象 , 其 中 包 含 有 关 timer 事 件 的 特 定 信 息 。
* @param type 事 件 的 类 型 。 事 件 侦 听 器 可 以 通 过 继 承 的 type 属 性 访 问 此 信 息 。
* @param bubbles 确 定 Event 对 象 是 否 冒 泡 。 事 件 侦 听 器 可 以 通 过 继 承 的 bubbles 属 性 访 问 此 信 息 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 事 件 侦 听 器 可 以 通 过 继 承 的 cancelable 属 性 访 问 此 信 息 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean ) ;
/ * *
* Instructs Egret runtime to render after processing of this event completes , if the display list has been modified .
* @example
* < pre >
* function onTimer ( event :TimerEvent ) : void {
* if ( 40 < mySp . x && mySp . x < 375 ) {
* mySp . x -= 50 ;
* } else {
* mySp . x = 374 ;
* }
* event . updateAfterEvent ( ) ;
* }
*
* let moveTimer :Timer = new Timer ( 50 , 250 ) ;
* moveTimer . addEventListener ( TimerEvent . TIMER , onTimer ) ;
* moveTimer . start ( ) ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 已 修 改 显 示 列 表 , 调 用 此 方 法 将 会 忽 略 帧 频 限 制 , 在 此 事 件 处 理 完 成 后 立 即 重 绘 屏 幕 。
* @example
* < pre >
* function onTimer ( event :TimerEvent ) : void {
* if ( 40 < mySp . x && mySp . x < 375 ) {
* mySp . x -= 50 ;
* } else {
* mySp . x = 374 ;
* }
* event . updateAfterEvent ( ) ;
* }
*
* let moveTimer :Timer = new Timer ( 50 , 250 ) ;
* moveTimer . addEventListener ( TimerEvent . TIMER , onTimer ) ;
* moveTimer . start ( ) ;
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
updateAfterEvent ( ) : void ;
/ * *
* uses a specified target to dispatchEvent an event . Using this method can reduce the number of
* reallocate event objects , which allows you to get better code execution performance .
* @param target the event target
* @param type The type of the event . Event listeners can access this information through the inherited type property .
* @param bubbles Determines whether the Event object bubbles . Event listeners can access this information through
* the inherited bubbles property .
* @param cancelable Determines whether the Event object can be canceled . Event listeners can access this information
* through the inherited cancelable property .
* @see egret . Event . create ( )
* @see egret . Event . release ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target 事 件 派 发 目 标
* @param type 事 件 的 类 型 。 事 件 侦 听 器 可 以 通 过 继 承 的 type 属 性 访 问 此 信 息 。
* @param bubbles 确 定 Event 对 象 是 否 冒 泡 。 事 件 侦 听 器 可 以 通 过 继 承 的 bubbles 属 性 访 问 此 信 息 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 事 件 侦 听 器 可 以 通 过 继 承 的 cancelable 属 性 访 问 此 信 息 。
* @see egret . Event . create ( )
* @see egret . Event . release ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchTimerEvent ( target : IEventDispatcher , type : string , bubbles? : boolean , cancelable? : boolean ) : boolean ;
}
}
declare namespace egret {
class CompressedTextureData {
glInternalFormat : number ;
width : number ;
height : number ;
byteArray : Uint8Array ;
face : number ;
level : number ;
}
const etc_alpha_mask = "etc_alpha_mask" ;
const engine_default_empty_texture = "engine_default_empty_texture" ;
const is_compressed_texture = "is_compressed_texture" ;
const glContext = "glContext" ;
const UNPACK_PREMULTIPLY_ALPHA_WEBGL = "UNPACK_PREMULTIPLY_ALPHA_WEBGL" ;
/ * *
* A BitmapData object contains an array of pixel data . This data can represent either a fully opaque bitmap or a
* transparent bitmap that contains alpha channel data . Either type of BitmapData object is stored as a buffer of 32 - bit
* integers . Each 32 - bit integer determines the properties of a single pixel in the bitmap . < br / >
* Each 32 - bit integer is a combination of four 8 - bit channel values ( from 0 to 255 ) that describe the alpha transparency
* and the red , green , and blue ( ARGB ) values of the pixel . ( For ARGB values , the most significant byte represents the
* alpha channel value , followed by red , green , and blue . )
* @see egret . Bitmap
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* BitmapData 对 象 是 一 个 包 含 像 素 数 据 的 数 组 。 此 数 据 可 以 表 示 完 全 不 透 明 的 位 图 , 或 表 示 包 含 Alpha 通 道 数 据 的 透 明 位 图 。
* 以 上 任 一 类 型 的 BitmapData 对 象 都 作 为 32 位 整 数 的 缓 冲 区 进 行 存 储 。 每 个 32 位 整 数 确 定 位 图 中 单 个 像 素 的 属 性 。 < br / >
* 每 个 32 位 整 数 都 是 四 个 8 位 通 道 值 ( 从 0 到 255 ) 的 组 合 , 这 些 值 描 述 像 素 的 Alpha 透 明 度 以 及 红 色 、 绿 色 、 蓝 色 ( ARGB ) 值 。
* ( 对 于 ARGB 值 , 最 高 有 效 字 节 代 表 Alpha 通 道 值 , 其 后 的 有 效 字 节 分 别 代 表 红 色 、 绿 色 和 蓝 色 通 道 值 。 )
* @see egret . Bitmap
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class BitmapData extends HashObject {
/ * *
* The width of the bitmap image in pixels .
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 位 图 图 像 的 宽 度 , 以 像 素 为 单 位 。
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
width : number ;
/ * *
* The height of the bitmap image in pixels .
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 位 图 图 像 的 高 度 , 以 像 素 为 单 位 。
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
height : number ;
/ * *
* Original bitmap image .
* HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
* @version Egret 2.4
* @platform Web , Native
* @private
* @language en_US
* /
/ * *
* 原 始 位 图 图 像 。
* HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
* @version Egret 2.4
* @platform Web , Native
* @private
* @language zh_CN
* /
$source : any ;
/ * *
* WebGL texture .
* @version Egret 2.4
* @platform Web , Native
* @private
* @language en_US
* /
/ * *
* WebGL纹理 。
* @version Egret 2.4
* @platform Web , Native
* @private
* @language zh_CN
* /
webGLTexture : any ;
/ * *
* Texture format .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 纹 理 格 式 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
format : string ;
/ * *
* @private
* webgl纹理生成后 , 是 否 删 掉 原 始 图 像 数 据
* /
$deleteSource : boolean ;
/ * *
* @private
* id
* /
$nativeBitmapData : egret_native.NativeBitmapData ;
/ * *
* @private
*
* /
readonly compressedTextureData : Array < Array < CompressedTextureData > > ;
debugCompressedTextureURL : string ;
etcAlphaMask : Nullable < BitmapData > ;
/ * *
* Initializes a BitmapData object to refer to the specified source object .
* @param source The source object being referenced .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 引 用 指 定 source 实 例 的 BitmapData 对 象
* @param source 被 引 用 的 source 实 例
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( source : any ) ;
source : any ;
static create ( type : "arraybuffer" , data : ArrayBuffer , callback ? : ( bitmapData : BitmapData ) = > void ) : BitmapData ;
static create ( type : "base64" , data : string , callback ? : ( bitmapData : BitmapData ) = > void ) : BitmapData ;
$dispose ( ) : void ;
private static _displayList ;
static $addDisplayObject ( displayObject : DisplayObject , bitmapData : BitmapData ) : void ;
static $removeDisplayObject ( displayObject : DisplayObject , bitmapData : BitmapData ) : void ;
static $invalidate ( bitmapData : BitmapData ) : void ;
static $dispose ( bitmapData : BitmapData ) : void ;
private _getCompressedTextureData ( level , face ) ;
getCompressed2dTextureData ( ) : CompressedTextureData ;
hasCompressed2d ( ) : boolean ;
clearCompressedTextureData ( ) : void ;
}
}
declare namespace egret {
interface DisplayObject {
addEventListener < Z > ( type : "touchMove" | "touchBegin" | "touchEnd" | "touchCancel" | "touchTap" | "touchReleaseOutside" | "touchRollOut" | "touchRollOver" , listener : ( this : Z , e : TouchEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
/ * *
* The TouchEvent class lets you handle events on devices that detect user contact with the device ( such as a finger
* on a touch screen ) . When a user interacts with a device such as a mobile phone or tablet with a touch screen , the
* user typically touches the screen with his or her fingers or a pointing device . You can develop applications that
* respond to basic touch events ( such as a single finger tap ) with the TouchEvent class . Create event listeners using
* the event types defined in this class .
* Note : When objects are nested on the display list , touch events target the deepest possible nested object that is
* visible in the display list . This object is called the target node . To have a target node ' s ancestor ( an object
* containing the target node in the display list ) receive notification of a touch event , use EventDispatcher . addEventListener ( )
* on the ancestor node with the type parameter set to the specific touch event you want to detect .
*
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TouchEvent . ts
* @language en_US
* /
/ * *
* 使 用 TouchEvent 类 , 您 可 以 处 理 设 备 上 那 些 检 测 用 户 与 设 备 之 间 的 接 触 的 事 件 。
* 当 用 户 与 带 有 触 摸 屏 的 移 动 电 话 或 平 板 电 脑 等 设 备 交 互 时 , 用 户 通 常 使 用 手 指 或 指 针 设 备 接 触 屏 幕 。 可 使 用 TouchEvent
* 类 开 发 响 应 基 本 触 摸 事 件 ( 如 单 个 手 指 点 击 ) 的 应 用 程 序 。 使 用 此 类 中 定 义 的 事 件 类 型 创 建 事 件 侦 听 器 。
* 注 意 : 当 对 象 嵌 套 在 显 示 列 表 中 时 , 触 摸 事 件 的 目 标 将 是 显 示 列 表 中 可 见 的 最 深 的 可 能 嵌 套 对 象 。
* 此 对 象 称 为 目 标 节 点 。 要 使 目 标 节 点 的 祖 代 ( 祖 代 是 一 个 包 含 显 示 列 表 中 所 有 目 标 节 点 的 对 象 , 从 舞 台 到 目 标 节 点 的 父 节 点 均 包 括 在 内 )
* 接 收 触 摸 事 件 的 通 知 , 请 对 祖 代 节 点 使 用 EventDispatcher . on ( ) 并 将 type 参 数 设 置 为 要 检 测 的 特 定 触 摸 事 件 。
*
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / events / TouchEvent . ts
* @language zh_CN
* /
class TouchEvent extends Event {
/ * *
* Dispatched when the user touches the device , and is continuously dispatched until the point of contact is removed .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 用 户 触 碰 设 备 时 进 行 调 度 , 而 且 会 连 续 调 度 , 直 到 接 触 点 被 删 除 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_MOVE : "touchMove" ;
/ * *
* Dispatched when the user first contacts a touch - enabled device ( such as touches a finger to a mobile phone or tablet with a touch screen ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 用 户 第 一 次 触 摸 启 用 触 摸 的 设 备 时 ( 例 如 , 用 手 指 触 摸 配 有 触 摸 屏 的 移 动 电 话 或 平 板 电 脑 ) 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_BEGIN : "touchBegin" ;
/ * *
* Dispatched when the user removes contact with a touch - enabled device ( such as lifts a finger off a mobile phone
* or tablet with a touch screen ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 用 户 移 除 与 启 用 触 摸 的 设 备 的 接 触 时 ( 例 如 , 将 手 指 从 配 有 触 摸 屏 的 移 动 电 话 或 平 板 电 脑 上 抬 起 ) 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_END : "touchEnd" ;
/ * *
* Dispatched when an event of some kind occurred that canceled the touch .
* Such as the eui . Scroller will dispatch 'TOUCH_CANCEL' when it start move , the 'TOUCH_END' and 'TOUCH_TAP' will not be triggered .
* @version Egret 3.0 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 由 于 某 个 事 件 取 消 了 触 摸 时 触 发 。 比 如 eui . Scroller 在 开 始 滚 动 后 会 触 发 'TOUCH_CANCEL' 事 件 , 不 再 触 发 后 续 的 'TOUCH_END' 和 'TOUCH_TAP' 事 件
* @version Egret 3.0 . 1
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_CANCEL : "touchCancel" ;
/ * *
* Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact
* was initiated on a touch - enabled device .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 用 户 在 触 摸 设 备 上 与 开 始 触 摸 的 同 一 DisplayObject 实 例 上 抬 起 接 触 点 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_TAP : "touchTap" ;
/ * *
* Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact
* was initiated on a touch - enabled device ( such as presses and releases a finger from a single point over a display
* object on a mobile phone or tablet with a touch screen ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 用 户 在 触 摸 设 备 上 与 开 始 触 摸 的 不 同 DisplayObject 实 例 上 抬 起 接 触 点 时 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOUCH_RELEASE_OUTSIDE : "touchReleaseOutside" ;
/ * *
* Creates an Event object that contains information about touch events .
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates .
* @param stageY The vertical coordinate at which the event occurred in global Stage coordinates .
* @param touchPointID A unique identification number assigned to the touch point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 TouchEvent 对 象 , 其 中 包 含 有 关 Touch事件的信息
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @param stageX 事 件 发 生 点 在 全 局 舞 台 坐 标 系 中 的 水 平 坐 标
* @param stageY 事 件 发 生 点 在 全 局 舞 台 坐 标 系 中 的 垂 直 坐 标
* @param touchPointID 分 配 给 触 摸 点 的 唯 一 标 识 号
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( type : string , bubbles? : boolean , cancelable? : boolean , stageX? : number , stageY? : number , touchPointID? : number ) ;
/ * *
* @private
* /
$initTo ( stageX : number , stageY : number , touchPointID : number ) : void ;
/ * *
* @private
* /
$stageX : number ;
/ * *
* The horizontal coordinate at which the event occurred in global Stage coordinates .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 发 生 点 在 全 局 舞 台 坐 标 中 的 水 平 坐 标 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly stageX : number ;
/ * *
* @private
* /
$stageY : number ;
/ * *
* The vertical coordinate at which the event occurred in global Stage coordinates .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 发 生 点 在 全 局 舞 台 坐 标 中 的 垂 直 坐 标 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly stageY : number ;
private _localX ;
/ * *
* The horizontal coordinate at which the event occurred relative to the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 发 生 点 相 对 于 所 属 显 示 对 象 的 水 平 坐 标 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly localX : number ;
private _localY ;
/ * *
* The vertical coordinate at which the event occurred relative to the display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 事 件 发 生 点 相 对 于 所 属 显 示 对 象 的 垂 直 坐 标 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly localY : number ;
private targetChanged ;
/ * *
* @private
* /
private getLocalXY ( ) ;
$setTarget ( target : any ) : boolean ;
/ * *
* A unique identification number assigned to the touch point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 分 配 给 触 摸 点 的 唯 一 标 识 号
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
touchPointID : number ;
/ * *
* Instructs Egret runtime to render after processing of this event completes , if the display list has been modified .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 已 修 改 显 示 列 表 , 调 用 此 方 法 将 会 忽 略 帧 频 限 制 , 在 此 事 件 处 理 完 成 后 立 即 重 绘 屏 幕 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
updateAfterEvent ( ) : void ;
/ * *
* Whether the touch is pressed ( true ) or not pressed ( false ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 触 摸 已 按 下 ( true ) 还 是 未 按 下 ( false ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
touchDown : boolean ;
/ * *
* uses a specified target to dispatchEvent an event . Using this method can reduce the number of
* reallocate event objects , which allows you to get better code execution performance .
* @param target the event target
* @param type The type of the event , accessible as Event . type .
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow . The default value is false .
* @param cancelable Determines whether the Event object can be canceled . The default values is false .
* @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates .
* @param stageY The vertical coordinate at which the event occurred in global Stage coordinates .
* @param touchPointID A unique identification number ( as an int ) assigned to the touch point .
*
* @see egret . Event . create ( )
* @see egret . Event . release ( )
*
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 EventDispatcher对象来抛出Event事件对象 。 抛 出 的 对 象 将 会 缓 存 在 对 象 池 上 , 供 下 次 循 环 复 用 。
* @param target 派 发 事 件 目 标
* @param type 事 件 的 类 型 , 可 以 作 为 Event . type 访 问 。
* @param bubbles 确 定 Event 对 象 是 否 参 与 事 件 流 的 冒 泡 阶 段 。 默 认 值 为 false 。
* @param cancelable 确 定 是 否 可 以 取 消 Event 对 象 。 默 认 值 为 false 。
* @param stageX 事 件 发 生 点 在 全 局 舞 台 坐 标 系 中 的 水 平 坐 标
* @param stageY 事 件 发 生 点 在 全 局 舞 台 坐 标 系 中 的 垂 直 坐 标
* @param touchPointID 分 配 给 触 摸 点 的 唯 一 标 识 号
*
* @see egret . Event . create ( )
* @see egret . Event . release ( )
*
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static dispatchTouchEvent ( target : IEventDispatcher , type : string , bubbles? : boolean , cancelable? : boolean , stageX? : number , stageY? : number , touchPointID? : number , touchDown? : boolean ) : boolean ;
}
}
declare namespace egret {
/ * *
* h5 and native interaction .
* @see http : //edn.egret.com/cn/article/index/id/714 Egret basic skills to communicate with Native
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / external / ExternalInterface . ts
* @language en_US
* /
/ * *
* h5与native交互 。
* @see http : //edn.egret.com/cn/article/index/id/714 Egret 与 Native 通信基本技巧
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / external / ExternalInterface . ts
* @language zh_CN
* /
interface ExternalInterface {
}
let ExternalInterface : {
/ * *
* Call functionName , and the value passed to the native .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 调 用 functionName , 并 将 value传入到native中 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
call ( functionName : string , value : string ) : void ;
/ * *
* FunctionName callback listener , you need to have to call functionName this field in native rather than such a call .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 监 听 functionName 回 调 , 需 要 在 native中有调用 functionName 这 个 字 段 , 而 不 是 此 类 的 call 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
addCallback ( functionName : string , listener : ( value : string ) = > void ) : void ;
} ;
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
const enum BitmapFilterQuality {
/ * *
* 定 义 低 品 质 滤 镜 设 置
* @private
* @version Egret 2.4
* @platform Web , Native
* /
LOW = 1 ,
/ * *
* 定 义 中 等 品 质 滤 镜 设 置
* @private
* @version Egret 2.4
* @platform Web , Native
* /
MEDIUM = 2 ,
/ * *
* 定 义 高 品 质 滤 镜 设 置
* @private
* @version Egret 2.4
* @platform Web , Native
* /
HIGH = 3 ,
}
}
declare namespace egret {
/ * *
* The BlurFilter class lets you apply a blur visual effect to display objects . A blur effect softens the details of an image .
* You can produce blurs that range from a softly unfocused look to a Gaussian blur , a hazy appearance like viewing an image through semi - opaque glass .
* @version Egret 3.0 . 1
* @platform Web
* @see http : //edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜
* @language en_US
* /
/ * *
* 可 使 用 BlurFilter 类 将 模 糊 视 觉 效 果 应 用 于 显 示 对 象 。 模 糊 效 果 可 以 柔 化 图 像 的 细 节 。
* 您 可 以 生 成 一 些 模 糊 效 果 , 范 围 从 创 建 一 个 柔 化 的 、 未 聚 焦 的 外 观 到 高 斯 模 糊 ( 就 像 通 过 半 透 明 玻 璃 查 看 图 像 一 样 的 朦 胧 的 外 观 ) 。
* @version Egret 3.1 . 0
* @platform Web
* @see http : //edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜
* @language zh_CN
* /
class BlurFilter extends Filter {
/ * *
* Initializes a BlurFilter object .
* @param blurX { number } The amount of horizontal blur . Valid values are 0 to 255 ( floating point ) .
* @param blurY { number } The amount of vertical blur . Valid values are 0 to 255 ( floating point ) .
* @param quality { number } The number of times to apply the filter .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 创 建 一 个 BlurFilter 对 象 。
* @param blurX { number } 水 平 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param blurY { number } 垂 直 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param quality { number } 应 用 滤 镜 的 次 数 。 暂 未 实 现 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
constructor ( blurX? : number , blurY? : number , quality? : number ) ;
/ * *
* @private
* /
blurXFilter : IBlurXFilter ;
/ * *
* @private
* /
blurYFilter : IBlurYFilter ;
/ * *
* @private
* /
$quality : number ;
/ * *
* The amount of horizontal blur .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 水 平 模 糊 量 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
blurX : number ;
/ * *
* @private
* /
$blurX : number ;
/ * *
* The amount of vertical blur .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 垂 直 模 糊 量 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
blurY : number ;
/ * *
* @private
* /
$blurY : number ;
/ * *
* @private
* /
$toJson ( ) : string ;
protected updatePadding ( ) : void ;
onPropertyChange ( ) : void ;
}
/ * *
* @private
* /
interface IBlurXFilter extends Filter {
type : string ;
$uniforms : any ;
blurX : number ;
}
/ * *
* @private
* /
interface IBlurYFilter extends Filter {
type : string ;
$uniforms : any ;
blurY : number ;
}
}
declare namespace egret {
/ * *
* The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values .
* It allows saturation changes , hue rotation , luminance to alpha , and various other effects .
* @version Egret 3.1 . 0
* @platform Web
* @see http : //edn.egret.com/cn/docs/page/947 颜色矩阵滤镜
* @language en_US
* /
/ * *
* 使 用 ColorMatrixFilter 类 可 以 将 4 x 5 矩 阵 转 换 应 用 于 输 入 图 像 上 的 每 个 像 素 的 RGBA 颜 色 和 Alpha 值 , 以 生 成 具 有 一 组 新 的 RGBA 颜 色 和 Alpha 值 的 结 果 。
* 该 类 允 许 饱 和 度 更 改 、 色 相 旋 转 、 亮 度 为 Alpha 以 及 各 种 其 他 效 果 。
* @version Egret 3.1 . 0
* @platform Web
* @see http : //edn.egret.com/cn/docs/page/947 颜色矩阵滤镜
* @language zh_CN
* /
class ColorMatrixFilter extends Filter {
/ * *
* @private
* /
$matrix : number [ ] ;
/ * *
* @private
* /
private matrix2 ;
/ * *
* Initializes a ColorMatrixFilter object .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 创 建 一 个 ColorMatrixFilter 对 象 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
constructor ( matrix? : number [ ] ) ;
/ * *
* A comma delimited list of 20 doubles that comprise a 4 x5 matrix applied to the rendered element .
* The matrix is in row major order -- that is , the first five elements are multipled by the vector [ srcR , srcG , srcB , srcA , 1 ] to determine the output red value , the second five determine the output green value , etc .
* The value must either be an array or comma delimited string of 20 numbers .
* @version Egret 3.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 构 成 应 用 于 所 呈 示 的 元 素 的 一 个 4 x5 矩 阵 的 、 以 逗 号 分 隔 的 20 个 双 精 度 数 的 列 表 。
* 矩 阵 以 行 作 为 主 要 顺 序 , 即 用 第 一 行 五 个 元 素 乘 以 矢 量 [ srcR , srcG , srcB , srcA , 1 ] 以 确 定 输 出 的 红 色 值 , 用 第 二 行 的 五 个 元 素 确 定 输 出 的 绿 色 值 , 等 等 。
* 该 值 必 须 为 20 个 数 字 组 成 的 数 组 或 以 逗 号 分 隔 的 字 符 串 。
* @version Egret 3.1 . 0
* @platform Web
* @language zh_CN
* /
matrix : number [ ] ;
/ * *
* @private
* /
private setMatrix ( value ) ;
/ * *
* @private
* /
$toJson ( ) : string ;
}
}
declare namespace egret {
/ * *
* custom filter , now support WebGL mode only .
* @version Egret 4.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 自 定 义 滤 镜 , 目 前 仅 支 持 WebGL模式
* @version Egret 4.1 . 0
* @platform Web
* @language zh_CN
* /
class CustomFilter extends Filter {
/ * *
* @private
* /
$vertexSrc : string ;
/ * *
* @private
* /
$fragmentSrc : string ;
/ * *
* @private
* /
$shaderKey : string ;
/ * *
* @private
* /
type : string ;
private $padding ;
/ * *
* The inner margin of the filter .
* If the desired area of the custom filter is larger than the original area ( stroke , etc . ) , you need to set it manually .
* @version Egret 4.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 滤 镜 的 内 边 距
* 如 果 自 定 义 滤 镜 所 需 区 域 比 原 区 域 大 ( 描 边 等 ) , 需 要 手 动 设 置
* @version Egret 4.1 . 0
* @platform Web
* @language zh_CN
* /
padding : number ;
/ * *
* The initial value of the uniform in the shader ( key , value one - to - one correspondence ) , currently only supports numbers and arrays .
* @version Egret 4.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 着 色 器 中 uniform的初始值 ( key , value一一对应 ) , 目 前 仅 支 持 数 字 和 数 组 。
* @version Egret 4.1 . 0
* @platform Web
* @language zh_CN
* /
readonly uniforms : any ;
/ * *
* Initialize the CustomFilter object .
* @param vertexSrc Custom vertex shader program .
* @param fragmentSrc Custom fragment shader program .
* @param uniforms The initial value of the uniform in the shader ( key , value one - to - one correspondence ) , currently only supports numbers and arrays .
* @version Egret 4.1 . 0
* @platform Web
* @language en_US
* /
/ * *
* 初 始 化 CustomFilter 对 象
* @param vertexSrc 自 定 义 的 顶 点 着 色 器 程 序 。
* @param fragmentSrc 自 定 义 的 片 段 着 色 器 程 序 。
* @param uniforms 着 色 器 中 uniform的初始值 ( key , value一一对应 ) , 目 前 仅 支 持 数 字 和 数 组 。
* @version Egret 4.1 . 0
* @platform Web
* @language zh_CN
* /
constructor ( vertexSrc : string , fragmentSrc : string , uniforms? : any ) ;
onPropertyChange ( ) : void ;
}
}
declare namespace egret {
/ * *
* @class egret . DropShadowFilter
* @classdesc
* 可 使 用 DropShadowFilter 类 向 显 示 对 象 添 加 投 影 。
* @extends egret . GlowFilter
* @version Egret 3.1 . 4
* @platform Web , Native
* /
class DropShadowFilter extends GlowFilter {
/ * *
* Initializes a new DropShadowFilter instance .
* @method egret . DropShadowFilter # constructor
* @param distance { number } The offset distance of the bevel . Valid values are in pixels ( floating point ) .
* @param angle { number } The angle of the bevel . Valid values are from 0 to 360 ° .
* @param color { number } The color of the glow . Valid values are in the hexadecimal format 0 xRRGGBB . The default value is 0xFF0000 .
* @param alpha { number } The alpha transparency value for the color . Valid values are 0 to 1 . For example , . 25 sets a transparency value of 25 % . The default value is 1 .
* @param blurX { number } The amount of horizontal blur . Valid values are 0 to 255 ( floating point ) .
* @param blurY { number } The amount of vertical blur . Valid values are 0 to 255 ( floating point ) .
* @param strength { number } The strength of the imprint or spread . The higher the value , the more color is imprinted and the stronger the contrast between the glow and the background . Valid values are 0 to 255 .
* @param quality { number } The number of times to apply the filter .
* @param inner { boolean } Specifies whether the glow is an inner glow . The value true indicates an inner glow . The default is false , an outer glow ( a glow around the outer edges of the object ) .
* @param knockout { number } Specifies whether the object has a knockout effect . A value of true makes the object ' s fill transparent and reveals the background color of the document . The default value is false ( no knockout effect ) .
* @param hideObject { number } Indicates whether or not the object is hidden . The value true indicates that the object itself is not drawn ; only the shadow is visible . The default is false , meaning that the object is shown .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 初 始 化 DropShadowFilter 对 象
* @method egret . DropShadowFilter # constructor
* @param distance { number } 阴 影 的 偏 移 距 离 , 以 像 素 为 单 位 。
* @param angle { number } 阴 影 的 角 度 , 0 到 360 度 ( 浮 点 ) 。
* @param color { number } 光 晕 颜 色 , 采 用 十 六 进 制 格 式 0 xRRGGBB 。 默 认 值 为 0xFF0000 。
* @param alpha { number } 颜 色 的 Alpha 透 明 度 值 。 有 效 值 为 0 到 1 。 例 如 , 0.25 设 置 透 明 度 值 为 25 % 。
* @param blurX { number } 水 平 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param blurY { number } 垂 直 模 糊 量 。 有 效 值 为 0 到 255 ( 浮 点 ) 。
* @param strength { number } 印 记 或 跨 页 的 强 度 。 该 值 越 高 , 压 印 的 颜 色 越 深 , 而 且 发 光 与 背 景 之 间 的 对 比 度 也 越 强 。 有 效 值 为 0 到 255 。
* @param quality { number } 应 用 滤 镜 的 次 数 。 暂 未 实 现 。
* @param inner { boolean } 指 定 发 光 是 否 为 内 侧 发 光 。 值 true 指 定 发 光 是 内 侧 发 光 。 值 false 指 定 发 光 是 外 侧 发 光 ( 对 象 外 缘 周 围 的 发 光 ) 。
* @param knockout { number } 指 定 对 象 是 否 具 有 挖 空 效 果 。 值 为 true 将 使 对 象 的 填 充 变 为 透 明 , 并 显 示 文 档 的 背 景 颜 色 。
* @param hideObject { number } 表 示 是 否 隐 藏 对 象 。 如 果 值 为 true , 则 表 示 没 有 绘 制 对 象 本 身 , 只 有 阴 影 是 可 见 的 。 默 认 值 为 false ( 显 示 对 象 ) 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
constructor ( distance? : number , angle? : number , color? : number , alpha? : number , blurX? : number , blurY? : number , strength? : number , quality? : number , inner? : boolean , knockout? : boolean , hideObject? : boolean ) ;
/ * *
* @private
* /
$distance : number ;
/ * *
* The offset distance of the bevel .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 阴 影 的 偏 移 距 离 , 以 像 素 为 单 位 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
distance : number ;
/ * *
* @private
* /
$angle : number ;
/ * *
* The angle of the bevel .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 阴 影 的 角 度 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
angle : number ;
/ * *
* @private
* /
$hideObject : boolean ;
/ * *
* Indicates whether or not the object is hidden .
* @version Egret 3.1 . 4
* @platform Web
* @language en_US
* /
/ * *
* 表 示 是 否 隐 藏 对 象 。
* @version Egret 3.1 . 4
* @platform Web
* @language zh_CN
* /
hideObject : boolean ;
/ * *
* @private
* /
$toJson ( ) : string ;
protected updatePadding ( ) : void ;
}
}
declare namespace egret {
/ * *
* The GradientType class provides values for the type parameter in the beginGradientFill ( ) methods of the egret . Graphics class .
*
* @see egret . Graphics # beginGradientFill ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* GradientType 类 为 egret . Graphics 类 的 beginGradientFill ( ) 方 法 中 的 type 参 数 提 供 值 。
*
* @see egret . Graphics # beginGradientFill ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class GradientType {
/ * *
* Value used to specify a linear gradient fill .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 于 指 定 线 性 渐 变 填 充 的 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static LINEAR : string ;
/ * *
* Value used to specify a radial gradient fill .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 于 指 定 放 射 状 渐 变 填 充 的 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static RADIAL : string ;
}
}
declare namespace egret {
/ * *
* The Graphics class contains a set of methods for creating vector shape . Display objects that support drawing include Sprite and Shape objects . Each class in these classes includes the graphics attribute that is a Graphics object .
* The following auxiliary functions are provided for ease of use : drawRect ( ) , drawRoundRect ( ) , drawCircle ( ) , and drawEllipse ( ) .
* @see http : //edn.egret.com/cn/docs/page/136 Draw Rectangle
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Graphics . ts
* @language en_US
* /
/ * *
* Graphics 类 包 含 一 组 可 用 来 创 建 矢 量 形 状 的 方 法 。 支 持 绘 制 的 显 示 对 象 包 括 Sprite 和 Shape 对 象 。 这 些 类 中 的 每 一 个 类 都 包 括 graphics 属 性 , 该 属 性 是 一 个 Graphics 对 象 。
* 以 下 是 为 便 于 使 用 而 提 供 的 一 些 辅 助 函 数 : drawRect ( ) 、 drawRoundRect ( ) 、 drawCircle ( ) 和 drawEllipse ( ) 。
* @see http : //edn.egret.com/cn/docs/page/136 绘制矩形
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Graphics . ts
* @language zh_CN
* /
class Graphics extends HashObject {
/ * *
* Initializes a Graphics object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 Graphics 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
/ * *
* @private
* /
$renderNode : sys.GraphicsNode ;
/ * *
* 绑 定 到 的 目 标 显 示 对 象
* /
$targetDisplay : DisplayObject ;
$targetIsSprite : boolean ;
/ * *
* @private
* 设 置 绑 定 到 的 目 标 显 示 对 象
* /
$setTarget ( target : DisplayObject ) : void ;
/ * *
* 当 前 移 动 到 的 坐 标 X
* /
private lastX ;
/ * *
* 当 前 移 动 到 的 坐 标 Y
* /
private lastY ;
/ * *
* 当 前 正 在 绘 制 的 填 充
* /
private fillPath ;
/ * *
* 当 前 正 在 绘 制 的 线 条
* /
private strokePath ;
/ * *
* 线 条 的 左 上 方 宽 度
* /
private topLeftStrokeWidth ;
/ * *
* 线 条 的 右 下 方 宽 度
* /
private bottomRightStrokeWidth ;
/ * *
* 对 1 像 素 和 3 像 素 特 殊 处 理 , 向 右 下 角 偏 移 0.5 像 素 , 以 显 示 清 晰 锐 利 的 线 条 。
* /
private setStrokeWidth ( width ) ;
/ * *
* Specify a simple single color fill that will be used for subsequent calls to other Graphics methods ( for example , lineTo ( ) and drawCircle ( ) ) when drawing .
* Calling the clear ( ) method will clear the fill .
* @param color Filled color
* @param alpha Filled Alpha value
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 定 一 种 简 单 的 单 一 颜 色 填 充 , 在 绘 制 时 该 填 充 将 在 随 后 对 其 他 Graphics 方 法 ( 如 lineTo ( ) 或 drawCircle ( ) ) 的 调 用 中 使 用 。
* 调 用 clear ( ) 方 法 会 清 除 填 充 。
* @param color 填 充 的 颜 色
* @param alpha 填 充 的 Alpha 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
beginFill ( color : number , alpha? : number ) : void ;
/ * *
* Specifies a gradient fill used by subsequent calls to other Graphics methods ( such as lineTo ( ) or drawCircle ( ) ) for the object .
* Calling the clear ( ) method clears the fill .
* @param type A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType . RADIAL .
* @param colors An array of RGB hexadecimal color values used in the gradient ; for example , red is 0xFF0000 , blue is 0x0000FF , and so on . You can specify up to 15 colors . For each color , specify a corresponding value in the alphas and ratios parameters .
* @param alphas An array of alpha values for the corresponding colors in the colors array ;
* @param ratios An array of color distribution ratios ; valid values are 0 - 255 .
* @param matrix A transformation matrix as defined by the egret . Matrix class . The egret . Matrix class includes a createGradientBox ( ) method , which lets you conveniently set up the matrix for use with the beginGradientFill ( ) method .
* @platform Web , Native
* @version Egret 2.4
* @language en_US
* /
/ * *
* 指 定 一 种 渐 变 填 充 , 用 于 随 后 调 用 对 象 的 其 他 Graphics 方 法 ( 如 lineTo ( ) 或 drawCircle ( ) ) 。
* 调 用 clear ( ) 方 法 会 清 除 填 充 。
* @param type 用 于 指 定 要 使 用 哪 种 渐 变 类 型 的 GradientType 类 的 值 : GradientType . LINEAR 或 GradientType . RADIAL 。
* @param colors 渐 变 中 使 用 的 RGB 十 六 进 制 颜 色 值 的 数 组 ( 例 如 , 红 色 为 0xFF0000 , 蓝 色 为 0x0000FF , 等 等 ) 。 对 于 每 种 颜 色 , 请 在 alphas 和 ratios 参 数 中 指 定 对 应 值 。
* @param alphas colors 数 组 中 对 应 颜 色 的 alpha 值 数 组 。
* @param ratios 颜 色 分 布 比 率 的 数 组 。 有 效 值 为 0 到 255 。
* @param matrix 一 个 由 egret . Matrix 类 定 义 的 转 换 矩 阵 。 egret . Matrix 类 包 括 createGradientBox ( ) 方 法 , 通 过 该 方 法 可 以 方 便 地 设 置 矩 阵 , 以 便 与 beginGradientFill ( ) 方 法 一 起 使 用
* @platform Web , Native
* @version Egret 2.4
* @language zh_CN
* /
beginGradientFill ( type : string , colors : number [ ] , alphas : number [ ] , ratios : number [ ] , matrix? : egret.Matrix ) : void ;
/ * *
* Apply fill to the lines and curves added after the previous calling to the beginFill ( ) method .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 对 从 上 一 次 调 用 beginFill ( ) 方 法 之 后 添 加 的 直 线 和 曲 线 应 用 填 充 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
endFill ( ) : void ;
/ * *
* Specify a line style that will be used for subsequent calls to Graphics methods such as lineTo ( ) and drawCircle ( ) .
* @param thickness An integer , indicating the thickness of the line in points . Valid values are 0 to 255 . If a number is not specified , or if the parameter is undefined , a line is not drawn . If a value less than 0 is passed , the default value is 0 . Value 0 indicates hairline thickness ; the maximum thickness is 255 . If a value greater than 255 is passed , the default value is 255 .
* @param color A hexadecimal color value of the line ( for example , red is 0xFF0000 , and blue is 0x0000FF , etc . ) . If no value is specified , the default value is 0x000000 ( black ) . Optional .
* @param alpha Indicates Alpha value of the line ' s color . Valid values are 0 to 1 . If no value is specified , the default value is 1 ( solid ) . If the value is less than 0 , the default value is 0 . If the value is greater than 1 , the default value is 1 .
* @param pixelHinting A boolean value that specifies whether to hint strokes to full pixels . This affects both the position of anchors of a curve and the line stroke size itself . With pixelHinting set to true , the line width is adjusted to full pixel width . With pixelHinting set to false , disjoints can appear for curves and straight lines .
* @param scaleMode Specifies the scale mode to be used
* @param caps Specifies the value of the CapsStyle class of the endpoint type at the end of the line . ( default = CapsStyle . ROUND )
* @param joints Specifies the type of joint appearance of corner . ( default = JointStyle . ROUND )
* @param miterLimit Indicates the limit number of cut miter .
* @param lineDash set the line dash .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 定 一 种 线 条 样 式 以 用 于 随 后 对 lineTo ( ) 或 drawCircle ( ) 等 Graphics 方 法 的 调 用 。
* @param thickness 一 个 整 数 , 以 点 为 单 位 表 示 线 条 的 粗 细 , 有 效 值 为 0 到 255 。 如 果 未 指 定 数 字 , 或 者 未 定 义 该 参 数 , 则 不 绘 制 线 条 。 如 果 传 递 的 值 小 于 0 , 则 默 认 值 为 0 。 值 0 表 示 极 细 的 粗 细 ; 最 大 粗 细 为 255 。 如 果 传 递 的 值 大 于 255 , 则 默 认 值 为 255 。
* @param color 线 条 的 十 六 进 制 颜 色 值 ( 例 如 , 红 色 为 0xFF0000 , 蓝 色 为 0x0000FF 等 ) 。 如 果 未 指 明 值 , 则 默 认 值 为 0x000000 ( 黑 色 ) 。 可 选 。
* @param alpha 表 示 线 条 颜 色 的 Alpha 值 的 数 字 ; 有 效 值 为 0 到 1 。 如 果 未 指 明 值 , 则 默 认 值 为 1 ( 纯 色 ) 。 如 果 值 小 于 0 , 则 默 认 值 为 0 。 如 果 值 大 于 1 , 则 默 认 值 为 1 。
* @param pixelHinting 布 尔 型 值 , 指 定 是 否 提 示 笔 触 采 用 完 整 像 素 。 它 同 时 影 响 曲 线 锚 点 的 位 置 以 及 线 条 笔 触 大 小 本 身 。 在 pixelHinting 设 置 为 true 的 情 况 下 , 线 条 宽 度 会 调 整 到 完 整 像 素 宽 度 。 在 pixelHinting 设 置 为 false 的 情 况 下 , 对 于 曲 线 和 直 线 可 能 会 出 现 脱 节 。
* @param scaleMode 用 于 指 定 要 使 用 的 比 例 模 式
* @param caps 用 于 指 定 线 条 末 端 处 端 点 类 型 的 CapsStyle 类 的 值 。 默 认 值 : CapsStyle . ROUND
* @param joints 指 定 用 于 拐 角 的 连 接 外 观 的 类 型 。 默 认 值 : JointStyle . ROUND
* @param miterLimit 用 于 表 示 剪 切 斜 接 的 极 限 值 的 数 字 。
* @param lineDash 设 置 虚 线 样 式 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
lineStyle ( thickness? : number , color? : number , alpha? : number , pixelHinting? : boolean , scaleMode? : string , caps? : string , joints? : string , miterLimit? : number , lineDash? : number [ ] ) : void ;
/ * *
* Draw a rectangle
* @param x x position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param y y position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param width Width of the rectangle ( in pixels ) .
* @param height Height of the rectangle ( in pixels ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 绘 制 一 个 矩 形
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawRect ( x : number , y : number , width : number , height : number ) : void ;
/ * *
* Draw a rectangle with rounded corners .
* @param x x position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param y y position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param width Width of the rectangle ( in pixels ) .
* @param height Height of the rectangle ( in pixels ) .
* @param ellipseWidth Width used to draw an ellipse with rounded corners ( in pixels ) .
* @param ellipseHeight Height used to draw an ellipse with rounded corners ( in pixels ) . ( Optional ) If no value is specified , the default value matches the value of the ellipseWidth parameter .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 绘 制 一 个 圆 角 矩 形 。
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @param ellipseWidth 用 于 绘 制 圆 角 的 椭 圆 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param ellipseHeight 用 于 绘 制 圆 角 的 椭 圆 的 高 度 ( 以 像 素 为 单 位 ) 。 ( 可 选 ) 如 果 未 指 定 值 , 则 默 认 值 与 为 ellipseWidth 参 数 提 供 的 值 相 匹 配 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawRoundRect ( x : number , y : number , width : number , height : number , ellipseWidth : number , ellipseHeight? : number ) : void ;
/ * *
* Draw a circle .
* @param x x position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param y y position of the center , relative to the registration point of the parent display object ( in pixels ) .
* @param r Radius of the circle ( in pixels ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 绘 制 一 个 圆 。
* @param x 圆 心 相 对 于 父 显 示 对 象 注 册 点 的 x 位 置 ( 以 像 素 为 单 位 ) 。
* @param y 相 对 于 父 显 示 对 象 注 册 点 的 圆 心 的 y 位 置 ( 以 像 素 为 单 位 ) 。
* @param radius 圆 的 半 径 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawCircle ( x : number , y : number , radius : number ) : void ;
/ * *
* Draw an ellipse .
* @param x A number indicating the horizontal position , relative to the registration point of the parent display object ( in pixels ) .
* @param y A number indicating the vertical position , relative to the registration point of the parent display object ( in pixels ) .
* @param width Width of the rectangle ( in pixels ) .
* @param height Height of the rectangle ( in pixels ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 绘 制 一 个 椭 圆 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawEllipse ( x : number , y : number , width : number , height : number ) : void ;
/ * *
* Move the current drawing position to ( x , y ) . If any of these parameters is missed , calling this method will fail and the current drawing position keeps unchanged .
* @param x A number indicating the horizontal position , relative to the registration point of the parent display object ( in pixels ) .
* @param y A number indicating the vertical position , relative to the registration point of the parent display object ( in pixels ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 当 前 绘 图 位 置 移 动 到 ( x , y ) 。 如 果 缺 少 任 何 一 个 参 数 , 则 此 方 法 将 失 败 , 并 且 当 前 绘 图 位 置 不 改 变 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
moveTo ( x : number , y : number ) : void ;
/ * *
* Draw a straight line from the current drawing position to ( x , y ) using the current line style ; the current drawing position is then set to ( x , y ) .
* @param x A number indicating the horizontal position , relative to the registration point of the parent display object ( in pixels ) .
* @param y A number indicating the vertical position , relative to the registration point of the parent display object ( in pixels ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 当 前 线 条 样 式 绘 制 一 条 从 当 前 绘 图 位 置 开 始 到 ( x , y ) 结 束 的 直 线 ; 当 前 绘 图 位 置 随 后 会 设 置 为 ( x , y ) 。
* @param x 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @param y 一 个 表 示 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 的 数 字 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
lineTo ( x : number , y : number ) : void ;
/ * *
* Draw a quadratic Bezier curve from the current drawing position to ( anchorX , anchorY ) using the current line style according to the control points specified by ( controlX , controlY ) . The current drawing position is then set to ( anchorX , anchorY ) .
* If the curveTo ( ) method is called before the moveTo ( ) method , the default value of the current drawing position is ( 0 , 0 ) . If any of these parameters is missed , calling this method will fail and the current drawing position keeps unchanged .
* The drawn curve is a quadratic Bezier curve . A quadratic Bezier curve contains two anchor points and one control point . The curve interpolates the two anchor points and bends to the control point .
* @param controlX A number indicating the horizontal position of the control point , relative to the registration point of the parent display object .
* @param controlY A number indicating the vertical position of the control point , relative to the registration point of the parent display object .
* @param anchorX A number indicating the horizontal position of the next anchor point , relative to the registration point of the parent display object .
* @param anchorY A number indicating the vertical position of the next anchor point , relative to the registration point of the parent display object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 当 前 线 条 样 式 和 由 ( controlX , controlY ) 指 定 的 控 制 点 绘 制 一 条 从 当 前 绘 图 位 置 开 始 到 ( anchorX , anchorY ) 结 束 的 二 次 贝 塞 尔 曲 线 。 当 前 绘 图 位 置 随 后 设 置 为 ( anchorX , anchorY ) 。
* 如 果 在 调 用 moveTo ( ) 方 法 之 前 调 用 了 curveTo ( ) 方 法 , 则 当 前 绘 图 位 置 的 默 认 值 为 ( 0 , 0 ) 。 如 果 缺 少 任 何 一 个 参 数 , 则 此 方 法 将 失 败 , 并 且 当 前 绘 图 位 置 不 改 变 。
* 绘 制 的 曲 线 是 二 次 贝 塞 尔 曲 线 。 二 次 贝 塞 尔 曲 线 包 含 两 个 锚 点 和 一 个 控 制 点 。 该 曲 线 内 插 这 两 个 锚 点 , 并 向 控 制 点 弯 曲 。
* @param controlX 一 个 数 字 , 指 定 控 制 点 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 。
* @param controlY 一 个 数 字 , 指 定 控 制 点 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 。
* @param anchorX 一 个 数 字 , 指 定 下 一 个 锚 点 相 对 于 父 显 示 对 象 注 册 点 的 水 平 位 置 。
* @param anchorY 一 个 数 字 , 指 定 下 一 个 锚 点 相 对 于 父 显 示 对 象 注 册 点 的 垂 直 位 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
curveTo ( controlX : number , controlY : number , anchorX : number , anchorY : number ) : void ;
/ * *
* Draws a cubic Bezier curve from the current drawing position to the specified anchor . Cubic Bezier curves consist of two anchor points and two control points . The curve interpolates the two anchor points and two control points to the curve .
* @param controlX1 Specifies the first control point relative to the registration point of the parent display the horizontal position of the object .
* @param controlY1 Specifies the first control point relative to the registration point of the parent display the vertical position of the object .
* @param controlX2 Specify the second control point relative to the registration point of the parent display the horizontal position of the object .
* @param controlY2 Specify the second control point relative to the registration point of the parent display the vertical position of the object .
* @param anchorX Specifies the anchor point relative to the registration point of the parent display the horizontal position of the object .
* @param anchorY Specifies the anchor point relative to the registration point of the parent display the vertical position of the object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 当 前 绘 图 位 置 到 指 定 的 锚 点 绘 制 一 条 三 次 贝 塞 尔 曲 线 。 三 次 贝 塞 尔 曲 线 由 两 个 锚 点 和 两 个 控 制 点 组 成 。 该 曲 线 内 插 这 两 个 锚 点 , 并 向 两 个 控 制 点 弯 曲 。
* @param controlX1 指 定 首 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param controlY1 指 定 首 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* @param controlX2 指 定 第 二 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param controlY2 指 定 第 二 个 控 制 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* @param anchorX 指 定 锚 点 相 对 于 父 显 示 对 象 的 注 册 点 的 水 平 位 置 。
* @param anchorY 指 定 锚 点 相 对 于 父 显 示 对 象 的 注 册 点 的 垂 直 位 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
cubicCurveTo ( controlX1 : number , controlY1 : number , controlX2 : number , controlY2 : number , anchorX : number , anchorY : number ) : void ;
/ * *
* adds an arc to the path which is centered at ( x , y ) position with radius r starting at startAngle and ending
* at endAngle going in the given direction by anticlockwise ( defaulting to clockwise ) .
* @param x The x coordinate of the arc ' s center .
* @param y The y coordinate of the arc ' s center .
* @param radius The arc ' s radius .
* @param startAngle The angle at which the arc starts , measured clockwise from the positive x axis and expressed in radians .
* @param endAngle The angle at which the arc ends , measured clockwise from the positive x axis and expressed in radians .
* @param anticlockwise if true , causes the arc to be drawn counter - clockwise between the two angles . By default it is drawn clockwise .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 绘 制 一 段 圆 弧 路 径 。 圆 弧 路 径 的 圆 心 在 ( x , y ) 位 置 , 半 径 为 r , 根 据 anticlockwise ( 默 认 为 顺 时 针 ) 指 定 的 方 向 从 startAngle 开 始 绘 制 , 到 endAngle 结 束 。
* @param x 圆 弧 中 心 ( 圆 心 ) 的 x 轴 坐 标 。
* @param y 圆 弧 中 心 ( 圆 心 ) 的 y 轴 坐 标 。
* @param radius 圆 弧 的 半 径 。
* @param startAngle 圆 弧 的 起 始 点 , x轴方向开始计算 , 单 位 以 弧 度 表 示 。
* @param endAngle 圆 弧 的 终 点 , 单 位 以 弧 度 表 示 。
* @param anticlockwise 如 果 为 true , 逆 时 针 绘 制 圆 弧 , 反 之 , 顺 时 针 绘 制 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawArc ( x : number , y : number , radius : number , startAngle : number , endAngle : number , anticlockwise? : boolean ) : void ;
private dirty ( ) ;
/ * *
* @private
* 测 量 圆 弧 的 矩 形 大 小
* /
private arcBounds ( x , y , radius , startAngle , endAngle ) ;
/ * *
* Clear graphics that are drawn to this Graphics object , and reset fill and line style settings .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 清 除 绘 制 到 此 Graphics 对 象 的 图 形 , 并 重 置 填 充 和 线 条 样 式 设 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
clear ( ) : void ;
/ * *
* @private
* /
private minX ;
/ * *
* @private
* /
private minY ;
/ * *
* @private
* /
private maxX ;
/ * *
* @private
* /
private maxY ;
/ * *
* @private
* /
private extendBoundsByPoint ( x , y ) ;
/ * *
* @private
* /
private extendBoundsByX ( x ) ;
/ * *
* @private
* /
private extendBoundsByY ( y ) ;
/ * *
* @private
* /
private updateNodeBounds ( ) ;
/ * *
* 是 否 已 经 包 含 上 一 次 moveTo的坐标点
* /
private includeLastPosition ;
/ * *
* 更 新 当 前 的 lineX和lineY值 , 并 标 记 尺 寸 失 效 。
* @private
* /
private updatePosition ( x , y ) ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
*
* /
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
/ * *
* @private
* /
$onRemoveFromStage ( ) : void ;
}
}
declare namespace egret {
/ * *
* The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to
* another . You can perform various graphical transformations on a display object by setting the properties of a Matrix
* object , applying that Matrix object to the matrix property of a display object , These transformation functions include
* translation ( x and y repositioning ) , rotation , scaling , and skewing .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Matrix . ts
* @language en_US
* /
/ * *
* Matrix 类 表 示 一 个 转 换 矩 阵 , 它 确 定 如 何 将 点 从 一 个 坐 标 空 间 映 射 到 另 一 个 坐 标 空 间 。
* 您 可 以 对 一 个 显 示 对 象 执 行 不 同 的 图 形 转 换 , 方 法 是 设 置 Matrix 对 象 的 属 性 , 将 该 Matrix
* 对 象 应 用 于 显 示 对 象 的 matrix 属 性 。 这 些 转 换 函 数 包 括 平 移 ( x 和 y 重 新 定 位 ) 、 旋 转 、 缩 放 和 倾 斜 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Matrix . ts
* @language zh_CN
* /
class Matrix extends HashObject {
/ * *
* Releases a matrix instance to the object pool
* @param matrix matrix that Needs to be recycled
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 一 个 Matrix实例到对象池
* @param matrix 需 要 回 收 的 matrix
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static release ( matrix : Matrix ) : void ;
/ * *
* get a matrix instance from the object pool or create a new one .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 对 象 池 中 取 出 或 创 建 一 个 新 的 Matrix对象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static create ( ) : Matrix ;
/ * *
* Creates a new Matrix object with the specified parameters .
* @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image .
* @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image .
* @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image .
* @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image . .
* @param tx The distance by which to translate each point along the x axis .
* @param ty The distance by which to translate each point along the y axis .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 参 数 创 建 一 个 Matrix 对 象
* @param a 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值 。
* @param b 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值 。
* @param c 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值 。
* @param d 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值 。
* @param tx 沿 x 轴 平 移 每 个 点 的 距 离 。
* @param ty 沿 y 轴 平 移 每 个 点 的 距 离 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( a? : number , b? : number , c? : number , d? : number , tx? : number , ty? : number ) ;
/ * *
* The value that affects the positioning of pixels along the x axis when scaling or rotating an image .
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
a : number ;
/ * *
* The value that affects the positioning of pixels along the y axis when rotating or skewing an image .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
b : number ;
/ * *
* The value that affects the positioning of pixels along the x axis when rotating or skewing an image .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
c : number ;
/ * *
* The value that affects the positioning of pixels along the y axis when scaling or rotating an image .
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @default 1
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
d : number ;
/ * *
* The distance by which to translate each point along the x axis .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 沿 x 轴 平 移 每 个 点 的 距 离
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
tx : number ;
/ * *
* The distance by which to translate each point along the y axis .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 沿 y 轴 平 移 每 个 点 的 距 离
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
ty : number ;
/ * *
* Returns a new Matrix object that is a clone of this matrix , with an exact copy of the contained object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 一 个 新 的 Matrix 对 象 , 它 是 此 矩 阵 的 克 隆 , 带 有 与 所 含 对 象 完 全 相 同 的 副 本 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
clone ( ) : Matrix ;
/ * *
* Concatenates a matrix with the current matrix , effectively combining the geometric effects of the two . In mathematical
* terms , concatenating two matrixes is the same as combining them using matrix multiplication .
* @param other The matrix to be concatenated to the source matrix .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 某 个 矩 阵 与 当 前 矩 阵 连 接 , 从 而 将 这 两 个 矩 阵 的 几 何 效 果 有 效 地 结 合 在 一 起 。 在 数 学 术 语 中 , 将 两 个 矩 阵 连 接 起 来 与 使 用 矩 阵 乘 法 将 它 们 结 合 起 来 是 相 同 的 。
* @param other 要 连 接 到 源 矩 阵 的 矩 阵 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
concat ( other : Matrix ) : void ;
/ * *
* Copies all of the matrix data from the source Point object into the calling Matrix object .
* @param other The Matrix object from which to copy the data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 源 Matrix 对 象 中 的 所 有 矩 阵 数 据 复 制 到 调 用 方 Matrix 对 象 中 。
* @param other 要 拷 贝 的 目 标 矩 阵
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
copyFrom ( other : Matrix ) : Matrix ;
/ * *
* Sets each matrix property to a value that causes a null transformation . An object transformed by applying an
* identity matrix will be identical to the original . After calling the identity ( ) method , the resulting matrix
* has the following properties : a = 1 , b = 0 , c = 0 , d = 1 , tx = 0 , ty = 0 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 为 每 个 矩 阵 属 性 设 置 一 个 值 , 该 值 将 导 致 矩 阵 无 转 换 。 通 过 应 用 恒 等 矩 阵 转 换 的 对 象 将 与 原 始 对 象 完 全 相 同 。
* 调 用 identity ( ) 方 法 后 , 生 成 的 矩 阵 具 有 以 下 属 性 : a = 1 、 b = 0 、 c = 0 、 d = 1 、 tx = 0 和 ty = 0 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
identity ( ) : void ;
/ * *
* Performs the opposite transformation of the original matrix . You can apply an inverted matrix to an object to
* undo the transformation performed when applying the original matrix .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 执 行 原 始 矩 阵 的 逆 转 换 。
* 您 可 以 将 一 个 逆 矩 阵 应 用 于 对 象 来 撤 消 在 应 用 原 始 矩 阵 时 执 行 的 转 换 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
invert ( ) : void ;
/ * *
* @private
* /
$invertInto ( target : Matrix ) : void ;
/ * *
* Applies a rotation transformation to the Matrix object .
* The rotate ( ) method alters the a , b , c , and d properties of the Matrix object .
* @param angle The rotation angle in radians .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 对 Matrix 对 象 应 用 旋 转 转 换 。
* rotate ( ) 方 法 将 更 改 Matrix 对 象 的 a 、 b 、 c 和 d 属 性 。
* @param angle 以 弧 度 为 单 位 的 旋 转 角 度 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
rotate ( angle : number ) : void ;
/ * *
* Applies a scaling transformation to the matrix . The x axis is multiplied by sx , and the y axis it is multiplied by sy .
* The scale ( ) method alters the a and d properties of the Matrix object .
* @param sx A multiplier used to scale the object along the x axis .
* @param sy A multiplier used to scale the object along the y axis .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 对 矩 阵 应 用 缩 放 转 换 。 x 轴 乘 以 sx , y 轴 乘 以 sy 。
* scale ( ) 方 法 将 更 改 Matrix 对 象 的 a 和 d 属 性 。
* @param sx 用 于 沿 x 轴 缩 放 对 象 的 乘 数 。
* @param sy 用 于 沿 y 轴 缩 放 对 象 的 乘 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
scale ( sx : number , sy : number ) : void ;
/ * *
* Sets the members of Matrix to the specified values
* @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image .
* @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image .
* @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image .
* @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image . .
* @param tx The distance by which to translate each point along the x axis .
* @param ty The distance by which to translate each point along the y axis .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 Matrix 的 成 员 设 置 为 指 定 值
* @param a 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值 。
* @param b 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值 。
* @param c 旋 转 或 倾 斜 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值 。
* @param d 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值 。
* @param tx 沿 x 轴 平 移 每 个 点 的 距 离 。
* @param ty 沿 y 轴 平 移 每 个 点 的 距 离 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setTo ( a : number , b : number , c : number , d : number , tx : number , ty : number ) : Matrix ;
/ * *
* Returns the result of applying the geometric transformation represented by the Matrix object to the specified point .
* @param pointX The x coordinate for which you want to get the result of the Matrix transformation .
* @param pointY The y coordinate for which you want to get the result of the Matrix transformation .
* @param resultPoint A reusable instance of Point for saving the results . Passing this parameter can reduce the
* number of reallocate objects , which allows you to get better code execution performance .
* @returns The point resulting from applying the Matrix transformation .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 将 Matrix 对 象 表 示 的 几 何 转 换 应 用 于 指 定 点 所 产 生 的 结 果 。
* @param pointX 想 要 获 得 其 矩 阵 转 换 结 果 的 点 的 x坐标 。
* @param pointY 想 要 获 得 其 矩 阵 转 换 结 果 的 点 的 y坐标 。
* @param resultPoint 框 架 建 议 尽 可 能 减 少 创 建 对 象 次 数 来 优 化 性 能 , 可 以 从 外 部 传 入 一 个 复 用 的 Point对象来存储结果 , 若 不 传 入 将 创 建 一 个 新 的 Point对象返回 。
* @returns 由 应 用 矩 阵 转 换 所 产 生 的 点 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
transformPoint ( pointX : number , pointY : number , resultPoint? : Point ) : Point ;
/ * *
* Translates the matrix along the x and y axes , as specified by the dx and dy parameters .
* @param dx The amount of movement along the x axis to the right , in pixels .
* @param dy The amount of movement down along the y axis , in pixels .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 沿 x 和 y 轴 平 移 矩 阵 , 由 dx 和 dy 参 数 指 定 。
* @param dx 沿 x 轴 向 右 移 动 的 量 ( 以 像 素 为 单 位 ) 。
* @param dy 沿 y 轴 向 下 移 动 的 量 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
translate ( dx : number , dy : number ) : void ;
/ * *
* Determines whether two matrixes are equal .
* @param other The matrix to be compared .
* @returns A value of true if the object is equal to this Matrix object ; false if it is not equal .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 与 另 一 个 矩 阵 数 据 相 等
* @param other 要 比 较 的 另 一 个 矩 阵 对 象 。
* @returns 是 否 相 等 , ture表示相等 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
equals ( other : Matrix ) : boolean ;
/ * *
* prepend matrix
* @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image .
* @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image .
* @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image .
* @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image . .
* @param tx The distance by which to translate each point along the x axis .
* @param ty The distance by which to translate each point along the y axis .
* @returns matrix
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 前 置 矩 阵
* @param a 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @param b 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @param c 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @param d 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @param tx 沿 x 轴 平 移 每 个 点 的 距 离
* @param ty 沿 y 轴 平 移 每 个 点 的 距 离
* @returns 矩 阵 自 身
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
prepend ( a : number , b : number , c : number , d : number , tx : number , ty : number ) : Matrix ;
/ * *
* append matrix
* @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image .
* @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image .
* @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image .
* @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image . .
* @param tx The distance by which to translate each point along the x axis .
* @param ty The distance by which to translate each point along the y axis .
* @returns matrix
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 后 置 矩 阵
* @param a 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @param b 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @param c 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 x 轴 定 位 的 值
* @param d 缩 放 或 旋 转 图 像 时 影 响 像 素 沿 y 轴 定 位 的 值
* @param tx 沿 x 轴 平 移 每 个 点 的 距 离
* @param ty 沿 y 轴 平 移 每 个 点 的 距 离
* @returns 矩 阵 自 身
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
append ( a : number , b : number , c : number , d : number , tx : number , ty : number ) : Matrix ;
/ * *
* Given a point in the pretransform coordinate space , returns the coordinates of that point after the transformation occurs .
* Unlike the standard transformation applied using the transformPoint ( ) method , the deltaTransformPoint ( ) method ' s transformation does not consider the translation parameters tx and ty .
* @param point The point for which you want to get the result of the matrix transformation .
* @returns The point resulting from applying the matrix transformation .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 给 定 预 转 换 坐 标 空 间 中 的 点 , 则 此 方 法 返 回 发 生 转 换 后 该 点 的 坐 标 。
* 与 使 用 transformPoint ( ) 方 法 应 用 的 标 准 转 换 不 同 , deltaTransformPoint ( ) 方 法 的 转 换 不 考 虑 转 换 参 数 tx 和 ty 。
* @param point 想 要 获 得 其 矩 阵 转 换 结 果 的 点
* @returns 由 应 用 矩 阵 转 换 所 产 生 的 点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
deltaTransformPoint ( point : Point ) : Point ;
/ * *
* Returns a text value listing the properties of the Matrix object .
* @returns A string containing the values of the properties of the Matrix object : a , b , c , d , tx , and ty .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 将 Matrix 对 象 表 示 的 几 何 转 换 应 用 于 指 定 点 所 产 生 的 结 果 。
* @returns 一 个 字 符 串 , 它 包 含 Matrix 对 象 的 属 性 值 : a 、 b 、 c 、 d 、 tx 和 ty 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
toString ( ) : string ;
/ * *
* Includes parameters for scaling , rotation , and translation . When applied to a matrix it sets the matrix ' s values based on those parameters .
* @param scaleX The factor by which to scale horizontally .
* @param scaleY The factor by which scale vertically .
* @param rotation The amount to rotate , in radians .
* @param tx The number of pixels to translate ( move ) to the right along the x axis .
* @param ty The number of pixels to translate ( move ) down along the y axis .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 包 括 用 于 缩 放 、 旋 转 和 转 换 的 参 数 。 当 应 用 于 矩 阵 时 , 该 方 法 会 基 于 这 些 参 数 设 置 矩 阵 的 值 。
* @param scaleX 水 平 缩 放 所 用 的 系 数
* @param scaleY 垂 直 缩 放 所 用 的 系 数
* @param rotation 旋 转 量 ( 以 弧 度 为 单 位 )
* @param tx 沿 x 轴 向 右 平 移 ( 移 动 ) 的 像 素 数
* @param ty 沿 y 轴 向 下 平 移 ( 移 动 ) 的 像 素 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
createBox ( scaleX : number , scaleY : number , rotation? : number , tx? : number , ty? : number ) : void ;
/ * *
* Creates the specific style of matrix expected by the beginGradientFill ( ) and lineGradientStyle ( ) methods of the Graphics class .
* Width and height are scaled to a scaleX / scaleY pair and the tx / ty values are offset by half the width and height .
* @param width The width of the gradient box .
* @param height The height of the gradient box .
* @param rotation The amount to rotate , in radians .
* @param tx The distance , in pixels , to translate to the right along the x axis . This value is offset by half of the width parameter .
* @param ty The distance , in pixels , to translate down along the y axis . This value is offset by half of the height parameter .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 Graphics 类 的 beginGradientFill ( ) 和 lineGradientStyle ( ) 方 法 所 需 的 矩 阵 的 特 定 样 式 。
* 宽 度 和 高 度 被 缩 放 为 scaleX / scaleY 对 , 而 tx / ty 值 偏 移 了 宽 度 和 高 度 的 一 半 。
* @param width 渐 变 框 的 宽 度
* @param height 渐 变 框 的 高 度
* @param rotation 旋 转 量 ( 以 弧 度 为 单 位 )
* @param tx 沿 x 轴 向 右 平 移 的 距 离 ( 以 像 素 为 单 位 ) 。 此 值 将 偏 移 width 参 数 的 一 半
* @param ty 沿 y 轴 向 下 平 移 的 距 离 ( 以 像 素 为 单 位 ) 。 此 值 将 偏 移 height 参 数 的 一 半
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
createGradientBox ( width : number , height : number , rotation? : number , tx? : number , ty? : number ) : void ;
/ * *
* @private
* /
$transformBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
* /
private getDeterminant ( ) ;
/ * *
* @private
* /
$getScaleX ( ) : number ;
/ * *
* @private
* /
$getScaleY ( ) : number ;
/ * *
* @private
* /
$getSkewX ( ) : number ;
/ * *
* @private
* /
$getSkewY ( ) : number ;
/ * *
* @private
* /
$updateScaleAndRotation ( scaleX : number , scaleY : number , skewX : number , skewY : number ) : void ;
/ * *
* @private
* target = other * this
* /
$preMultiplyInto ( other : Matrix , target : Matrix ) : void ;
}
/ * *
* @private
* 仅 供 框 架 内 复 用 , 要 防 止 暴 露 引 用 到 外 部 。
* /
let $TempMatrix : Matrix ;
}
declare namespace egret {
/ * *
* A Rectangle object is an area defined by its position , as indicated by its top - left corner point ( x , y ) and by its
* width and its height . < br / >
* The x , y , width , and height properties of the Rectangle class are independent of each other ; changing the value of
* one property has no effect on the others . However , the right and bottom properties are integrally related to those
* four properties . For example , if you change the value of the right property , the value of the width property changes ;
* if you change the bottom property , the value of the height property changes .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Rectangle . ts
* @language en_US
* /
/ * *
* Rectangle 对 象 是 按 其 位 置 ( 由 它 左 上 角 的 点 ( x , y ) 确 定 ) 以 及 宽 度 和 高 度 定 义 的 区 域 。 < br / >
* Rectangle 类 的 x 、 y 、 width 和 height 属 性 相 互 独 立 ; 更 改 一 个 属 性 的 值 不 会 影 响 其 他 属 性 。
* 但 是 , right 和 bottom 属 性 与 这 四 个 属 性 是 整 体 相 关 的 。 例 如 , 如 果 更 改 right 属 性 的 值 , 则 width
* 属 性 的 值 将 发 生 变 化 ; 如 果 更 改 bottom 属 性 , 则 height 属 性 的 值 将 发 生 变 化 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / geom / Rectangle . ts
* @language zh_CN
* /
class Rectangle extends HashObject {
/ * *
* Releases a rectangle instance to the object pool .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 释 放 一 个 Rectangle实例到对象池
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static release ( rect : Rectangle ) : void ;
/ * *
* get a rectangle instance from the object pool or create a new one .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 对 象 池 中 取 出 或 创 建 一 个 新 的 Rectangle对象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static create ( ) : Rectangle ;
/ * *
* Creates a new Rectangle object with the top - left corner specified by the x and y parameters and with the specified
* width and height parameters .
* @param x The x coordinate of the top - left corner of the rectangle .
* @param y The y coordinate of the top - left corner of the rectangle .
* @param width The width of the rectangle , in pixels .
* @param height The height of the rectangle , in pixels .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 新 Rectangle 对 象 , 其 左 上 角 由 x 和 y 参 数 指 定 , 并 具 有 指 定 的 width 和 height 参 数 。
* @param x 矩 形 左 上 角 的 x 坐 标 。
* @param y 矩 形 左 上 角 的 y 坐 标 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( x? : number , y? : number , width? : number , height? : number ) ;
/ * *
* The x coordinate of the top - left corner of the rectangle .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 左 上 角 的 x 坐 标 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
x : number ;
/ * *
* The y coordinate of the top - left corner of the rectangle .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 左 上 角 的 y 坐 标 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
y : number ;
/ * *
* The width of the rectangle , in pixels .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
width : number ;
/ * *
* 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* The height of the rectangle , in pixels .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
height : number ;
/ * *
* The sum of the x and width properties .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* x 和 width 属 性 的 和 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
right : number ;
/ * *
* The sum of the y and height properties .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* y 和 height 属 性 的 和 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bottom : number ;
/ * *
* The x coordinate of the top - left corner of the rectangle . Changing the left property of a Rectangle object has
* no effect on the y and height properties . However it does affect the width property , whereas changing the x value
* does not affect the width property .
* The value of the left property is equal to the value of the x property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 左 上 角 的 x 坐 标 。 更 改 Rectangle 对 象 的 left 属 性 对 y 和 height 属 性 没 有 影 响 。 但 是 , 它 会 影 响 width 属 性 , 而 更 改 x 值 不 会 影 响 width 属 性 。
* left 属 性 的 值 等 于 x 属 性 的 值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
left : number ;
/ * *
* The y coordinate of the top - left corner of the rectangle . Changing the top property of a Rectangle object has
* no effect on the x and width properties . However it does affect the height property , whereas changing the y
* value does not affect the height property . < br / >
* The value of the top property is equal to the value of the y property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 矩 形 左 上 角 的 y 坐 标 。 更 改 Rectangle 对 象 的 top 属 性 对 x 和 width 属 性 没 有 影 响 。 但 是 , 它 会 影 响 height 属 性 , 而 更 改 y 值 不 会 影 响 height 属 性 。 < br / >
* top 属 性 的 值 等 于 y 属 性 的 值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
top : number ;
/ * *
* The location of the Rectangle object ' s top - left corner , determined by the x and y coordinates of the point .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 由 该 点 的 x 和 y 坐 标 确 定 的 Rectangle 对 象 左 上 角 的 位 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
topLeft : Point ;
/ * *
* The location of the Rectangle object ' s bottom - right corner , determined by the values of the right and bottom properties .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 由 right 和 bottom 属 性 的 值 确 定 的 Rectangle 对 象 的 右 下 角 的 位 置 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bottomRight : Point ;
/ * *
* Copies all of rectangle data from the source Rectangle object into the calling Rectangle object .
* @param sourceRect The Rectangle object from which to copy the data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 源 Rectangle 对 象 中 的 所 有 矩 形 数 据 复 制 到 调 用 方 Rectangle 对 象 中 。
* @param sourceRect 要 从 中 复 制 数 据 的 Rectangle 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
copyFrom ( sourceRect : Rectangle ) : Rectangle ;
/ * *
* Sets the members of Rectangle to the specified values
* @param x The x coordinate of the top - left corner of the rectangle .
* @param y The y coordinate of the top - left corner of the rectangle .
* @param width The width of the rectangle , in pixels .
* @param height The height of the rectangle , in pixels .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 Rectangle 的 成 员 设 置 为 指 定 值
* @param x 矩 形 左 上 角 的 x 坐 标 。
* @param y 矩 形 左 上 角 的 y 坐 标 。
* @param width 矩 形 的 宽 度 ( 以 像 素 为 单 位 ) 。
* @param height 矩 形 的 高 度 ( 以 像 素 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setTo ( x : number , y : number , width : number , height : number ) : Rectangle ;
/ * *
* Determines whether the specified point is contained within the rectangular region defined by this Rectangle object .
* @param x The x coordinate ( horizontal position ) of the point .
* @param y The y coordinate ( vertical position ) of the point .
* @returns A value of true if the Rectangle object contains the specified point ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 由 此 Rectangle 对 象 定 义 的 矩 形 区 域 内 是 否 包 含 指 定 的 点 。
* @param x 检 测 点 的 x轴
* @param y 检 测 点 的 y轴
* @returns 如 果 检 测 点 位 于 矩 形 内 , 返 回 true , 否 则 , 返 回 false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
contains ( x : number , y : number ) : boolean ;
/ * *
* If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object , returns
* the area of intersection as a Rectangle object . If the rectangles do not intersect , this method returns an empty
* Rectangle object with its properties set to 0 .
* @param toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object .
* @returns A Rectangle object that equals the area of intersection . If the rectangles do not intersect , this method
* returns an empty Rectangle object ; that is , a rectangle with its x , y , width , and height properties set to 0 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 在 toIntersect 参 数 中 指 定 的 Rectangle 对 象 与 此 Rectangle 对 象 相 交 , 则 返 回 交 集 区 域 作 为 Rectangle 对 象 。 如 果 矩 形 不 相 交 ,
* 则 此 方 法 返 回 一 个 空 的 Rectangle 对 象 , 其 属 性 设 置 为 0 。
* @param toIntersect 要 对 照 比 较 以 查 看 其 是 否 与 此 Rectangle 对 象 相 交 的 Rectangle 对 象 。
* @returns 等 于 交 集 区 域 的 Rectangle 对 象 。 如 果 该 矩 形 不 相 交 , 则 此 方 法 返 回 一 个 空 的 Rectangle 对 象 ; 即 , 其 x 、 y 、 width 和
* height 属 性 均 设 置 为 0 的 矩 形 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
intersection ( toIntersect : Rectangle ) : Rectangle ;
/ * *
* Increases the size of the Rectangle object by the specified amounts , in pixels .
* The center point of the Rectangle object stays the same , and its size increases to the left and right by the dx value , and to the top and the bottom by the dy value .
* @param dx The value to be added to the left and the right of the Rectangle object .
* @param dy The value to be added to the top and the bottom of the Rectangle .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 按 指 定 量 增 加 Rectangle 对 象 的 大 小 ( 以 像 素 为 单 位 )
* 保 持 Rectangle 对 象 的 中 心 点 不 变 , 使 用 dx 值 横 向 增 加 它 的 大 小 , 使 用 dy 值 纵 向 增 加 它 的 大 小 。
* @param dx Rectangle 对 象 横 向 增 加 的 值 。
* @param dy Rectangle 对 象 纵 向 增 加 的 值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
inflate ( dx : number , dy : number ) : void ;
/ * *
* @private
* /
$intersectInPlace ( clipRect : Rectangle ) : Rectangle ;
/ * *
* Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object .
* This method checks the x , y , width , and height properties of the specified Rectangle object to see if it
* intersects with this Rectangle object .
* @param toIntersect The Rectangle object to compare against this Rectangle object .
* @returns A value of true if the specified object intersects with this Rectangle object ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 在 toIntersect 参 数 中 指 定 的 对 象 是 否 与 此 Rectangle 对 象 相 交 。 此 方 法 检 查 指 定 的 Rectangle
* 对 象 的 x 、 y 、 width 和 height 属 性 , 以 查 看 它 是 否 与 此 Rectangle 对 象 相 交 。
* @param toIntersect 要 与 此 Rectangle 对 象 比 较 的 Rectangle 对 象 。
* @returns 如 果 两 个 矩 形 相 交 , 返 回 true , 否 则 返 回 false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
intersects ( toIntersect : Rectangle ) : boolean ;
/ * *
* Determines whether or not this Rectangle object is empty .
* @returns A value of true if the Rectangle object ' s width or height is less than or equal to 0 ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 此 Rectangle 对 象 是 否 为 空 。
* @returns 如 果 Rectangle 对 象 的 宽 度 或 高 度 小 于 等 于 0 , 则 返 回 true 值 , 否 则 返 回 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
isEmpty ( ) : boolean ;
/ * *
* Sets all of the Rectangle object ' s properties to 0 . A Rectangle object is empty if its width or height is less than or equal to 0 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 Rectangle 对 象 的 所 有 属 性 设 置 为 0 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setEmpty ( ) : void ;
/ * *
* Returns a new Rectangle object with the same values for the x , y , width , and height properties as the original Rectangle object .
* @returns A new Rectangle object with the same values for the x , y , width , and height properties as the original Rectangle object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 一 个 新 的 Rectangle 对 象 , 其 x 、 y 、 width 和 height 属 性 的 值 与 原 始 Rectangle 对 象 的 对 应 值 相 同 。
* @returns 新 的 Rectangle 对 象 , 其 x 、 y 、 width 和 height 属 性 的 值 与 原 始 Rectangle 对 象 的 对 应 值 相 同 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
clone ( ) : Rectangle ;
/ * *
* Determines whether the specified point is contained within the rectangular region defined by this Rectangle object .
* This method is similar to the Rectangle . contains ( ) method , except that it takes a Point object as a parameter .
* @param point The point , as represented by its x and y coordinates .
* @returns A value of true if the Rectangle object contains the specified point ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 由 此 Rectangle 对 象 定 义 的 矩 形 区 域 内 是 否 包 含 指 定 的 点 。
* 此 方 法 与 Rectangle . contains ( ) 方 法 类 似 , 只 不 过 它 采 用 Point 对 象 作 为 参 数 。
* @param point 包 含 点 对 象
* @returns 如 果 包 含 , 返 回 true , 否 则 返 回 false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
containsPoint ( point : Point ) : boolean ;
/ * *
* Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object .
* A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first .
* @param rect The Rectangle object being checked .
* @returns A value of true if the Rectangle object that you specify is contained by this Rectangle object ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 此 Rectangle 对 象 内 是 否 包 含 由 rect 参 数 指 定 的 Rectangle 对 象 。
* 如 果 一 个 Rectangle 对 象 完 全 在 另 一 个 Rectangle 的 边 界 内 , 我 们 说 第 二 个 Rectangle 包 含 第 一 个 Rectangle 。
* @param rect 所 检 查 的 Rectangle 对 象
* @returns 如 果 此 Rectangle 对 象 包 含 您 指 定 的 Rectangle 对 象 , 则 返 回 true 值 , 否 则 返 回 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
containsRect ( rect : egret.Rectangle ) : boolean ;
/ * *
* Determines whether the object specified in the toCompare parameter is equal to this Rectangle object .
* This method compares the x , y , width , and height properties of an object against the same properties of this Rectangle object .
* @param The rectangle to compare to this Rectangle object .
* @returns A value of true if the object has exactly the same values for the x , y , width , and height properties as this Rectangle object ; otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 确 定 在 toCompare 参 数 中 指 定 的 对 象 是 否 等 于 此 Rectangle 对 象 。
* 此 方 法 将 某 个 对 象 的 x 、 y 、 width 和 height 属 性 与 此 Rectangle 对 象 所 对 应 的 相 同 属 性 进 行 比 较 。
* @param toCompare 要 与 此 Rectangle 对 象 进 行 比 较 的 矩 形 。
* @returns 如 果 对 象 具 有 与 此 Rectangle 对 象 完 全 相 同 的 x 、 y 、 width 和 height 属 性 值 , 则 返 回 true 值 , 否 则 返 回 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
equals ( toCompare : Rectangle ) : boolean ;
/ * *
* Increases the size of the Rectangle object . This method is similar to the Rectangle . inflate ( ) method except it takes a Point object as a parameter .
* @param point 此 Point 对 象 的 x 属 性 用 于 增 加 Rectangle 对 象 的 水 平 尺 寸 。 y 属 性 用 于 增 加 Rectangle 对 象 的 垂 直 尺 寸 。
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 增 加 Rectangle 对 象 的 大 小 。 此 方 法 与 Rectangle . inflate ( ) 方 法 类 似 , 只 不 过 它 采 用 Point 对 象 作 为 参 数 。
* @param point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object . The y property is used to increase the vertical dimension of the Rectangle object .
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
inflatePoint ( point : Point ) : void ;
/ * *
* Adjusts the location of the Rectangle object , as determined by its top - left corner , by the specified amounts .
* @param dx Moves the x value of the Rectangle object by this amount .
* @param dy Moves the y value of the Rectangle object by this amount .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 按 指 定 量 调 整 Rectangle 对 象 的 位 置 ( 由 其 左 上 角 确 定 ) 。
* @param dx 将 Rectangle 对 象 的 x 值 移 动 此 数 量 。
* @param dy 将 Rectangle 对 象 的 t 值 移 动 此 数 量 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
offset ( dx : number , dy : number ) : void ;
/ * *
* Adjusts the location of the Rectangle object using a Point object as a parameter . This method is similar to the Rectangle . offset ( ) method , except that it takes a Point object as a parameter .
* @param point A Point object to use to offset this Rectangle object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 Point 对 象 用 作 参 数 来 调 整 Rectangle 对 象 的 位 置 。 此 方 法 与 Rectangle . offset ( ) 方 法 类 似 , 只 不 过 它 采 用 Point 对 象 作 为 参 数 。
* @param point 要 用 于 偏 移 此 Rectangle 对 象 的 Point 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
offsetPoint ( point : Point ) : void ;
/ * *
* Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object .
* @returns A string listing the value of each of the following properties of the Rectangle object : x , y , width , and height .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 生 成 并 返 回 一 个 字 符 串 , 该 字 符 串 列 出 Rectangle 对 象 的 水 平 位 置 和 垂 直 位 置 以 及 高 度 和 宽 度 。
* @returns 一 个 字 符 串 , 它 列 出 了 Rectangle 对 象 的 下 列 各 个 属 性 的 值 : x 、 y 、 width 和 height 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
toString ( ) : string ;
/ * *
* Adds two rectangles together to create a new Rectangle object , by filling in the horizontal and vertical space between the two rectangles .
* @param toUnion A Rectangle object to add to this Rectangle object .
* @returns A new Rectangle object that is the union of the two rectangles .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 通 过 填 充 两 个 矩 形 之 间 的 水 平 和 垂 直 空 间 , 将 这 两 个 矩 形 组 合 在 一 起 以 创 建 一 个 新 的 Rectangle 对 象 。
* @param toUnion 要 添 加 到 此 Rectangle 对 象 的 Rectangle 对 象 。
* @returns 充 当 两 个 矩 形 的 联 合 的 新 Rectangle 对 象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
union ( toUnion : Rectangle ) : Rectangle ;
/ * *
* @private
* /
$getBaseWidth ( angle : number ) : number ;
/ * *
* @private
* /
$getBaseHeight ( angle : number ) : number ;
}
/ * *
* @private
* 仅 供 框 架 内 复 用 , 要 防 止 暴 露 引 用 到 外 部 。
* /
let $TempRectangle : Rectangle ;
}
declare namespace egret {
}
declare namespace egret {
/ * *
* The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines .
* These constants are provided for use as values in the joints parameter of the egret . Graphics . lineStyle ( ) method .
* @see egret . Graphics # lineStyle ( )
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* JointStyle 类 是 指 定 要 在 绘 制 线 条 中 使 用 的 联 接 点 样 式 的 常 量 值 枚 举 。 提 供 的 这 些 常 量 用 作 egret . Graphics . lineStyle ( ) 方 法 的 joints 参 数 中 的 值 。
* @see egret . Graphics # lineStyle ( )
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
const JointStyle : {
BEVEL : string ;
MITER : string ;
ROUND : string ;
} ;
}
declare namespace egret {
}
/ * *
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / localStorage / localStorage . ts
* /
declare namespace egret . localStorage {
/ * *
* Read data
* @param key { string } Name of the key to be read
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 读 取 数 据
* @param key { string } 要 读 取 的 键 名 称
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let getItem : ( key : string ) = > string ;
/ * *
* Save data
* @param key { string } Name of the key to be saved
* @param value { string } Value to be saved
* @returns { boolean } Whether data is saved successfully
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 保 存 数 据
* @param key { string } 要 保 存 的 键 名 称
* @param value { string } 要 保 存 的 值
* @returns { boolean } 数 据 保 存 是 否 成 功
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let setItem : ( key : string , value : string ) = > boolean ;
/ * *
* Delete data
* @param key { string } Name of the key to be deleted
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 删 除 数 据
* @param key { string } 要 删 除 的 键 名 称
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let removeItem : ( key : string ) = > void ;
/ * *
* Clear all data
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 所 有 数 据 清 空
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let clear : ( ) = > void ;
}
declare namespace egret . sys {
/ * *
* @private
* @param channel
* /
function $pushSoundChannel ( channel : SoundChannel ) : void ;
/ * *
* @private
* @param channel
* /
function $popSoundChannel ( channel : SoundChannel ) : boolean ;
}
declare namespace egret {
/ * *
* The Sound class lets you work with sound in an application .
* The Sound class lets you create a Sound object , load and play an external audio file into that object .
* More detailed control of the sound is performed through the SoundChannel
*
* @event egret . Event . COMPLETE Dispatch when the audio resource is loaded and ready to play
* @event egret . IOErrorEvent . IO_ERROR Dispatch when the audio resource is failed to load
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / media / Sound . ts
* @language en_US
* /
/ * *
* Sound 允 许 您 在 应 用 程 序 中 使 用 声 音 。 使 用 Sound 类 可 以 创 建 Sound 对 象 、 将 外 部 音 频 文 件 加 载 到 该 对 象 并 播 放 该 文 件 。
* 可 通 过 SoundChannel 对 声 音 执 行 更 精 细 的 控 制 , 如 控 制 音 量 和 监 控 播 放 进 度 。
* @see http : //edn.egret.com/cn/docs/page/156 音频系统
*
* @event egret . Event . COMPLETE 音 频 加 载 完 成 时 抛 出
* @event egret . IOErrorEvent . IO_ERROR 音 频 加 载 失 败 时 抛 出
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / media / Sound . ts
* @language zh_CN
* /
interface Sound extends EventDispatcher {
/ * *
* Initiates loading of an external audio file from the specified URL .
* @param url Audio file URL
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 启 动 从 指 定 URL 加 载 外 部 音 频 文 件 的 过 程 。
* @param url 需 要 加 载 的 音 频 文 件 URL
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
load ( url : string ) : void ;
/ * *
* Generates a new SoundChannel object to play back the sound .
* @param startTime The initial position in seconds at which playback should start , ( default = 0 )
* @param loops Plays , the default value is 0 . Greater than 0 to the number of plays , such as 1 to play 1 , less than or equal to 0 , to loop .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 生 成 一 个 新 的 SoundChannel 对 象 来 播 放 该 声 音 。 此 方 法 返 回 SoundChannel 对 象 , 访 问 该 对 象 可 停 止 声 音 调 整 音 量 。
* @param startTime 应 开 始 播 放 的 初 始 位 置 ( 以 秒 为 单 位 ) , 默 认 值 是 0
* @param loops 播 放 次 数 , 默 认 值 是 0 , 循 环 播 放 。 大 于 0 为 播 放 次 数 , 如 1 为 播 放 1 次 ; 小 于 等 于 0 , 为 循 环 播 放 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
play ( startTime? : number , loops? : number ) : SoundChannel ;
/ * *
* Closes the stream , causing any download of data to cease
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 关 闭 该 流 , 从 而 停 止 所 有 数 据 的 下 载 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
close ( ) : void ;
/ * *
* Type , default is egret . Sound . EFFECT .
* In the native and runtime environment , while only play a background music , sound length so as not to be too long .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 类 型 , 默 认 为 egret . Sound . EFFECT 。
* 在 native 和 runtime 环 境 下 , 背 景 音 乐 同 时 只 能 播 放 一 个 , 音 效 长 度 尽 量 不 要 太 长 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
type : string ;
/ * *
* Length of the current sound ( in seconds ) .
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language en_US
* /
/ * *
* 当 前 声 音 的 长 度 ( 以 秒 为 单 位 ) 。
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language zh_CN
* /
length : number ;
}
/ * *
* @copy egret . Sound
* /
let Sound : {
/ * *
* Create Sound object , load an external audio file and play
* @param url Audio file URL , Sound will start to load the media if url is not empty
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 Sound 对 象 、 将 外 部 音 频 文 件 加 载 到 该 对 象 并 播 放 该 文 件
* @param url 需 要 加 载 的 音 频 文 件 URL , 如 果 指 定 了 url , Sound会立即开始加载指定的媒体文件
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
new ( ) : Sound ;
/ * *
* Background music
* @default "music"
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 背 景 音 乐
* @default "music"
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
MUSIC : string ;
/ * *
* EFFECT
* @default "effect"
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 音 效
* @default "effect"
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
EFFECT : string ;
} ;
}
declare namespace egret {
/ * *
* The SoundChannel class controls a sound in an application .
* Every sound is assigned to a sound channel , and the application
* can have multiple sound channels that are mixed together .
* The SoundChannel class contains a stop ( ) method , properties for
* set the volume of the channel
*
* @event egret . Event . SOUND_COMPLETE Dispatch when a sound has finished playing at last time
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / media / Sound . ts
* @language en_US
* /
/ * *
* SoundChannel 类 控 制 应 用 程 序 中 的 声 音 。 每 个 声 音 均 分 配 给 一 个 声 道 , 而 且 应 用 程 序 可 以 具 有 混 合 在 一 起 的 多 个 声 道 。
* SoundChannel 类 包 含 stop ( ) 方 法 、 用 于 设 置 音 量 和 监 视 播 放 进 度 的 属 性 。
*
* @event egret . Event . SOUND_COMPLETE 音 频 最 后 一 次 播 放 完 成 时 抛 出
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / media / Sound . ts
* @language zh_CN
* /
interface SoundChannel extends IEventDispatcher {
/ * *
* The volume , ranging from 0 ( silent ) to 1 ( full volume ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 音 量 范 围 从 0 ( 静 音 ) 至 1 ( 最 大 音 量 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
volume : number ;
/ * *
* When the sound is playing , the position property indicates
* in seconds the current point that is being played in the sound file .
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language en_US
* /
/ * *
* 当 播 放 声 音 时 , position 属 性 表 示 声 音 文 件 中 当 前 播 放 的 位 置 ( 以 秒 为 单 位 )
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language zh_CN
* /
position : number ;
/ * *
* Stops the sound playing in the channel .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 停 止 在 该 声 道 中 播 放 声 音 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
stop ( ) : void ;
}
}
declare namespace egret {
/ * *
* The Video class lets you work with video in an application .
* The Video class lets you create a Video object , load and play an external video file into that object .
* Note : On most mobile device , the video is playback in the full screen mode . < br / >
*
* @param url URL of the media to play , Video will start to load if the url is not empty
*
* @event egret . Event . COMPLETE Dispatch when the video resource is loaded and ready to play
* @event egret . Event . ENDED Dispatch when the video playback ended
* @event egret . IOErrorEvent . IO_ERROR when the video is failed to load
* @version Egret 2.4
* @platform Web
* @includeExample egret / media / Video . ts
* @language en_US
* /
/ * *
* Video 允 许 您 在 应 用 程 序 中 使 用 视 频 。 使 用 Video 类 可 以 创 建 Video 对 象 、 将 外 部 视 频 文 件 加 载 到 该 对 象 并 播 放 该 文 件 。 < br / >
* 注意 : 在大多数移动设备中 , 视 频 是 强 制 全 屏 播 放 的 , 所 以 你 可 以 直 接 调 用 play ( ) 方 法 全 屏 播 放 视 频 , 不 用 将 它 绘 制 在 Stage中 。
* @see http : //edn.egret.com/cn/docs/page/657 视频系统
*
* @param url 要 播 放 的 视 频 的 URL , 如 果 url不为空 , Video会立即加载这个视频
*
* @event egret . Event . COMPLETE 视 频 加 载 完 成 时 抛 出
* @event egret . Event . ENDED 视 频 播 放 完 成 时 抛 出
* @event egret . IOErrorEvent . IO_ERROR 视 频 加 载 失 败 时 触 发
* @version Egret 2.4
* @platform Web
* @includeExample egret / media / Video . ts
* @language zh_CN
* /
interface Video extends DisplayObject {
/ * *
* Initiates loading of an external video file from the specified URL .
* @param url Audio file URL
* * @param cache Should cache the video , only used in Native
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 启 动 从 指 定 URL 加 载 外 部 视 频 文 件 的 过 程 。
* @param url 需 要 加 载 的 视 频 文 件 URL
* @param cache 是 否 需 要 缓 存 到 本 地 , 只 在 Native 上 使 用
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
load ( url : string , cache? : boolean ) : void ;
/ * *
* Play back the video .
* @param startTime The initial position in seconds at which playback should start , ( default = 0 )
* @param loop Defines should play the video again when the video is ended . ( default = false )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 播 放 该 视 频
* @param startTime 应 开 始 播 放 的 初 始 位 置 ( 以 秒 为 单 位 ) , 默 认 值 是 视 频 上 次 结 束 的 位 置
* @param loop 是 否 需 要 循 环 播 放 , 默 认 值 是 false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
play ( startTime? : number , loop? : boolean ) : any ;
/ * *
* Closes the stream , causing any download of data to cease
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 关 闭 该 流 , 从 而 停 止 所 有 数 据 的 下 载 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
close ( ) : void ;
/ * *
* The URL of the video you want to play .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 想 要 播 放 的 视 频 的 URL
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
src : string ;
/ * *
* The URL of an image you want to display before the video is loaded or video cannot been draw on the canvas on some mobile device .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 视 频 加 载 前 , 或 者 在 不 支 持 将 video 画 在 canvas 的 设 备 上 , 想 要 显 示 的 视 频 截 图 地 址 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
poster : string ;
/ * *
* Should play the video in fullscreen mode ( default = true ) .
* Currently only supports full - screen mobile terminal web .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 全 屏 播 放 这 个 视 频 ( 默 认 值 是 true ) 。
* 目 前 移 动 端 web 只 支 持 全 屏 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
fullscreen : boolean ;
/ * *
* The volume , ranging from 0 ( silent ) to 1 ( full volume ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 音 量 范 围 从 0 ( 静 音 ) 至 1 ( 最 大 音 量 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
volume : number ;
/ * *
* When the video is playing , the position property indicates
* in seconds the current point that is being played in the video file .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 播 放 视 频 时 , position 属 性 表 示 视 频 文 件 中 当 前 播 放 的 位 置 ( 以 秒 为 单 位 )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
position : number ;
/ * *
* Pause the video playing .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 暂 停 播 放 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
pause ( ) : void ;
/ * *
* Get bitmapData of the video file , you can use the video as bitmapData on the stage .
* Note : On most mobile device , the video is playback in the full screen mode .
* So you can just use the play ( ) method instead of draw it on the Stage
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 获 取 视 频 的 bitmapData , 你 可 以 将 视 频 绘 制 到 舞 台 上 。
* 注 意 : 在 大 多 数 移 动 设 备 中 , 视 频 是 全 屏 播 放 的 , 所 以 你 可 以 直 接 调 用 play ( ) 方 法 全 屏 播 放 视 频 , 不 用 将 它 绘 制 在 Stage中 。
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
bitmapData? : BitmapData ;
/ * *
* Whether current video is paused .
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language en_US
* /
/ * *
* 当 前 视 频 是 否 在 暂 停 状 态 。
* @version Egret 2.4
* @platform Web , Native
* @readOnly
* @language zh_CN
* /
paused : boolean ;
/ * *
* Length of the current video ( in seconds ) .
* @version Egret 3.0 . 8
* @platform Web , Native
* @readOnly
* @language en_US
* /
/ * *
* 当 前 视 频 的 长 度 ( 以 秒 为 单 位 ) 。
* @version Egret 3.0 . 8
* @platform Web , Native
* @readOnly
* @language zh_CN
* /
length : number ;
}
/ * *
* @copy egret . Video
* /
let Video : {
new ( url? : string , cache? : boolean ) : Video ;
} ;
}
declare namespace egret {
/ * *
* The HttpMethod class provides values that specify whether the HttpRequest object should use the POST method
* or the GET method when sending data to a server .
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* HttpRequestMethod 类 提 供 了 一 些 值 , 这 些 值 可 指 定 在 将 数 据 发 送 到 服 务 器 时 ,
* HttpRequest 对 象 应 使 用 POST 方 法 还 是 GET 方 法 。
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
namespace HttpMethod {
/ * *
* Specifies that the HttpRequest object is a GET .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 HttpRequest 对 象 是 一 个 GET 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
const GET = "GET" ;
/ * *
* Specifies that the HttpRequest object is a POST .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 HttpRequest 对 象 是 一 个 POST 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
const POST = "POST" ;
}
}
declare namespace egret {
/ * *
* The HttpRequest class downloads data from a URL as text or binary data . It is useful for downloading text files ,
* XML , or other information to be used in a dynamic , data - driven application . A HttpRequest object downloads all
* of the data from a URL before making it available to code in the applications . It sends out notifications about
* the progress of the download , which you can monitor through the bytesLoaded and bytesTotal properties ,
* as well as through dispatched events .
* @event egret . Event . COMPLETE Dispatched when the net request is complete .
* @event egret . Event . IO_ERROR Dispatched when the net request is failed .
* @event egret . ProgressEvent . PROGRESS Dispatched when data is received as the download operation progresses .
* @see egret . HttpMethod
* @see egret . HttpResponseType
* @includeExample egret / net / HttpRequestExample . ts
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* HttpRequest 类 以 文 本 或 二 进 制 数 据 的 形 式 从 URL 下 载 数 据 。
* HttpRequest 对 象 会 先 从 URL 中 下 载 所 有 数 据 , 然 后 才 将 数 据 用 于 应 用 程 序 中 的 代 码 。 它 会 发 出 有 关 下 载 进 度 的 通 知 ,
* 通 过 bytesLoaded 和 bytesTotal 属 性 以 及 已 调 度 的 事 件 , 可 以 监 视 下 载 进 度 。
* @event egret . Event . COMPLETE 加 载 完 成
* @event egret . Event . IO_ERROR 加 载 失 败
* @event egret . ProgressEvent . PROGRESS 加 载 进 度 , 可 通 过 event . bytesLoaded和event . bytesTotal统计进度信息 。
* @see egret . HttpMethod
* @see egret . HttpResponseType
* @includeExample egret / net / HttpRequestExample . ts
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface HttpRequest extends EventDispatcher {
/ * *
* The data received from the load operation . The format of the data depends on the setting of the responseType property .
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 本 次 请 求 返 回 的 数 据 , 数 据 类 型 根 据 responseType 设 置 的 值 确 定 。
* @readOnly
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
response : any ;
/ * *
* Controls whether the downloaded data is received as text ( HttpResponseType . TEXT ) or raw binary data ( HttpResponseType . ArrayBuffer ) < br / >
* Note :If you attempt to set this property to an invalid value , Egret runtime set the value to HttpResponseType . TEXT .
* @default egret . HttpResponseType . TEXT
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 返 回 的 数 据 格 式 为 文 本 ( HttpResponseType . TEXT ) 还 是 二 进 制 数 据 ( HttpResponseType . ArrayBuffer ) < br / >
* 注 意 : 若 尝 试 设 置 此 属 性 为 一 个 非 法 的 值 , 运 行 时 将 使 用 HttpResponseType . TEXT 。
* @default egret . HttpResponseType . TEXT
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
responseType : string ;
/ * *
* Can be set to a time in milliseconds . When set to a non - zero value will cause fetching to terminate after the given time has passed .
* @default egret . HttpResponseType . TEXT
* @version Egret 5.2 . 15
* @platform Web , Native
* @language en_US
* /
/ * *
* 代 表 着 一 个 请 求 在 被 自 动 终 止 前 所 消 耗 的 毫 秒 数 。 默 认 值 为 0 , 意 味 着 没 有 超 时 。
* @default egret . HttpResponseType . TEXT
* @version Egret 5.2 . 15
* @platform Web , Native
* @language zh_CN
* /
timeout : number ;
/ * *
* indicates whether or not cross - site Access - Control requests should be made using credentials such as cookies
* or authorization headers . ( This never affects same - site requests . )
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 明 在 进 行 跨 站 ( cross - site ) 的 访 问 控 制 ( Access - Control ) 请 求 时 , 是 否 使 用 认 证 信 息 ( 例 如 cookie或授权的header ) 。 ( 这 个 标 志 不 会 影 响 同 站 的 请 求 )
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
withCredentials : boolean ;
/ * *
* Initializes a request . < br / >
* Note : Calling this method for an already active request ( one for which open ( ) or openRequest ( ) has already been
* called ) is the equivalent of calling abort ( ) .
* @param url The URL to send the request to .
* @param method The HTTP method to use , please use the const value in the HttpMethod class .
* @see egret . HttpMethod
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 初 始 化 一 个 请 求 . < br / >
* 注意 : 若在已经发出请求的对象上调用此方法 , 相 当 于 立 即 调 用 abort ( ) .
* @param url 该 请 求 所 要 访 问 的 URL该请求所要访问的URL
* @param method 请 求 所 使 用 的 HTTP方法 , 请 使 用 HttpMethod 定 义 的 枚 举 值 .
* @see egret . HttpMethod
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
open ( url : string , method? : string ) : void ;
/ * *
* Sends the request .
* @param data the data to send .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 发 送 请 求 .
* @param data 需 要 发 送 的 数 据
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
send ( data? : any ) : void ;
/ * *
* Aborts the request if it has already been sent .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 请 求 已 经 被 发 送 , 则 立 刻 中 止 请 求 .
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
abort ( ) : void ;
/ * *
* Returns all the response headers as a string , or null if no response has been received .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 所 有 响 应 头 信 息 ( 响 应 头 名 和 值 ) , 如 果 响 应 头 还 没 接 受 , 则 返 回 "" .
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getAllResponseHeaders ( ) : string ;
/ * *
* Sets the value of an HTTP request header . You must call setRequestHeader ( ) after open ( ) .
* @param header The name of the header whose value is to be set .
* @param value The value to set as the body of the header .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 给 指 定 的 HTTP请求头赋值 . 在 这 之 前 , 您 必 须 确 认 已 经 调 用 open ( ) 方 法 打 开 了 一 个 url .
* @param header 将 要 被 赋 值 的 请 求 头 名 称 .
* @param value 给 指 定 的 请 求 头 赋 的 值 .
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
setRequestHeader ( header : string , value : string ) : void ;
/ * *
* Returns the string containing the text of the specified header , or null if either the response has not yet been
* received or the header doesn ' t exist in the response .
* @param header The name of the header whose value is to be get .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 指 定 的 响 应 头 的 值 , 如 果 响 应 头 还 没 被 接 受 , 或 该 响 应 头 不 存 在 , 则 返 回 "" .
* @param header 要 返 回 的 响 应 头 名 称
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getResponseHeader ( header : string ) : string ;
}
/ * *
* Creates a HttpRequest object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 HttpRequest 实 例 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let HttpRequest : {
new ( ) : HttpRequest ;
} ;
}
declare namespace egret {
/ * *
* The HttpResponseType class provides values that specify how downloaded data is received .
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* URLLoaderDataFormat 类 提 供 了 一 些 用 于 指 定 如 何 接 收 已 下 载 数 据 的 值 。
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class HttpResponseType {
/ * *
* Specifies that downloaded data is received as text . This is the default value of HttpRequest . responseType
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 字 符 串 。 HttpRequest . responseType属性的默认值 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TEXT : string ;
/ * *
* Specifies that downloaded data is received as raw binary data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 返 回 二 进 制 的 ArrayBuffer对象 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ARRAY_BUFFER : string ;
}
}
declare namespace egret {
/ * *
* The Loader class is used to load image ( JPG , PNG , or GIF ) files . Use the load ( ) method to initiate loading .
* The loaded image data is in the data property of ImageLoader .
* @event egret . Event . COMPLETE Dispatched when the net request is complete .
* @event egret . IOErrorEvent . IO_ERROR Dispatched when the net request is failed .
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / net / ImageLoaderExample . ts
* @see http : //edn.egret.com/cn/docs/page/590 加载位图文件
* @language en_US
* /
/ * *
* ImageLoader 类 可 用 于 加 载 图 像 ( JPG 、 PNG 或 GIF ) 文 件 。 使 用 load ( ) 方 法 来 启 动 加 载 。 被 加 载 的 图 像 对 象 数 据 将 存 储 在 ImageLoader . data 属 性 上 。
* @event egret . Event . COMPLETE 加 载 完 成
* @event egret . IOErrorEvent . IO_ERROR 加 载 失 败
* @see egret . HttpRequest
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / net / ImageLoaderExample . ts
* @see http : //edn.egret.com/cn/docs/page/590 加载位图文件
* @language zh_CN
* /
interface ImageLoader extends EventDispatcher {
/ * *
* The data received from the load operation .
* @default null
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 load ( ) 方 法 加 载 成 功 的 BitmapData 图 像 数 据 。
* @default null
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
data : BitmapData ;
/ * *
* Specifies whether or not cross - site Access - Control requests should be made when loading a image from foreign origins . < br / >
* possible values are : "anonymous" , "use-credentials" or null .
* @default null
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 从 其 他 站 点 加 载 一 个 图 片 时 , 指 定 是 否 启 用 跨 域 资 源 共 享 ( CORS ) , 默 认 值 为 null 。 < br / >
* 可 以 设 置 为 "anonymous" , "use-credentials" 或 null , 设 置 为 其 他 值 将 等 同 于 "anonymous" 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
crossOrigin : string ;
/ * *
* start a load operation 。 < br / >
* Note : Calling this method for an already active request ( one for which load ( ) has already been
* called ) will abort the last load operation immediately .
* @param url 要 加 载 的 图 像 文 件 的 地 址 。
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 启 动 一 次 图 像 加 载 。 < br / >
* 注 意 : 若 之 前 已 经 调 用 过 加 载 请 求 , 重 新 调 用 load ( ) 将 终 止 先 前 的 请 求 , 并 开 始 新 的 加 载 。
* @param url 要 加 载 的 图 像 文 件 的 地 址 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
load ( url : string ) : void ;
}
/ * *
* Creates a ImageLoader object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 ImageLoader 实 例
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let ImageLoader : {
/ * *
* constructor
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 构 造 函 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
new ( ) : ImageLoader ;
/ * *
* Specifies whether to enable cross - origin resource sharing , If ImageLoader instance has been set crossOrigin property will be used to set the property .
* @version Egret 2.5 . 7
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 定 是 否 启 用 跨 域 资 源 共 享 , 如 果 ImageLoader实例有设置过crossOrigin属性将使用设置的属性
* @version Egret 2.5 . 7
* @platform Web , Native
* @language zh_CN
* /
crossOrigin : string ;
} ;
}
declare namespace egret . sys {
/ * *
* @private
* 显 示 列 表
* /
class DisplayList extends HashObject {
/ * *
* 创 建 一 个 DisplayList对象 , 若 内 存 不 足 或 无 法 创 建 RenderBuffer , 将 会 返 回 null 。
* /
static create ( target : DisplayObject ) : DisplayList ;
/ * *
* @private
* 创 建 一 个 DisplayList对象
* /
constructor ( root : DisplayObject ) ;
private isStage ;
/ * *
* 位 图 渲 染 节 点
* /
$renderNode : RenderNode ;
/ * *
* @private
* 获 取 渲 染 节 点
* /
$getRenderNode ( ) : sys . RenderNode ;
/ * *
* @private
* /
renderBuffer : RenderBuffer ;
/ * *
* @private
* /
offsetX : number ;
/ * *
* @private
* /
offsetY : number ;
/ * *
* @private
* /
private offsetMatrix ;
/ * *
* @private
* 显 示 列 表 根 节 点
* /
root : DisplayObject ;
/ * *
* @private
* 设 置 剪 裁 边 界 , 不 再 绘 制 完 整 目 标 对 象 , 画 布 尺 寸 由 外 部 决 定 , 超 过 边 界 的 节 点 将 跳 过 绘 制 。
* /
setClipRect ( width : number , height : number ) : void ;
$canvasScaleX : number ;
$canvasScaleY : number ;
/ * *
* @private
* 绘 制 根 节 点 显 示 对 象 到 目 标 画 布 , 返 回 draw的次数 。
* /
drawToSurface ( ) : number ;
private bitmapData ;
/ * *
* @private
* 改 变 画 布 的 尺 寸 , 由 于 画 布 尺 寸 修 改 会 清 空 原 始 画 布 。 所 以 这 里 将 原 始 画 布 绘 制 到 一 个 新 画 布 上 , 再 与 原 始 画 布 交 换 。
* /
changeSurfaceSize ( ) : void ;
static $canvasScaleFactor : number ;
/ * *
* @private
* /
static $canvasScaleX : number ;
static $canvasScaleY : number ;
/ * *
* @private
* /
static $setCanvasScale ( x : number , y : number ) : void ;
}
}
declare namespace egret {
type runEgretOptions = {
renderMode? : string ;
audioType? : number ;
screenAdapter? : sys.IScreenAdapter ;
antialias? : boolean ;
canvasScaleFactor? : number ;
calculateCanvasScaleFactor ? : ( context : CanvasRenderingContext2D ) = > number ;
/ * *
* 以 下 目 前 仅 供 小 游 戏 使 用
* The following are for mini - games only
* /
entryClassName? : string ;
scaleMode? : string ;
frameRate? : number ;
contentWidth? : number ;
contentHeight? : number ;
orientation? : string ;
maxTouches? : number ;
showFPS? : boolean ;
showLog? : boolean ;
fpsStyles? : string ;
} ;
/ * *
* egret project entry function
* @param options An object containing the initialization properties for egret engine .
* @language en_US
* /
/ * *
* egret工程入口函数
* @param options 一 个 可 选 对 象 , 包 含 初 始 化 Egret引擎需要的参数 。
* @language zh_CN
* /
function runEgret ( options? : runEgretOptions ) : void ;
/ * *
* Refresh the screen display
* @language en_US
* /
/ * *
* 刷 新 屏 幕 显 示
* @language zh_CN
* /
function updateAllScreens ( ) : void ;
}
declare namespace egret {
/ * *
* @private
* /
interface FPSDisplay {
/ * *
* 更 新 FPS信息
* /
update ( datas : FPSData ) : void ;
/ * *
* 插 入 一 条 log信息
* /
updateInfo ( info : string ) : void ;
/ * *
* 插 入 一 条 warn信息
* /
updateWarn ( info : string ) : void ;
/ * *
* 插 入 一 条 error信息
* /
updateError ( info : string ) : void ;
}
/ * *
* @private
* /
let FPSDisplay : {
new ( stage : Stage , showFPS : boolean , showLog : boolean , logFilter : string , styles : Object ) : FPSDisplay ;
} ;
}
/ * *
* @private
* /
interface FPSData extends Object {
fps : number ;
draw : number ;
costTicker : number ;
costRender : number ;
}
declare namespace egret . sys {
let $TempStage : egret.Stage ;
/ * *
* @private
* Egret播放器
* /
class Player extends HashObject {
/ * *
* @private
* 实 例 化 一 个 播 放 器 对 象 。
* /
constructor ( buffer : RenderBuffer , stage : Stage , entryClassName : string ) ;
/ * *
* @private
* /
private createDisplayList ( stage , buffer ) ;
/ * *
* @private
* /
private screenDisplayList ;
/ * *
* @private
* 入 口 类 的 完 整 类 名
* /
private entryClassName ;
/ * *
* @private
* 舞 台 引 用
* /
stage : Stage ;
/ * *
* @private
* 入 口 类 实 例
* /
private root ;
/ * *
* @private
* /
private isPlaying ;
/ * *
* @private
* 启 动 播 放 器
* /
start ( ) : void ;
/ * *
* @private
* /
private initialize ( ) ;
/ * *
* @private
* 停 止 播 放 器 , 停 止 后 将 不 能 重 新 启 动 。
* /
stop ( ) : void ;
/ * *
* @private
* 暂 停 播 放 器 , 后 续 可 以 通 过 调 用 start ( ) 重 新 启 动 播 放 器 。
* /
pause ( ) : void ;
/ * *
* @private
* 渲 染 屏 幕
* /
$render ( triggerByFrame : boolean , costTicker : number ) : void ;
/ * *
* @private
* 更 新 舞 台 尺 寸
* @param stageWidth 舞 台 宽 度 ( 以 像 素 为 单 位 )
* @param stageHeight 舞 台 高 度 ( 以 像 素 为 单 位 )
* /
updateStageSize ( stageWidth : number , stageHeight : number ) : void ;
/ * *
* @private
* 显 示 FPS 。
* /
displayFPS ( showFPS : boolean , showLog : boolean , logFilter : string , styles : Object ) : void ;
/ * *
* @private
* /
private showFPS ;
/ * *
* @private
* /
private showLog ;
/ * *
* @private
* /
private stageDisplayList ;
}
/ * *
* @private
* /
let $logToFPS : ( info : string ) = > void ;
/ * *
* @private
* /
let $warnToFPS : ( info : string ) = > void ;
/ * *
* @private
* /
let $errorToFPS : ( info : string ) = > void ;
}
/ * *
* @private
* /
declare module egret {
/ * *
* @private
* /
var nativeRender : boolean ;
}
declare namespace egret {
/ * * ! ! ! ! ! ! ! ! i n s p i r e d b y B a b y l o n . j s ! ! ! ! ! ! ! ! ! ! ! ! !
* for description see https : //www.khronos.org/opengles/sdk/tools/KTX/
* for file layout see https : //www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
* Current families are astc , dxt , pvrtc , etc2 , & etc1 .
* @returns The extension selected .
* /
class KTXContainer {
/** contents of the KTX container file */ arrayBuffer : any ;
private static readonly HEADER_LEN ;
private static readonly COMPRESSED_2D ;
private static readonly COMPRESSED_3D ;
private static readonly TEX_2D ;
private static readonly TEX_3D ;
/ * *
* Gets the openGL type
* /
glType : number ;
/ * *
* Gets the openGL type size
* /
glTypeSize : number ;
/ * *
* Gets the openGL format
* /
glFormat : number ;
/ * *
* Gets the openGL internal format
* /
glInternalFormat : number ;
/ * *
* Gets the base internal format
* /
glBaseInternalFormat : number ;
/ * *
* Gets image width in pixel
* /
pixelWidth : number ;
/ * *
* Gets image height in pixel
* /
pixelHeight : number ;
/ * *
* Gets image depth in pixels
* /
pixelDepth : number ;
/ * *
* Gets the number of array elements
* /
numberOfArrayElements : number ;
/ * *
* Gets the number of faces
* /
numberOfFaces : number ;
/ * *
* Gets the number of mipmap levels
* /
numberOfMipmapLevels : number ;
/ * *
* Gets the bytes of key value data
* /
bytesOfKeyValueData : number ;
/ * *
* Gets the load type
* /
loadType : number ;
/ * *
* If the container has been made invalid ( eg . constructor failed to correctly load array buffer )
* /
isInvalid : boolean ;
/ * *
* Creates a new KhronosTextureContainer
* @param arrayBuffer contents of the KTX container file
* @param facesExpected should be either 1 or 6 , based whether a cube texture or or
* @param threeDExpected provision for indicating that data should be a 3 D texture , not implemented
* @param textureArrayExpected provision for indicating that data should be a texture array , not implemented
* /
constructor ( /** contents of the KTX container file */ arrayBuffer : any , facesExpected : number , threeDExpected? : boolean , textureArrayExpected? : boolean ) ;
/ * *
* Uploads KTX content to a Babylon Texture .
* It is assumed that the texture has already been created & is currently bound
* @hidden
* /
uploadLevels ( bitmapData : egret.BitmapData , loadMipmaps : boolean ) : void ;
private _upload2DCompressedLevels ( bitmapData , loadMipmaps ) ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 共 享 的 用 于 碰 撞 检 测 的 渲 染 缓 冲
* /
let customHitTestBuffer : sys.RenderBuffer ;
/ * *
* @private
* 共 享 的 用 于 canvas碰撞检测的渲染缓冲
* /
let canvasHitTestBuffer : sys.RenderBuffer ;
/ * *
* @private
* 渲 染 缓 冲
* /
interface RenderBuffer {
/ * *
* 呈 现 最 终 绘 图 结 果 的 画 布 。
* @readOnly
* /
surface : any ;
/ * *
* 渲 染 上 下 文 。
* @readOnly
* /
context : any ;
/ * *
* 渲 染 缓 冲 的 宽 度 , 以 像 素 为 单 位 。
* @readOnly
* /
width : number ;
/ * *
* 渲 染 缓 冲 的 高 度 , 以 像 素 为 单 位 。
* @readOnly
* /
height : number ;
/ * *
* 改 变 渲 染 缓 冲 的 大 小 并 清 空 缓 冲 区
* @param width 改 变 后 的 宽
* @param height 改 变 后 的 高
* @param useMaxSize 若 传 入 true , 则 将 改 变 后 的 尺 寸 与 已 有 尺 寸 对 比 , 保 留 较 大 的 尺 寸 。
* /
resize ( width : number , height : number , useMaxSize? : boolean ) : void ;
/ * *
* 获 取 指 定 区 域 的 像 素
* /
getPixels ( x : number , y : number , width? : number , height? : number ) : number [ ] ;
/ * *
* 转 换 成 base64字符串 , 如 果 图 片 ( 或 者 包 含 的 图 片 ) 跨 域 , 则 返 回 null
* @param type 转 换 的 类 型 , 如 : "image/png" , "image/jpeg"
* /
toDataURL ( type ? : string , . . . args : any [ ] ) : string ;
/ * *
* 清 空 缓 冲 区 数 据
* /
clear ( ) : void ;
/ * *
* 销 毁 渲 染 缓 冲
* /
destroy ( ) : void ;
}
/ * *
* @private
* /
let RenderBuffer : {
/ * *
* 创 建 一 个 RenderTarget 。
* 注 意 : 若 内 存 不 足 或 创 建 缓 冲 区 失 败 , 将 会 抛 出 错 误 异 常 。
* @param width 渲 染 缓 冲 的 初 始 宽
* @param height 渲 染 缓 冲 的 初 始 高
* @param root 是 否 为 舞 台 buffer
* /
new ( width? : number , height? : number , root? : boolean ) : RenderBuffer ;
} ;
/ * *
* @private
* /
let CanvasRenderBuffer : {
/ * *
* 创 建 一 个 CanvasRenderBuffer 。
* 注 意 : 若 内 存 不 足 或 创 建 缓 冲 区 失 败 , 将 会 抛 出 错 误 异 常 。
* @param width 渲 染 缓 冲 的 初 始 宽
* @param height 渲 染 缓 冲 的 初 始 高
* /
new ( width? : number , height? : number ) : RenderBuffer ;
} ;
}
declare namespace egret . sys {
/ * *
* @private
* 设 备 屏 幕
* /
interface Screen {
/ * *
* @private
* 更 新 屏 幕 视 口 尺 寸
* /
updateScreenSize ( ) : any ;
/ * *
* @private
* 更 新 触 摸 数 量
* /
updateMaxTouches ( ) : any ;
/ * *
* @private
* 设 置 分 辨 率 尺 寸
* /
setContentSize ( width : number , height : number ) : any ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 屏 幕 适 配 器 接 口 , 当 播 放 器 视 口 尺 寸 改 变 时 , 屏 幕 适 配 器 将 被 用 于 计 算 当 前 对 应 的 舞 台 显 示 尺 寸 。
* /
interface IScreenAdapter {
/ * *
* @private
* 计 算 舞 台 显 示 尺 寸
* @param scaleMode 当 前 的 缩 放 模 式
* @param screenWidth 播 放 器 视 口 宽 度
* @param screenHeight 播 放 器 视 口 高 度
* @param contentWidth 初 始 化 内 容 宽 度
* @param contentHeight 初 始 化 内 容 高 度
* /
calculateStageSize ( scaleMode : string , screenWidth : number , screenHeight : number , contentWidth : number , contentHeight : number ) : StageDisplaySize ;
}
/ * *
* @private
* 舞 台 显 示 尺 寸 数 据
* /
interface StageDisplaySize {
/ * *
* @private
* 舞 台 宽 度
* /
stageWidth : number ;
/ * *
* @private
* 舞 台 高 度
* /
stageHeight : number ;
/ * *
* @private
* 显 示 宽 度 , 若 跟 舞 台 宽 度 不 同 , 将 会 产 生 缩 放 。
* /
displayWidth : number ;
/ * *
* @private
* 显 示 高 度 , 若 跟 舞 台 高 度 不 同 , 将 会 产 生 缩 放 。
* /
displayHeight : number ;
}
/ * *
* @private
* 屏 幕 适 配 器 实 例 , 开 发 者 可 以 通 过 给 这 个 变 量 赋 值 实 现 了 IScreenAdapter接口的实例 , 从 而 注 入 自 定 义 的 屏 幕 适 配 器 。
* /
let screenAdapter : IScreenAdapter ;
/ * *
* @private
* 屏 幕 适 配 器 默 认 实 现 , 开 发 者 可 以 实 现 自 定 义 规 则 的 屏 幕 适 配 器 。 并 在 初 始 化 加 载 时 将 适 配 器 的 实 例 赋 值 给 egret . sys . screenAdapter上 , 从 而 替 换 掉 默 认 适 配 器 。
* /
class DefaultScreenAdapter extends HashObject implements IScreenAdapter {
/ * *
* @private
* /
constructor ( ) ;
/ * *
* @private
* 计 算 舞 台 显 示 尺 寸
* @param scaleMode 当 前 的 缩 放 模 式
* @param screenWidth 播 放 器 视 口 宽 度
* @param screenHeight 播 放 器 视 口 高 度
* @param contentWidth 初 始 化 内 容 宽 度
* @param contentHeight 初 始 化 内 容 高 度
* /
calculateStageSize ( scaleMode : string , screenWidth : number , screenHeight : number , contentWidth : number , contentHeight : number ) : StageDisplaySize ;
}
}
declare namespace egret {
/ * *
* StageScaleMode class provides values for the stage zoom mode .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / player / StageScaleMode . ts
* @language en_US
* /
/ * *
* StageScaleMode 类 为 舞 台 缩 放 模 式 提 供 值 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / player / StageScaleMode . ts
* @language zh_CN
* /
class StageScaleMode {
/ * *
* Do not scale application content . Even when you change the player viewport size , it remains unchanged . If the player is smaller than the viewport content , possibly with some cropping . < br / >
* In this mode , the stage size ( Stage . stageWidth , Stage . stageHeight ) always with the player viewport size consistent .
* @language en_US
* /
/ * *
* 不 缩 放 应 用 程 序 内 容 。 即 使 在 更 改 播 放 器 视 口 大 小 时 , 它 仍 然 保 持 不 变 。 如 果 播 放 器 视 口 比 内 容 小 , 则 可 能 进 行 一 些 裁 切 。 < br / >
* 在 此 模 式 下 , 舞 台 尺 寸 ( Stage . stageWidth , Stage . stageHeight ) 始 终 跟 播 放 器 视 口 大 小 保 持 一 致 。
* @language zh_CN
* /
static NO_SCALE : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling a wide directions application content to fill the viewport players on both sides in the other direction may not be wide enough and left black bars . < br / >
* In this mode , the stage size ( Stage . stageWidth , Stage . stageHeight ) is always equal to the initialization incoming external application content size .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 的 较 宽 方 向 填 满 播 放 器 视 口 , 另 一 个 方 向 的 两 侧 可 能 会 不 够 宽 而 留 有 黑 边 。 < br / >
* 在 此 模 式 下 , 舞 台 尺 寸 ( Stage . stageWidth , Stage . stageHeight ) 始 终 等 于 初 始 化 时 外 部 传 入 的 应 用 程 序 内 容 尺 寸 。
* @language zh_CN
* /
static SHOW_ALL : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut . < br / >
* In this mode , the stage size ( Stage . stageWidth , Stage . stageHeight ) is always equal to the initialization incoming external application content size .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 的 较 窄 方 向 填 满 播 放 器 视 口 , 另 一 个 方 向 的 两 侧 可 能 会 超 出 播 放 器 视 口 而 被 裁 切 。 < br / >
* 在 此 模 式 下 , 舞 台 尺 寸 ( Stage . stageWidth , Stage . stageHeight ) 始 终 等 于 初 始 化 时 外 部 传 入 的 应 用 程 序 内 容 尺 寸 。
* @language zh_CN
* /
static NO_BORDER : string ;
/ * *
* Do not keep the original aspect ratio scaling application content , after scaling application content just fill the player viewport . < br / >
* In this mode , the stage size ( Stage . stageWidth , Stage . stageHeight ) is always equal to the initialization incoming external application content size .
* @language en_US
* /
/ * *
* 不 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 正 好 填 满 播 放 器 视 口 。 < br / >
* 在 此 模 式 下 , 舞 台 尺 寸 ( Stage . stageWidth , Stage . stageHeight ) 始 终 等 于 初 始 化 时 外 部 传 入 的 应 用 程 序 内 容 尺 寸 。
* @language zh_CN
* /
static EXACT_FIT : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , but only to keep the contents of the original application constant width , height may change . < br / >
* In this mode , the stage width ( Stage . stageWidth ) is always equal to initialize external incoming application content width . Stage height ( Stage . stageHeight ) by the current scale with the player viewport height decision .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 但 只 保 持 应 用 程 序 内 容 的 原 始 宽 度 不 变 , 高 度 可 能 会 改 变 。 < br / >
* 在 此 模 式 下 , 舞 台 宽 度 ( Stage . stageWidth ) 始 终 等 于 初 始 化 时 外 部 传 入 的 应 用 程 序 内 容 宽 度 。 舞 台 高 度 ( Stage . stageHeight ) 由 当 前 的 缩 放 比 例 与 播 放 器 视 口 高 度 决 定 。
* @language zh_CN
* /
static FIXED_WIDTH : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , but only to keep the contents of the original application constant height , width may change . < br / >
* In this mode , the stage height ( Stage . stageHeight ) is always equal to initialize external incoming application content height . Stage width ( Stage . stageWidth ) by the current scale with the player viewport width decision .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 但 只 保 持 应 用 程 序 内 容 的 原 始 高 度 不 变 , 宽 度 可 能 会 改 变 。 < br / >
* 在 此 模 式 下 , 舞 台 高 度 ( Stage . stageHeight ) 始 终 等 于 初 始 化 时 外 部 传 入 的 应 用 程 序 内 容 高 度 。 舞 台 宽 度 ( Stage . stageWidth ) 由 当 前 的 缩 放 比 例 与 播 放 器 视 口 宽 度 决 定 。
* @language zh_CN
* /
static FIXED_HEIGHT : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , a narrow direction may not be wide enough and fill . < br / >
* In this mode , the stage height ( Stage . stageHeight ) and the stage width ( Stage . stageWidth ) by the current scale with the player viewport size .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 应 用 程 序 内 容 的 较 窄 方 向 可 能 会 不 够 宽 而 填 充 。 < br / >
* 在 此 模 式 下 , 舞 台 高 度 ( Stage . stageHeight ) 和 舞 台 宽 度 ( Stage . stageWidth ) 由 当 前 的 缩 放 比 例 与 播 放 器 视 口 宽 高 决 定 。
* @language zh_CN
* /
static FIXED_NARROW : string ;
/ * *
* Keep the original aspect ratio scaling application content , after scaling application content in the horizontal and vertical directions to fill the viewport player , a wide direction may exceed the viewport and the player is cut . < br / >
* In this mode , the stage height ( Stage . stageHeight ) and the stage width ( Stage . stageWidth ) by the current scale with the player viewport size .
* @language en_US
* /
/ * *
* 保 持 原 始 宽 高 比 缩 放 应 用 程 序 内 容 , 缩 放 后 应 用 程 序 内 容 在 水 平 和 垂 直 方 向 都 填 满 播 放 器 视 口 , 应 用 程 序 内 容 的 较 宽 方 向 的 两 侧 可 能 会 超 出 播 放 器 视 口 而 被 裁 切 。 < br / >
* 在 此 模 式 下 , 舞 台 高 度 ( Stage . stageHeight ) 和 舞 台 宽 度 ( Stage . stageWidth ) 由 当 前 的 缩 放 比 例 与 播 放 器 视 口 宽 高 决 定 。
* @language zh_CN
* /
static FIXED_WIDE : string ;
}
}
declare namespace egret . sys {
/ * *
* @private
* /
let systemRenderer : SystemRenderer ;
/ * *
* @private
* 用 于 碰 撞 检 测 绘 制
* /
let canvasRenderer : SystemRenderer ;
/ * *
* @private
* 显 示 渲 染 器 接 口
* /
interface SystemRenderer {
/ * *
* 渲 染 一 个 显 示 对 象
* @param displayObject 要 渲 染 的 显 示 对 象
* @param buffer 渲 染 缓 冲
* @param matrix 要 叠 加 的 矩 阵
* @param forRenderTexture 绘 制 目 标 是 RenderTexture的标志
* @returns drawCall触发绘制的次数
* /
render ( displayObject : DisplayObject , buffer : RenderBuffer , matrix : Matrix , forRenderTexture? : boolean ) : number ;
/ * *
* 将 一 个 RenderNode对象绘制到渲染缓冲
* @param node 要 绘 制 的 节 点
* @param buffer 渲 染 缓 冲
* @param matrix 要 叠 加 的 矩 阵
* @param forHitTest 绘 制 结 果 是 用 于 碰 撞 检 测 。 若 为 true , 当 渲 染 GraphicsNode时 , 会 忽 略 透 明 度 样 式 设 置 , 全 都 绘 制 为 不 透 明 的 。
* /
drawNodeToBuffer ( node : sys.RenderNode , buffer : RenderBuffer , matrix : Matrix , forHitTest? : boolean ) : void ;
}
/ * *
*
* /
interface RenderContext {
}
/ * *
* 创 建 一 个 canvas 。
* /
function mainCanvas ( width? : number , height? : number ) : HTMLCanvasElement ;
function createCanvas ( width? : number , height? : number ) : HTMLCanvasElement ;
/ * *
* 重 新 设 置 主 canvas的大小
* /
function resizeContext ( renderContext : RenderContext , width : number , height : number , useMaxSize? : boolean ) : void ;
/ * *
* 获 得 系 统 的 渲 染 运 行 时
* /
function getContextWebGL ( surface : HTMLCanvasElement ) : WebGLRenderingContext ;
function getContext2d ( surface : HTMLCanvasElement ) : CanvasRenderingContext2D ;
/ * *
* 仅 通 过 bitmapData创建纹理
* /
function createTexture ( renderContext : RenderContext , bitmapData : BitmapData | HTMLCanvasElement ) : WebGLTexture ;
/ * *
* 通 过 width , height , data创建纹理
* /
function _createTexture ( renderContext : RenderContext , width : number , height : number , data : any ) : WebGLTexture ;
/ * *
* 画 texture
* * /
function drawTextureElements ( renderContext : RenderContext , data : any , offset : number ) : number ;
/ * *
* 测 量 文 本 的 宽 度
* @param context
* @param text
* /
function measureTextWith ( context : CanvasRenderingContext2D , text : string ) : number ;
/ * *
* 为 CanvasRenderBuffer创建一个canvas
* @param defaultFunc
* @param width
* @param height
* @param root
* /
function createCanvasRenderBufferSurface ( defaultFunc : ( width? : number , height? : number ) = > HTMLCanvasElement , width? : number , height? : number , root? : boolean ) : HTMLCanvasElement ;
/ * *
* 改 变 渲 染 缓 冲 的 大 小 并 清 空 缓 冲 区
* @param renderContext
* @param width
* @param height
* @param useMaxSize
* /
function resizeCanvasRenderBuffer ( renderContext : RenderContext , width : number , height : number , useMaxSize? : boolean ) : void ;
}
declare namespace egret . sys {
/ * *
* @private
* /
let $START_TIME : number ;
/ * *
* @private
* 是 否 要 广 播 Event . RENDER事件的标志 。
* /
let $invalidateRenderFlag : boolean ;
/ * *
* @private
* 需 要 立 即 刷 新 屏 幕 的 标 志
* /
let $requestRenderingFlag : boolean ;
/ * *
* Egret心跳计时器
* /
class SystemTicker {
/ * *
* @private
* /
constructor ( ) ;
/ * *
* @private
* /
private playerList ;
/ * *
* @private
* 注 册 一 个 播 放 器 实 例 并 运 行
* /
$addPlayer ( player : Player ) : void ;
/ * *
* @private
* 停 止 一 个 播 放 器 实 例 的 运 行 。
* /
$removePlayer ( player : Player ) : void ;
/ * *
* @private
* /
private callBackList ;
/ * *
* @private
* /
private thisObjectList ;
/ * *
* @private
* /
$startTick ( callBack : ( timeStamp : number ) = > boolean , thisObject : any ) : void ;
/ * *
* @private
* /
$stopTick ( callBack : ( timeStamp : number ) = > boolean , thisObject : any ) : void ;
/ * *
* @private
* /
private getTickIndex ( callBack , thisObject ) ;
/ * *
* @private
*
* /
private concatTick ( ) ;
/ * *
* @private
* 全 局 帧 率
* /
$frameRate : number ;
/ * *
* @private
* /
private frameInterval ;
/ * *
* @private
* /
private frameDeltaTime ;
/ * *
* @private
* /
private lastTimeStamp ;
/ * *
* @private
* 设 置 全 局 帧 率
* /
$setFrameRate ( value : number ) : boolean ;
/ * *
* @private
* /
private lastCount ;
/ * *
* @private
* ticker 花 销 的 时 间
* /
private costEnterFrame ;
/ * *
* @private
* 是 否 被 暂 停
* /
private isPaused ;
/ * *
* Pause the ticker .
* @version Egret 5.0 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* 暂 停 心 跳
* @version Egret 5.0 . 2
* @platform Web , Native
* @language zh_CN
* /
pause ( ) : void ;
/ * *
* Resume the ticker .
* @version Egret 5.0 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* 恢 复 心 跳
* @version Egret 5.0 . 2
* @platform Web , Native
* @language zh_CN
* /
resume ( ) : void ;
/ * *
* @private
* 执 行 一 次 刷 新
* /
update ( forceUpdate? : boolean ) : void ;
/ * *
* @private
* 执 行 一 次 屏 幕 渲 染
* /
private render ( triggerByFrame , costTicker ) ;
/ * *
* @private
* 广 播 EnterFrame事件 。
* /
private broadcastEnterFrame ( ) ;
/ * *
* @private
* 广 播 Render事件 。
* /
private broadcastRender ( ) ;
/ * *
* @private
* /
private callLaters ( ) ;
/ * *
* @private
* /
private callLaterAsyncs ( ) ;
}
}
declare module egret {
namespace lifecycle {
type LifecyclePlugin = ( context : LifecycleContext ) = > void ;
/ * *
* @private
* /
let stage : egret.Stage ;
/ * *
* @private
* /
let contexts : LifecycleContext [ ] ;
class LifecycleContext {
pause ( ) : void ;
resume ( ) : void ;
onUpdate ? : ( ) = > void ;
}
let onResume : ( ) = > void ;
let onPause : ( ) = > void ;
function addLifecycleListener ( plugin : LifecyclePlugin ) : void ;
}
/ * *
* 心 跳 计 时 器 单 例
* /
let ticker : sys.SystemTicker ;
}
/ * *
* @private
* /
declare let egret_stages : egret.Stage [ ] ;
declare namespace egret . sys {
/ * *
* @private
* 用 户 交 互 操 作 管 理 器
* /
class TouchHandler extends HashObject {
private maxTouches ;
private useTouchesCount ;
/ * *
* @private
* /
constructor ( stage : Stage ) ;
/ * *
* @private
* 设 置 同 时 触 摸 数 量
* /
$initMaxTouches ( ) : void ;
/ * *
* @private
* /
private stage ;
/ * *
* @private
* /
private touchDownTarget ;
/ * *
* @private
* 触 摸 开 始 ( 按 下 )
* @param x 事 件 发 生 处 相 对 于 舞 台 的 坐 标 x
* @param y 事 件 发 生 处 相 对 于 舞 台 的 坐 标 y
* @param touchPointID 分 配 给 触 摸 点 的 唯 一 标 识 号
* /
onTouchBegin ( x : number , y : number , touchPointID : number ) : void ;
/ * *
* @private
* /
private lastTouchX ;
/ * *
* @private
* /
private lastTouchY ;
/ * *
* @private
* 触 摸 移 动
* @param x 事 件 发 生 处 相 对 于 舞 台 的 坐 标 x
* @param y 事 件 发 生 处 相 对 于 舞 台 的 坐 标 y
* @param touchPointID 分 配 给 触 摸 点 的 唯 一 标 识 号
* /
onTouchMove ( x : number , y : number , touchPointID : number ) : void ;
/ * *
* @private
* 触 摸 结 束 ( 弹 起 )
* @param x 事 件 发 生 处 相 对 于 舞 台 的 坐 标 x
* @param y 事 件 发 生 处 相 对 于 舞 台 的 坐 标 y
* @param touchPointID 分 配 给 触 摸 点 的 唯 一 标 识 号
* /
onTouchEnd ( x : number , y : number , touchPointID : number ) : void ;
/ * *
* @private
* 获 取 舞 台 坐 标 下 的 触 摸 对 象
* /
private findTarget ( stageX , stageY ) ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 位 图 渲 染 节 点
* /
class BitmapNode extends RenderNode {
constructor ( ) ;
/ * *
* 要 绘 制 的 位 图
* /
image : BitmapData ;
/ * *
* 控 制 在 缩 放 时 是 否 对 位 图 进 行 平 滑 处 理 。
* /
smoothing : boolean ;
/ * *
* 相 对 偏 移 矩 阵 。
* /
matrix : egret.Matrix ;
/ * *
* 图 片 宽 度 。 WebGL渲染使用
* /
imageWidth : number ;
/ * *
* 图 片 高 度 。 WebGL渲染使用
* /
imageHeight : number ;
/ * *
* 使 用 的 混 合 模 式
* /
blendMode : number ;
/ * *
* 相 对 透 明 度
* /
alpha : number ;
/ * *
* 颜 色 变 换 滤 镜
* /
filter : ColorMatrixFilter ;
/ * *
* 翻 转
* /
rotated : boolean ;
/ * *
* 绘 制 一 次 位 图
* /
drawImage ( sourceX : number , sourceY : number , sourceW : number , sourceH : number , drawX : number , drawY : number , drawW : number , drawH : number ) : void ;
/ * *
* 在 显 示 对 象 的 $updateRenderNode ( ) 方 法 被 调 用 前 , 自 动 清 空 自 身 的 drawData数据 。
* /
cleanBeforeRender ( ) : void ;
static $updateTextureData ( node : sys.NormalBitmapNode , image : BitmapData , bitmapX : number , bitmapY : number , bitmapWidth : number , bitmapHeight : number , offsetX : number , offsetY : number , textureWidth : number , textureHeight : number , destW : number , destH : number , sourceWidth : number , sourceHeight : number , fillMode : string , smoothing : boolean ) : void ;
/ * *
* @private
* 绘 制 九 宫 格 位 图
* /
static $updateTextureDataWithScale9Grid ( node : sys.NormalBitmapNode , image : BitmapData , scale9Grid : egret.Rectangle , bitmapX : number , bitmapY : number , bitmapWidth : number , bitmapHeight : number , offsetX : number , offsetY : number , textureWidth : number , textureHeight : number , destW : number , destH : number , sourceWidth : number , sourceHeight : number , smoothing : boolean ) : void ;
/ * *
* @private
* /
private static drawClipImage ( node , scale , bitmapX , bitmapY , scaledBitmapW , scaledBitmapH , offsetX , offsetY , destW , destH , startX ? , startY ? ) ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 矢 量 渲 染 节 点
* /
class GraphicsNode extends RenderNode {
constructor ( ) ;
/ * *
* 指 定 一 种 简 单 的 单 一 颜 色 填 充 , 在 绘 制 时 该 填 充 将 在 随 后 对 其 他 Graphics 方 法 ( 如 lineTo ( ) 或 drawCircle ( ) ) 的 调 用 中 使 用 。
* @param color 填 充 的 颜 色
* @param alpha 填 充 的 Alpha 值
* @param beforePath 插 入 在 指 定 的 路 径 命 令 之 前 绘 制 , 通 常 是 插 入 到 当 前 正 在 绘 制 的 线 条 路 径 之 前 , 以 确 保 线 条 总 在 填 充 的 上 方 。
* /
beginFill ( color : number , alpha? : number , beforePath? : Path2D ) : Path2D ;
/ * *
* 指 定 一 种 简 单 的 单 一 颜 色 填 充 , 在 绘 制 时 该 填 充 将 在 随 后 对 其 他 Graphics 方 法 ( 如 lineTo ( ) 或 drawCircle ( ) ) 的 调 用 中 使 用 。
* 调 用 clear ( ) 方 法 会 清 除 填 充 。
* @param type 用 于 指 定 要 使 用 哪 种 渐 变 类 型 的 GradientType 类 的 值 : GradientType . LINEAR 或 GradientType . RADIAL 。
* @param colors 渐 变 中 使 用 的 RGB 十 六 进 制 颜 色 值 的 数 组 ( 例 如 , 红 色 为 0xFF0000 , 蓝 色 为 0x0000FF , 等 等 ) 。 对 于 每 种 颜 色 , 请 在 alphas 和 ratios 参 数 中 指 定 对 应 值 。
* @param alphas colors 数 组 中 对 应 颜 色 的 alpha 值 数 组 。
* @param ratios 颜 色 分 布 比 率 的 数 组 。 有 效 值 为 0 到 255 。
* @param matrix 一 个 由 egret . Matrix 类 定 义 的 转 换 矩 阵 。 egret . Matrix 类 包 括 createGradientBox ( ) 方 法 , 通 过 该 方 法 可 以 方 便 地 设 置 矩 阵 , 以 便 与 beginGradientFill ( ) 方 法 一 起 使 用
* @param beforePath 插 入 在 指 定 的 路 径 命 令 之 前 绘 制 , 通 常 是 插 入 到 当 前 正 在 绘 制 的 线 条 路 径 之 前 , 以 确 保 线 条 总 在 填 充 的 上 方 。
* /
beginGradientFill ( type : string , colors : number [ ] , alphas : number [ ] , ratios : number [ ] , matrix? : egret.Matrix , beforePath? : Path2D ) : Path2D ;
/ * *
* 指 定 一 种 线 条 样 式 以 用 于 随 后 对 lineTo ( ) 或 drawCircle ( ) 等 Graphics 方 法 的 调 用 。
* @param thickness 一 个 整 数 , 以 点 为 单 位 表 示 线 条 的 粗 细 , 有 效 值 为 0 到 255 。 如 果 未 指 定 数 字 , 或 者 未 定 义 该 参 数 , 则 不 绘 制 线 条 。 如 果 传 递 的 值 小 于 0 , 则 默 认 值 为 0 。 值 0 表 示 极 细 的 粗 细 ; 最 大 粗 细 为 255 。 如 果 传 递 的 值 大 于 255 , 则 默 认 值 为 255 。
* @param color 线 条 的 十 六 进 制 颜 色 值 ( 例 如 , 红 色 为 0xFF0000 , 蓝 色 为 0x0000FF 等 ) 。 如 果 未 指 明 值 , 则 默 认 值 为 0x000000 ( 黑 色 ) 。 可 选 。
* @param alpha 表 示 线 条 颜 色 的 Alpha 值 的 数 字 ; 有 效 值 为 0 到 1 。 如 果 未 指 明 值 , 则 默 认 值 为 1 ( 纯 色 ) 。 如 果 值 小 于 0 , 则 默 认 值 为 0 。 如 果 值 大 于 1 , 则 默 认 值 为 1 。
* @param caps 用 于 指 定 线 条 末 端 处 端 点 类 型 的 CapsStyle 类 的 值 。 默 认 值 : CapsStyle . ROUND
* @param joints 指 定 用 于 拐 角 的 连 接 外 观 的 类 型 。 默 认 值 : JointStyle . ROUND
* @param miterLimit 用 于 表 示 剪 切 斜 接 的 极 限 值 的 数 字 。
* /
lineStyle ( thickness? : number , color? : number , alpha? : number , caps? : string , joints? : string , miterLimit? : number , lineDash? : number [ ] ) : StrokePath ;
/ * *
* 清 空 所 有 缓 存 的 绘 制 数 据
* /
clear ( ) : void ;
/ * *
* 覆 盖 父 类 方 法 , 不 自 动 清 空 缓 存 的 绘 图 数 据 , 改 为 手 动 调 用 clear ( ) 方 法 清 空 。
* /
cleanBeforeRender ( ) : void ;
/ * *
* 绘 制 x偏移
* /
x : number ;
/ * *
* 绘 制 y偏移
* /
y : number ;
/ * *
* 绘 制 宽 度
* /
width : number ;
/ * *
* 绘 制 高 度
* /
height : number ;
/ * *
* 脏 渲 染 标 记
* 暂 时 调 用 lineStyle , beginFill , beginGradientFill标记 , 实 际 应 该 draw时候标记在Path2D
* /
dirtyRender : boolean ;
$texture : WebGLTexture ;
$textureWidth : number ;
$textureHeight : number ;
$canvasScaleX : number ;
$canvasScaleY : number ;
/ * *
* 清 除 非 绘 制 的 缓 存 数 据
* /
clean ( ) : void ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 组 渲 染 节 点 , 用 于 组 合 多 个 渲 染 节 点
* /
class GroupNode extends RenderNode {
/ * *
* 相 对 偏 移 矩 阵 。
* /
matrix : egret.Matrix ;
constructor ( ) ;
addNode ( node : RenderNode ) : void ;
/ * *
* 覆 盖 父 类 方 法 , 不 自 动 清 空 缓 存 的 绘 图 数 据 , 改 为 手 动 调 用 clear ( ) 方 法 清 空 。
* 这 里 只 是 想 清 空 绘 制 命 令 , 因 此 不 调 用 super
* /
cleanBeforeRender ( ) : void ;
$getRenderCount ( ) : number ;
}
}
declare namespace egret . sys {
/ * *
* @private
* Mesh 渲 染 节 点
* /
class MeshNode extends RenderNode {
constructor ( ) ;
/ * *
* 要 绘 制 的 位 图
* /
image : BitmapData ;
/ * *
* 控 制 在 缩 放 时 是 否 对 位 图 进 行 平 滑 处 理 。
* /
smoothing : boolean ;
/ * *
* 图 片 宽 度 。 WebGL渲染使用
* /
imageWidth : number ;
/ * *
* 图 片 高 度 。 WebGL渲染使用
* /
imageHeight : number ;
/ * *
* 相 对 偏 移 矩 阵 。
* /
matrix : egret.Matrix ;
/ * *
* UV 坐 标 。
* /
uvs : number [ ] ;
/ * *
* 顶 点 坐 标 。
* /
vertices : number [ ] ;
/ * *
* 顶 点 索 引 。
* /
indices : number [ ] ;
/ * *
* 顶 点 索 引 。
* /
bounds : Rectangle ;
/ * *
* 使 用 的 混 合 模 式
* /
blendMode : number ;
/ * *
* 相 对 透 明 度
* /
alpha : number ;
/ * *
* 颜 色 变 换 滤 镜
* /
filter : ColorMatrixFilter ;
/ * *
* 翻 转
* /
rotated : boolean ;
/ * *
* 绘 制 一 次 位 图
* /
drawMesh ( sourceX : number , sourceY : number , sourceW : number , sourceH : number , drawX : number , drawY : number , drawW : number , drawH : number ) : void ;
/ * *
* 在 显 示 对 象 的 $updateRenderNode ( ) 方 法 被 调 用 前 , 自 动 清 空 自 身 的 drawData数据 。
* /
cleanBeforeRender ( ) : void ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 位 图 渲 染 节 点
* /
class NormalBitmapNode extends RenderNode {
constructor ( ) ;
/ * *
* 要 绘 制 的 位 图
* /
image : BitmapData ;
/ * *
* 控 制 在 缩 放 时 是 否 对 位 图 进 行 平 滑 处 理 。
* /
smoothing : boolean ;
/ * *
* 图 片 宽 度 。 WebGL渲染使用
* /
imageWidth : number ;
/ * *
* 图 片 高 度 。 WebGL渲染使用
* /
imageHeight : number ;
/ * *
* 翻 转
* /
rotated : boolean ;
sourceX : number ;
sourceY : number ;
sourceW : number ;
sourceH : number ;
drawX : number ;
drawY : number ;
drawW : number ;
drawH : number ;
/ * *
* 绘 制 一 次 位 图
* /
drawImage ( sourceX : number , sourceY : number , sourceW : number , sourceH : number , drawX : number , drawY : number , drawW : number , drawH : number ) : void ;
/ * *
* 在 显 示 对 象 的 $updateRenderNode ( ) 方 法 被 调 用 前 , 自 动 清 空 自 身 的 drawData数据 。
* /
cleanBeforeRender ( ) : void ;
}
}
declare namespace egret {
/ * *
* @private
* /
class Mesh extends Bitmap {
constructor ( value? : Texture ) ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* /
protected setBitmapDataToWasm ( data? : Texture ) : void ;
/ * *
* @private
* /
$updateRenderNode ( ) : void ;
/ * *
* @private
* /
private _verticesDirty ;
private _bounds ;
/ * *
* @private
* /
$updateVertices ( ) : void ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 文 本 格 式
* /
interface TextFormat {
/ * *
* 颜 色 值
* /
textColor? : number ;
/ * *
* 描 边 颜 色 值
* /
strokeColor? : number ;
/ * *
* 字 号
* /
size? : number ;
/ * *
* 描 边 大 小
* /
stroke? : number ;
/ * *
* 是 否 加 粗
* /
bold? : boolean ;
/ * *
* 是 否 倾 斜
* /
italic? : boolean ;
/ * *
* 字 体 名 称
* /
fontFamily? : string ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 文 本 渲 染 节 点
* /
class TextNode extends RenderNode {
constructor ( ) ;
/ * *
* 颜 色 值
* /
textColor : number ;
/ * *
* 描 边 颜 色 值
* /
strokeColor : number ;
/ * *
* 字 号
* /
size : number ;
/ * *
* 描 边 大 小
* /
stroke : number ;
/ * *
* 是 否 加 粗
* /
bold : boolean ;
/ * *
* 是 否 倾 斜
* /
italic : boolean ;
/ * *
* 字 体 名 称
* /
fontFamily : string ;
/ * *
* 绘 制 一 行 文 本
* /
drawText ( x : number , y : number , text : string , format : TextFormat ) : void ;
/ * *
* 绘 制 x偏移
* /
x : number ;
/ * *
* 绘 制 y偏移
* /
y : number ;
/ * *
* 绘 制 宽 度
* /
width : number ;
/ * *
* 绘 制 高 度
* /
height : number ;
/ * *
* 脏 渲 染 标 记
* /
dirtyRender : boolean ;
$texture : WebGLTexture ;
$textureWidth : number ;
$textureHeight : number ;
$canvasScaleX : number ;
$canvasScaleY : number ;
/ * *
* 清 除 非 绘 制 的 缓 存 数 据
* /
clean ( ) : void ;
/ * *
* 在 显 示 对 象 的 $updateRenderNode ( ) 方 法 被 调 用 前 , 自 动 清 空 自 身 的 drawData数据 。
* /
cleanBeforeRender ( ) : void ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 填 充 路 径
* /
class FillPath extends Path2D {
constructor ( ) ;
/ * *
* 填 充 颜 色
* /
fillColor : number ;
/ * *
* 填 充 透 明 度
* /
fillAlpha : number ;
}
}
declare namespace egret . sys {
/ * *
* @private
* 渐 变 填 充 路 径
* /
class GradientFillPath extends Path2D {
constructor ( ) ;
gradientType : string ;
colors : number [ ] ;
alphas : number [ ] ;
ratios : number [ ] ;
matrix : Matrix ;
}
}
declare namespace egret {
/ * *
* OrientationMode 类 为 舞 台 初 始 旋 转 模 式 提 供 值 。
* /
const OrientationMode : {
AUTO : string ;
PORTRAIT : string ;
LANDSCAPE : string ;
LANDSCAPE_FLIPPED : string ;
} ;
}
declare namespace egret . sys {
/ * *
* @private
* 线 条 路 径 。
* 注 意 : 当 线 条 宽 度 ( lineWidth ) 为 1 或 3 像 素 时 , 需 要 特 殊 处 理 , 往 右 下 角 偏 移 0.5 像 素 , 以 显 示 清 晰 锐 利 的 线 条 。
* /
class StrokePath extends Path2D {
constructor ( ) ;
/ * *
* 线 条 宽 度 。
* 注 意 : 绘 制 时 对 1 像 素 和 3 像 素 要 特 殊 处 理 , 整 体 向 右 下 角 偏 移 0.5 像 素 , 以 显 示 清 晰 锐 利 的 线 条 。
* /
lineWidth : number ;
/ * *
* 线 条 颜 色
* /
lineColor : number ;
/ * *
* 线 条 透 明 度
* /
lineAlpha : number ;
/ * *
* 端 点 样 式 , "none" : 无 端 点 , "round" : 圆 头 端 点 , "square" : 方 头 端 点
* /
caps : string ;
/ * *
* 联 接 点 样 式 , "bevel" : 斜 角 连 接 , "miter" : 尖 角 连 接 , "round" : 圆 角 连 接
* /
joints : string ;
/ * *
* 用 于 表 示 剪 切 斜 接 的 极 限 值 的 数 字 。
* /
miterLimit : number ;
/ * *
* 描 述 交 替 绘 制 线 段 和 间 距 ( 坐 标 空 间 单 位 ) 长 度 的 数 字 。
* /
lineDash : number [ ] ;
}
}
/ * *
* @private
* /
interface CanvasRenderingContext2D {
imageSmoothingEnabled : boolean ;
$imageSmoothingEnabled : boolean ;
$offsetX : number ;
$offsetY : number ;
}
declare namespace egret {
class CanvasRenderer {
private nestLevel ;
render ( displayObject : DisplayObject , buffer : sys.RenderBuffer , matrix : Matrix , forRenderTexture? : boolean ) : number ;
/ * *
* @private
* 绘 制 一 个 显 示 对 象
* /
private drawDisplayObject ( displayObject , context , offsetX , offsetY , isStage ? ) ;
private drawWithFilter ( displayObject , context , offsetX , offsetY ) ;
private drawWithClip ( displayObject , context , offsetX , offsetY ) ;
private drawWithScrollRect ( displayObject , context , offsetX , offsetY ) ;
drawNodeToBuffer ( node : sys.RenderNode , buffer : sys.RenderBuffer , matrix : Matrix , forHitTest? : boolean ) : void ;
/ * *
* 将 一 个 DisplayObject绘制到渲染缓冲 , 用 于 RenderTexture绘制
* @param displayObject 要 绘 制 的 显 示 对 象
* @param buffer 渲 染 缓 冲
* @param matrix 要 叠 加 的 矩 阵
* /
drawDisplayToBuffer ( displayObject : DisplayObject , buffer : sys.RenderBuffer , matrix : Matrix ) : number ;
private renderNode ( node , context , forHitTest ? ) ;
private renderNormalBitmap ( node , context ) ;
private renderBitmap ( node , context ) ;
private renderMesh ( node , context ) ;
renderText ( node : sys.TextNode , context : CanvasRenderingContext2D ) : void ;
private renderingMask ;
/ * *
* @private
* /
renderGraphics ( node : sys.GraphicsNode , context : CanvasRenderingContext2D , forHitTest? : boolean ) : number ;
private renderPath ( path , context ) ;
private renderGroup ( groupNode , context ) ;
private createRenderBuffer ( width , height , useForFilters ? ) ;
}
/ * *
* @private
* 获 取 字 体 字 符 串
* /
function getFontString ( node : sys.TextNode , format : sys.TextFormat ) : string ;
/ * *
* @private
* 获 取 RGBA字符串
* /
function getRGBAString ( color : number , alpha : number ) : string ;
}
declare namespace egret {
/ * *
* Orientation monitor the orientation of the device , send CHANGE event when the orientation is changed
*
* @event egret . Event . CHANGE device ' s orientation is changed
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / DeviceOrientation . ts
* @see http : //edn.egret.com/cn/docs/page/661 获取设备旋转角度
* @language en_US
* /
/ * *
* Orientation 监 听 设 备 方 向 的 变 化 , 当 方 向 变 化 时 派 发 CHANGE 事 件
* @event egret . Event . CHANGE 设 备 方 向 改 变 时 派 发
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / DeviceOrientation . ts
* @see http : //edn.egret.com/cn/docs/page/661 获取设备旋转角度
* @language zh_CN
* /
interface DeviceOrientation extends EventDispatcher {
/ * *
* Start to monitor the device ' s orientation
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 开 始 监 听 设 备 方 向 变 化
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
start ( ) : void ;
/ * *
* Stop monitor the device ' s orientation
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 停 止 监 听 设 备 方 向 变 化
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
stop ( ) : void ;
}
/ * *
* @copy egret . Orientation
* /
let DeviceOrientation : {
new ( ) : DeviceOrientation ;
} ;
}
declare namespace egret {
/ * *
* The Geolocation able to obtain the position of the device .
* Geolocation will emit CHANGE event when the device ' s location is changed .
* It will emit IO_ERROR event if the location request is denied
* or there is no location service on the device .
*
* @event egret . Event . CHANGE The device ' s location is changed
* @event egret . Event . IO_ERROR Error occurred while getting the location
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / Geolocation . ts
* @language en_US
* /
/ * *
* Geolocation 能 够 从 设 备 的 定 位 服 务 获 取 设 备 的 当 前 位 置 。
* 当 设 备 的 位 置 发 生 改 变 时 Geolocation 会 派 发 CHANGE 事 件 。
* 当 定 位 请 求 被 拒 绝 或 该 设 备 没 有 定 位 服 务 时 Geolocation 会 派 发 IO_ERROR 事 件 。
*
* @event egret . Event . CHANGE 设 备 位 置 发 生 改 变
* @event egret . Event . IO_ERROR 获 取 设 备 位 置 时 发 生 错 误
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / Geolocation . ts
* @language zh_CN
* /
interface Geolocation extends EventDispatcher {
/ * *
* Start to monitor the device ' s location
* @returns
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 开 始 监 听 设 备 位 置 信 息
* @returns
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
start ( ) : void ;
/ * *
* Stop monitor the device ' s location
* @returns
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 停 止 监 听 设 备 位 置 信 息
* @returns
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
stop ( ) : void ;
}
/ * *
* @copy egret . Geolocation
* /
let Geolocation : {
/ * *
* constructor
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 构 造 函 数
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
new ( ) : Geolocation ;
} ;
}
declare namespace egret {
/ * *
* @copy egret . Motion
* /
let Motion : {
new ( ) : Motion ;
} ;
/ * *
* The Motion class emits events based on activity detected by the device ' s motion sensor .
* This data represents the device ' s movement along a 3 - dimensional axis . When the device moves ,
* the sensor detects this movement and emit the CHANGE event . @see egret . MotionEvent
*
* @event egret . Event . CHANGE device is moved
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / Motion . ts
* @language en_US
* /
/ * *
* Motion 类 从 用 户 设 备 读 取 运 动 状 态 信 息 并 派 发 CHANGE 事 件 。
* 当 设 备 移 动 时 , 传 感 器 会 检 测 到 此 移 动 并 返 回 设 备 加 速 度 , 重 力 和 旋 转 数 据 。 @see egret . MotionEvent
* Motion 类 提 供 了 start 和 stop 方 法 , 来 启 动 和 停 止 运 动 信 息 检 查
*
* @event egret . Event . CHANGE 运 动 状 态 发 生 改 变
* @version Egret 2.4
* @platform Web
* @includeExample egret / sensor / Motion . ts
* @language zh_CN
* /
interface Motion extends EventDispatcher {
/ * *
* Start to monitor device movement
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 开 始 监 听 设 备 运 动 状 态
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
start ( ) : void ;
/ * *
* Stop monitor device movement
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 停 止 监 听 设 备 运 动 状 态
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
stop ( ) : void ;
}
/ * *
* A DeviceRotationRate object provides information about the rate at which
* the device is rotating around all three axes .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* DeviceRotationRate 提 供 设 备 围 绕 三 个 轴 旋 转 的 角 速 度 信 息 , 单 位 是 角 度 / 秒
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
interface DeviceRotationRate {
/ * *
* The amount of rotation around the Z axis , in degrees per second .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 设 备 绕 Z 轴 旋 转 的 角 速 度 信 息 , 单 位 是 度 / 秒
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
alpha : number ;
/ * *
* The amount of rotation around the X axis , in degrees per second .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 设 备 绕 X 轴 旋 转 的 角 速 度 信 息 , 单 位 是 度 / 秒
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
beta : number ;
/ * *
* The amount of rotation around the Y axis , in degrees per second .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* 设 备 绕 Y 轴 旋 转 的 角 速 度 信 息 , 单 位 是 度 / 秒
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
gamma : number ;
}
/ * *
* A DeviceAcceleration object provides information about the amount
* of acceleration the device is experiencing along all three axes .
* Acceleration is expressed in m / s2 .
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* DeviceAcceleration 提 供 设 备 在 三 个 维 度 的 加 速 度 信 息 , 加 速 度 值 的 单 位 是 m / s2
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
interface DeviceAcceleration {
/ * *
* The amount of acceleration along the X axis
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* X 轴 方 向 的 加 速 度 值
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
x : number ;
/ * *
* The amount of acceleration along the Y axis
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* Y 轴 方 向 的 加 速 度 值
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
y : number ;
/ * *
* The amount of acceleration along the Z axis
* @version Egret 2.4
* @platform Web
* @language en_US
* /
/ * *
* Z 轴 方 向 的 加 速 度 值
* @version Egret 2.4
* @platform Web
* @language zh_CN
* /
z : number ;
}
}
declare namespace egret {
/ * *
* Type of operation .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 运 行 类 型 的 类 型 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
namespace RuntimeType {
/ * *
* Running on Web
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 运 行 在 Web上
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
const WEB = "web" ;
/ * *
* Running on NATIVE
* @version Egret 2.4
* @deprecated
* @platform Web , Native
* @language en_US
* /
/ * *
* 运 行 在 NATIVE上
* @version Egret 2.4
* @deprecated
* @platform Web , Native
* @language zh_CN
* /
const NATIVE = "native" ;
/ * *
* Running on Runtime2 . 0
* @version Egret 5.1 . 5
* @platform Web , Native
* @language en_US
* /
/ * *
* 运 行 在 Runtime2 . 0 上
* @version Egret 5.1 . 5
* @platform Web , Native
* @language zh_CN
* /
const RUNTIME2 = "runtime2" ;
/ * *
* Running on Alipay
2020-06-29 15:41:02 +08:00
* @version Egret 5.2 . 33
2020-06-08 11:49:45 +08:00
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 支 付 宝 小 游 戏 上
2020-06-29 15:41:02 +08:00
* @version Egret 5.2 . 33
2020-06-08 11:49:45 +08:00
* @platform All
* @language zh_CN
* /
const MYGAME = "mygame" ;
/ * *
* Running on WeChat mini game
* @version Egret 5.1 . 5
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 微 信 小 游 戏 上
* @version Egret 5.1 . 5
* @platform All
* @language zh_CN
* /
const WXGAME = "wxgame" ;
/ * *
* Running on Baidu mini game
* @version Egret 5.2 . 13
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 百 度 小 游 戏 上
* @version Egret 5.2 . 13
* @platform All
* @language zh_CN
* /
const BAIDUGAME = "baidugame" ;
/ * *
* Running on Xiaomi quick game
* @version Egret 5.2 . 14
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 小 米 快 游 戏 上
* @version Egret 5.2 . 14
* @platform All
* @language zh_CN
* /
const QGAME = "qgame" ;
/ * *
* Running on OPPO mini game
* @version Egret 5.2 . 14
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 Oppo 小 游 戏 上
* @version Egret 5.2 . 14
* @platform All
* @language zh_CN
* /
const OPPOGAME = "oppogame" ;
/ * *
* Running on QQ mini game
* @version Egret 5.2 . 25
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 QQ 小 游 戏 上
* @version Egret 5.2 . 25
* @platform All
* @language zh_CN
* /
const QQGAME = "qqgame" ;
/ * *
* Running on vivo mini game
* @version Egret 5.2 . 23
* @platform All
* @language en_US
* /
/ * *
* 运 行 在 vivo 小 游 戏 上
* @version Egret 5.2 . 23
* @platform All
* @language zh_CN
* /
const VIVOGAME = "vivogame" ;
}
interface SupportedCompressedTexture {
pvrtc : boolean ;
etc1 : boolean ;
}
/ * *
* The Capabilities class provides properties that describe the system and runtime that are hosting the application .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / system / Capabilities . ts
* @language en_US
* /
/ * *
* Capabilities 类 提 供 一 些 属 性 , 这 些 属 性 描 述 了 承 载 应 用 程 序 的 系 统 和 运 行 时 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / system / Capabilities . ts
* @language zh_CN
* /
class Capabilities {
/ * *
* Specifies the language code of the system on which the content is running . The language is specified as a lowercase
* two - letter language code from ISO 639 - 1 . For Chinese , an additional uppercase two - letter country code from ISO 3166
* distinguishes between Simplified and Traditional Chinese . < br / >
* The following table lists the possible values , but not limited to them :
* < ul >
* < li > Simplified Chinese zh - CN < / li >
* < li > Traditional Chinese zh - TW < / li >
* < li > English en < / li >
* < li > Japanese ja < / li >
* < li > Korean ko < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 运 行 内 容 的 系 统 的 语 言 代 码 。 语 言 指 定 为 ISO 639 - 1 中 的 小 写 双 字 母 语 言 代 码 。
* 对 于 中 文 , 另 外 使 用 ISO 3166 中 的 大 写 双 字 母 国 家 / 地 区 代 码 , 以 区 分 简 体 中 文 和 繁 体 中 文 。 < br / >
* 以 下 是 可 能 但 不 限 于 的 语 言 和 值 :
* < ul >
* < li > 简 体 中 文 zh - CN < / li >
* < li > 繁 体 中 文 zh - TW < / li >
* < li > 英 语 en < / li >
* < li > 日 语 ja < / li >
* < li > 韩 语 ko < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static readonly language : string ;
/ * *
* Specifies whether the system is running in a mobile device . ( such as a mobile phone or tablet )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 程 序 内 容 是 否 运 行 在 移 动 设 备 中 ( 例 如 移 动 电 话 或 平 板 电 脑 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static readonly isMobile : boolean ;
/ * *
* Specifies the current operating system . The os property can return the following strings :
* < ul >
* < li > iPhone "iOS" < / li >
* < li > Android Phone "Android" < / li >
* < li > Windows Phone "Windows Phone" < / li >
* < li > Windows Desktop "Windows PC" < / li >
* < li > Mac Desktop "Mac OS" < / li >
* < li > Unknown OS "Unknown" < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 示 当 前 的 操 作 系 统 。 os 属 性 返 回 下 列 字 符 串 :
* < ul >
* < li > 苹 果 手 机 操 作 系 统 "iOS" < / li >
* < li > 安 卓 手 机 操 作 系 统 "Android" < / li >
* < li > 微 软 手 机 操 作 系 统 "Windows Phone" < / li >
* < li > 微 软 桌 面 操 作 系 统 "Windows PC" < / li >
* < li > 苹 果 桌 面 操 作 系 统 "Mac OS" < / li >
* < li > 未 知 操 作 系 统 "Unknown" < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static readonly os : string ;
/ * *
* It indicates the current type of operation . runtimeType property returns the following string :
* < ul >
* < li > Run on Web egret . RuntimeType . WEB < / li >
* < li > Run on Runtime2 . 0 egret . RuntimeType . RUNTIME2 < / li >
* < li > Run on WeChat mini game egret . RuntimeType . WXGAME < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 指 示 当 前 的 运 行 类 型 。 runtimeType 属 性 返 回 下 列 字 符 串 :
* < ul >
* < li > 运 行 在 Web上 egret . RuntimeType . WEB < / li >
* < li > 运 行 在 Runtime2 . 0 上 egret . RuntimeType . RUNTIME2 < / li >
* < li > 运 行 在 微 信 小 游 戏 上 egret . RuntimeType . WXGAME < / li >
* < / ul >
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static readonly runtimeType : string ;
/ * * *
* version of Egret .
* @type { string }
* @version Egret 3.2 . 0
* @platform Web , Native
* @language en_US
* /
/ * * *
* Egret 的 版 本 号 。
* @type { string }
* @version Egret 3.2 . 0
* @platform Web , Native
* @language zh_CN
* /
static readonly engineVersion : string ;
/ * * *
* current render mode .
* @type { string }
* @version Egret 3.0 . 7
* @platform Web , Native
* @language en_US
* /
/ * * *
* 当 前 渲 染 模 式 。
* @type { string }
* @version Egret 3.0 . 7
* @platform Web , Native
* @language zh_CN
* /
static readonly renderMode : string ;
/ * * *
* Clients border width .
* The value before the document class initialization is always 0 .
* This value will change after the distribution Event . RESIZE and StageOrientationEvent . ORIENTATION_CHANGE .
* @version Egret 3.1 . 3
* @platform Web , Native
* @language en_US
* /
/ * * *
* 客 户 端 边 界 宽 度 。
* 该 值 在 文 档 类 初 始 化 之 前 始 终 是 0 。
* 该 值 在 派 发 Event . RESIZE 以 及 StageOrientationEvent . ORIENTATION_CHANGE 之 后 会 发 生 改 变 。
* @version Egret 3.1 . 3
* @platform Web , Native
* @language zh_CN
* /
static readonly boundingClientWidth : number ;
/ * * *
* Clients border height .
* The value before the document class initialization is always 0 .
* This value will change after the distribution Event . RESIZE and StageOrientationEvent . ORIENTATION_CHANGE .
* @version Egret 3.1 . 3
* @platform Web , Native
* @language en_US
* /
/ * * *
* 客 户 端 边 界 高 度 。
* 该 值 在 文 档 类 初 始 化 之 前 始 终 是 0 。
* 该 值 在 派 发 Event . RESIZE 以 及 StageOrientationEvent . ORIENTATION_CHANGE 之 后 会 发 生 改 变 。
* @version Egret 3.1 . 3
* @platform Web , Native
* @language zh_CN
* /
static readonly boundingClientHeight : number ;
/ * * *
* supported compressed texture
* @version Egret 5.2 . 19
* @platform Web , Native
* @language en_US
* /
/ * * *
* supported compressed texture
* @version Egret 5.2 . 19
* @platform Web , Native
* @language zh_CN
* /
static supportedCompressedTexture : SupportedCompressedTexture ;
}
}
declare namespace egret {
/ * *
* RenderTexture is a dynamic texture
* @extends egret . Texture
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / RenderTexture . ts
* @language en_US
* /
/ * *
* RenderTexture 是 动 态 纹 理 类 , 他 实 现 了 将 显 示 对 象 及 其 子 对 象 绘 制 成 为 一 个 纹 理 的 功 能
* @extends egret . Texture
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / RenderTexture . ts
* @language zh_CN
* /
class RenderTexture extends egret . Texture {
constructor ( ) ;
$renderBuffer : sys.RenderBuffer ;
/ * *
* The specified display object is drawn as a texture
* @param displayObject { egret . DisplayObject } the display to draw
* @param clipBounds { egret . Rectangle } clip rect
* @param scale { number } scale factor
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 指 定 显 示 对 象 绘 制 为 一 个 纹 理
* @param displayObject { egret . DisplayObject } 需 要 绘 制 的 显 示 对 象
* @param clipBounds { egret . Rectangle } 绘 制 矩 形 区 域
* @param scale { number } 缩 放 比 例
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
drawToTexture ( displayObject : egret.DisplayObject , clipBounds? : Rectangle , scale? : number ) : boolean ;
/ * *
* @inheritDoc
* /
getPixel32 ( x : number , y : number ) : number [ ] ;
/ * *
* @inheritDoc
* /
dispose ( ) : void ;
}
}
declare namespace egret {
/ * *
* Adds an interface - name - to - implementation - class mapping to the registry .
* @param interfaceName the interface name to register . For example : "eui.IAssetAdapter" , "eui.Theme"
* @param instance the instance to register .
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 注 册 一 个 接 口 实 现 。
* @param interfaceName 注 入 的 接 口 名 称 。 例 如 : "eui.IAssetAdapter" , "eui.Theme"
* @param instance 实 现 此 接 口 的 实 例 。
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
function registerImplementation ( interfaceName : string , instance : any ) : void ;
/ * *
* Returns the singleton instance of the implementation class that was registered for the specified interface .
* This method is usually called by egret framework .
* @param interfaceName The interface name to identify . For example : "eui.IAssetAdapter" , "eui.Theme"
* @returns the singleton instance of the implementation class
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 一 个 接 口 实 现 。 此 方 法 通 常 由 框 架 内 部 调 用 。 获 取 项 目 注 入 的 自 定 义 实 现 实 例 。
* @param interfaceName 要 获 取 的 接 口 名 称 。 例 如 : "eui.IAssetAdapter" , "eui.Theme"
* @returns 返 回 实 现 此 接 口 的 实 例 。
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
function getImplementation ( interfaceName : string ) : any ;
}
declare namespace egret {
/ * *
* This class is used to create lightweight shapes using the drawing application program interface ( API ) . The Shape
* class includes a graphics property , which lets you access methods from the Graphics class .
* @see egret . Graphics
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Shape . ts
* @language en_US
* /
/ * *
* 此 类 用 于 使 用 绘 图 应 用 程 序 编 程 接 口 ( API ) 创 建 简 单 形 状 。 Shape 类 含 有 graphics 属 性 , 通 过 该 属 性 您 可 以 访 问 各 种 矢 量 绘 图 方 法 。
* @see egret . Graphics
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Shape . ts
* @language zh_CN
* /
class Shape extends DisplayObject {
/ * *
* Creates a new Shape object .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 Shape 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* /
$graphics : Graphics ;
/ * *
* Specifies the Graphics object belonging to this Shape object , where vector drawing commands can occur .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 Shape 中 的 Graphics 对 象 。 可 通 过 此 对 象 执 行 矢 量 绘 图 命 令 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly graphics : Graphics ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
/ * *
* @private
* /
$onRemoveFromStage ( ) : void ;
}
}
declare namespace egret {
/ * *
* Bitmap font , texture set of a font . It is generally used as the value of the BitmapText . font attribute .
* @see http : //bbs.egret-labs.org/thread-918-1-1.html TextureMerger
* @see http : //bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 Text(Containing the specific usage of the bitmap font )
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / BitmapFont . ts
* @language en_US
* /
/ * *
* 位 图 字 体 , 是 一 个 字 体 的 纹 理 集 , 通 常 作 为 BitmapText . font属性的值 。
* @see http : //bbs.egret-labs.org/thread-918-1-1.html TextureMerger
* @see http : //bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 文本(含位图字体具体用法)
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / BitmapFont . ts
* @language zh_CN
* /
class BitmapFont extends SpriteSheet {
/ * *
* Create an egret . BitmapFont object
* @param texture { egret . Texture } Texture set that use TextureMerger create
* @param config { any } Configure data that use TextureMerger create
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . BitmapFont 对 象
* @param texture { egret . Texture } 使 用 TextureMerger生成的纹理集
* @param config { any } 使 用 TextureMerger生成的配置数据
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( texture : Texture , config : any ) ;
/ * *
* @private
* /
private charList ;
/ * *
* Obtain corresponding texture through the name attribute
* @param name { string } name Attribute
* @returns { egret . Texture }
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 通 过 name 属 性 获 取 对 应 纹 理
* @param name { string } name属性
* @returns { egret . Texture }
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
getTexture ( name : string ) : Texture ;
/ * *
* @private
* /
getConfig ( name : string , key : string ) : number ;
/ * *
* @private
* /
private firstCharHeight ;
/ * *
* @private
*
* @returns
* /
_getFirstCharHeight ( ) : number ;
/ * *
* @private
*
* @param fntText
* @returns
* /
private parseConfig ( fntText ) ;
/ * *
* @private
*
* @param configText
* @param key
* @returns
* /
private getConfigByKey ( configText , key ) ;
}
}
declare namespace egret {
/ * *
* Bitmap font adopts the Bitmap + SpriteSheet mode to render text .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / BitmapText . ts
* @language en_US
* /
/ * *
* 位 图 字 体 采 用 了 Bitmap + SpriteSheet的方式来渲染文字 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / BitmapText . ts
* @language zh_CN
* /
class BitmapText extends DisplayObject {
/ * *
* Create an egret . BitmapText object
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 创 建 一 个 egret . BitmapText 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
protected createNativeDisplayObject ( ) : void ;
private $smoothing ;
/ * *
* Whether or not is smoothed when scaled .
* @default true 。
* @version Egret 3.0
* @platform Web
* @language en_US
* /
/ * *
* 控 制 在 缩 放 时 是 否 进 行 平 滑 处 理 。
* @default true 。
* @version Egret 3.0
* @platform Web
* @language zh_CN
* /
smoothing : boolean ;
private $text ;
/ * *
* A string to display in the text field .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 要 显 示 的 文 本 内 容
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
text : string ;
/ * *
* @private
* /
$setText ( value : string ) : boolean ;
protected $textFieldWidth : number ;
/ * *
* @private
* /
$getWidth ( ) : number ;
/ * *
* @private
* /
$setWidth ( value : number ) : boolean ;
private $textLinesChanged ;
/ * *
* @private
* /
$invalidateContentBounds ( ) : void ;
protected $textFieldHeight : number ;
/ * *
* @private
* /
$getHeight ( ) : number ;
/ * *
* @private
* /
$setHeight ( value : number ) : boolean ;
protected $font : BitmapFont ;
protected $fontStringChanged : boolean ;
/ * *
* The name of the font to use , or a comma - separated list of font names , the type of value must be BitmapFont .
* @default null
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 要 使 用 的 字 体 的 名 称 或 用 逗 号 分 隔 的 字 体 名 称 列 表 , 类 型 必 须 是 BitmapFont 。
* @default null
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
font : Object ;
$setFont ( value : any ) : boolean ;
private $lineSpacing ;
/ * *
/ * *
* An integer representing the amount of vertical space between lines .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 整 数 , 表 示 行 与 行 之 间 的 垂 直 间 距 量
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
lineSpacing : number ;
$setLineSpacing ( value : number ) : boolean ;
private $letterSpacing ;
/ * *
* An integer representing the amount of distance between characters .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 整 数 , 表 示 字 符 之 间 的 距 离 。
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
letterSpacing : number ;
$setLetterSpacing ( value : number ) : boolean ;
private $textAlign ;
/ * *
* Horizontal alignment of text .
* @default : egret . HorizontalAlign . LEFT
* @version Egret 2.5 . 6
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 的 水 平 对 齐 方 式 。
* @default : egret . HorizontalAlign . LEFT
* @version Egret 2.5 . 6
* @platform Web , Native
* @language zh_CN
* /
textAlign : string ;
$setTextAlign ( value : string ) : boolean ;
private $verticalAlign ;
/ * *
* Vertical alignment of text .
* @default : egret . VerticalAlign . TOP
* @version Egret 2.5 . 6
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 字 的 垂 直 对 齐 方 式 。
* @default : egret . VerticalAlign . TOP
* @version Egret 2.5 . 6
* @platform Web , Native
* @language zh_CN
* /
verticalAlign : string ;
$setVerticalAlign ( value : string ) : boolean ;
/ * *
* A ratio of the width of the space character . This value is multiplied by the height of the first character is the space character width .
* @default 0.33
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 空 格 字 符 的 宽 度 比 例 。 这 个 数 值 乘 以 第 一 个 字 符 的 高 度 即 为 空 格 字 符 的 宽 。
* @default 0.33
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static EMPTY_FACTOR : number ;
/ * *
* @private
* /
$updateRenderNode ( ) : void ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
private $textWidth ;
/ * *
* Get the BitmapText measured width
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 位 图 文 本 测 量 宽 度
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textWidth : number ;
private $textHeight ;
/ * *
* Get Text BitmapText height
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 位 图 文 本 测 量 高 度
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textHeight : number ;
/ * *
* @private
* /
private $textOffsetX ;
/ * *
* @private
* /
private $textOffsetY ;
/ * *
* @private
* /
private $textStartX ;
/ * *
* @private
* /
private $textStartY ;
/ * *
* @private
* /
private textLines ;
/ * *
* @private 每 一 行 文 字 的 宽 度
* /
private $textLinesWidth ;
/ * *
* @private
* /
$lineHeights : number [ ] ;
/ * *
* @private
*
* @returns
* /
$getTextLines ( ) : string [ ] ;
}
}
declare namespace egret {
/ * *
* The HorizontalAlign class defines the possible values for the horizontal alignment .
* @see egret . TextField # textAlign
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* HorizontalAlign 类 为 水 平 对 齐 方 式 定 义 可 能 的 值 。
* @see egret . TextField # textAlign
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class HorizontalAlign {
/ * *
* Horizontally align content to the left of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 内 容 与 容 器 的 左 侧 对 齐 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static LEFT : string ;
/ * *
* Horizontally align content to the right of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 内 容 与 容 器 的 右 侧 对 齐 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static RIGHT : string ;
/ * *
* Horizontally align content in the center of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 容 器 的 水 平 中 心 对 齐 内 容 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static CENTER : string ;
/ * *
* Horizontal alignment with both edges .
* Note : TextFiled does not support this alignment method .
* @constant egret . HorizontalAlign . JUSTIFY
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 水 平 两 端 对 齐 。
* 注 意 : TextFiled不支持此对齐方式 。
* @constant egret . HorizontalAlign . JUSTIFY
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static JUSTIFY : string ;
/ * *
* Align the content of the child items , relative to the container . This operation will adjust uniformly the size of all the child items to be the Content Width \ " of the container \" .
* The Content Width \ " of the container \" is the size of the max . child item . If the size of all child items are less than the width of the container , they will be adjusted to the width of the container .
* Note : TextFiled does not support this alignment method .
* @constant egret . HorizontalAlign . CONTENT_JUSTIFY
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 相 对 于 容 器 对 子 项 进 行 内 容 对 齐 。 这 会 将 所 有 子 项 的 大 小 统 一 调 整 为 容 器 的 "内容宽度" 。
* 容 器 的 "内容宽度" 是 最 大 子 项 的 大 小 , 如 果 所 有 子 项 都 小 于 容 器 的 宽 度 , 则 会 将 所 有 子 项 的 大 小 调 整 为 容 器 的 宽 度 。
* 注 意 : TextFiled不支持此对齐方式 。
* @constant egret . HorizontalAlign . CONTENT_JUSTIFY
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static CONTENT_JUSTIFY : string ;
}
}
declare namespace egret {
/ * *
* Convert the text in html format to the object that can be assigned to the egret . TextField # textFlow property
* @see http : //edn.egret.com/cn/docs/page/146 Text mixed in a variety of style
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / HtmlTextParser . ts
* @language en_US
* /
/ * *
* 将 html格式文本转换为可赋值给 egret . TextField # textFlow 属 性 的 对 象
* @see http : //edn.egret.com/cn/docs/page/146 多种样式文本混合
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / HtmlTextParser . ts
* @language zh_CN
* /
class HtmlTextParser {
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
constructor ( ) ;
private replaceArr ;
private initReplaceArr ( ) ;
/ * *
* @private
*
* @param value
* @returns
* /
private replaceSpecial ( value ) ;
/ * *
* @private
* /
private resutlArr ;
/ * *
* Convert the text in html format to the object that can be assigned to the egret . TextField # textFlow property
* @param htmltext { string } Text in html
* @returns { Array < egret.ITextElement > } 可 赋 值 给 egret . TextField # textFlow Object that can be assigned to the egret . TextField # textFlow property
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 html格式文本转换为可赋值给 egret . TextField # textFlow 属 性 的 对 象
* @param htmltext { string } html文本
* @returns { Array < egret.ITextElement > } 可 赋 值 给 egret . TextField # textFlow 属 性 的 对 象
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
parse ( htmltext : string ) : egret . ITextElement [ ] ;
parser ( htmltext : string ) : Array < egret.ITextElement > ;
/ * *
* @private
*
* @param value
* /
private addToResultArr ( value ) ;
private changeStringToObject ( str ) ;
/ * *
* @private
*
* @returns
* /
private getHeadReg ( ) ;
/ * *
* @private
*
* @param info
* @param head
* @param value
* /
private addProperty ( info , head , value ) ;
/ * *
* @private
* /
private stackArray ;
/ * *
* @private
*
* @param infoStr
* /
private addToArray ( infoStr ) ;
}
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
interface IHitTextElement {
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
lineIndex : number ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
textElementIndex : number ;
}
/ * *
* Text Style
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 样 式
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface ITextStyle {
/ * *
* text color
* @version Egret 2.4
* @platform Web , Native
* @see http : //edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构
* @language en_US
* /
/ * *
* 颜 色 值
* @version Egret 2.4
* @platform Web , Native
* @see http : //edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构
* @language zh_CN
* /
textColor? : number ;
/ * *
* stroke color
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 描 边 颜 色 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
strokeColor? : number ;
/ * *
* size
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 字 号
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
size? : number ;
/ * *
* stroke width
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 描 边 大 小
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
stroke? : number ;
/ * *
* whether bold
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 加 粗
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bold? : boolean ;
/ * *
* whether italic
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 倾 斜
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
italic? : boolean ;
/ * *
* fontFamily
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 字 体 名 称
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
fontFamily? : string ;
/ * *
* Link events or address
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 链 接 事 件 或 者 地 址
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
href? : string ;
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
target? : string ;
/ * *
* Is underlined
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 加 下 划 线
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
underline? : boolean ;
}
/ * *
* Used to build the basic structure of text with a variety of mixed styles , mainly for setting textFlow property
* @see http : //edn.egret.com/cn/docs/page/146 Text mixed in a variety of style
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 于 建 立 多 种 样 式 混 合 文 本 的 基 本 结 构 , 主 要 用 于 设 置 textFlow 属 性
* @see http : //edn.egret.com/cn/docs/page/146 多种样式文本混合
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface ITextElement {
/ * *
* String Content
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 字 符 串 内 容
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
text : string ;
/ * *
* Text Style
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 样 式
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
style? : ITextStyle ;
}
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
interface IWTextElement extends ITextElement {
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
width : number ;
}
/ * *
* 文 本 最 终 解 析 的 一 行 数 据 格 式
* @private
* @version Egret 2.4
* @platform Web , Native
* /
interface ILineElement {
/ * *
* 文 本 占 用 宽 度
* @version Egret 2.4
* @platform Web , Native
* /
width : number ;
/ * *
* 文 本 占 用 高 度
* @version Egret 2.4
* @platform Web , Native
* /
height : number ;
/ * *
* 当 前 文 本 字 符 总 数 量 ( 包 括 换 行 符 )
* @version Egret 2.4
* @platform Web , Native
* /
charNum : number ;
/ * *
* 是 否 含 有 换 行 符
* @version Egret 2.4
* @platform Web , Native
* /
hasNextLine : boolean ;
/ * *
* 本 行 文 本 内 容
* @version Egret 2.4
* @platform Web , Native
* /
elements : Array < IWTextElement > ;
}
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
class InputController extends HashObject {
/ * *
* @private
* /
stageText : egret.StageText ;
/ * *
* @private
* /
private stageTextAdded ;
/ * *
* @private
* /
private _text ;
/ * *
* @private
* /
private _isFocus ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
constructor ( ) ;
/ * *
*
* @param text
* @version Egret 2.4
* @platform Web , Native
* /
init ( text : TextField ) : void ;
/ * *
* @private
*
* /
_addStageText ( ) : void ;
/ * *
* @private
*
* /
_removeStageText ( ) : void ;
/ * *
* @private
*
* @returns
* /
_getText ( ) : string ;
/ * *
* @private
*
* @param value
* /
_setText ( value : string ) : void ;
/ * *
* @private
* /
_setColor ( value : number ) : void ;
/ * *
* @private
*
* @param event
* /
private focusHandler ( event ) ;
/ * *
* @private
*
* @param event
* /
private blurHandler ( event ) ;
private tempStage ;
private onMouseDownHandler ( event ) ;
$onFocus ( ) : void ;
private onStageDownHandler ( event ) ;
/ * *
* @private
*
* @param event
* /
private updateTextHandler ( event ) ;
/ * *
* @private
*
* /
private resetText ( ) ;
/ * *
* @private
*
* /
_hideInput ( ) : void ;
/ * *
* @private
*
* /
private updateInput ( ) ;
/ * *
* @private
*
* /
_updateProperties ( ) : void ;
}
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
interface StageText extends EventDispatcher {
/ * *
* @private
* /
$textfield : egret.TextField ;
/ * *
* @private
*
* @param textfield
* /
$setTextField ( textfield : egret.TextField ) : boolean ;
/ * *
* @private
*
* /
$resetStageText ( ) : void ;
/ * *
* @private
*
* @returns
* /
$getText ( ) : string ;
/ * *
* @private
*
* @param value
* /
$setText ( value : string ) : boolean ;
/ * *
* @private
*
* @param value
* /
$setColor ( value : number ) : boolean ;
/ * *
* @private
*
* /
$show ( ) : void ;
/ * *
* @private
*
* /
$hide ( ) : void ;
/ * *
* @private
*
* /
$addToStage ( ) : void ;
/ * *
* @private
*
* /
$removeFromStage ( ) : void ;
/ * *
* @private
*
* /
$onBlur ( ) : void ;
}
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
let StageText : {
new ( ) : StageText ;
} ;
}
declare namespace egret . sys {
/ * *
* @private
* /
const enum TextKeys {
/ * *
* @private
* /
fontSize = 0 ,
/ * *
* @private
* /
lineSpacing = 1 ,
/ * *
* @private
* /
textColor = 2 ,
/ * *
* @private
* /
textFieldWidth = 3 ,
/ * *
* @private
* /
textFieldHeight = 4 ,
/ * *
* @private
* /
textWidth = 5 ,
/ * *
* @private
* /
textHeight = 6 ,
/ * *
* @private
* /
textDrawWidth = 7 ,
/ * *
* @private
* /
fontFamily = 8 ,
/ * *
* @private
* /
textAlign = 9 ,
/ * *
* @private
* /
verticalAlign = 10 ,
/ * *
* @private
* /
textColorString = 11 ,
/ * *
* @private
* /
fontString = 12 ,
/ * *
* @private
* /
text = 13 ,
/ * *
* @private
* /
measuredWidths = 14 ,
/ * *
* @private
* /
bold = 15 ,
/ * *
* @private
* /
italic = 16 ,
/ * *
* @private
* /
fontStringChanged = 17 ,
/ * *
* @private
* /
textLinesChanged = 18 ,
/ * *
* @private
* /
wordWrap = 19 ,
/ * *
* @private
* /
displayAsPassword = 20 ,
/ * *
* @private
* /
maxChars = 21 ,
/ * *
* @private
* /
selectionActivePosition = 22 ,
/ * *
* @private
* /
selectionAnchorPosition = 23 ,
/ * *
* @private
* /
type = 24 ,
/ * *
* @private
* /
strokeColor = 25 ,
/ * *
* @private
* /
strokeColorString = 26 ,
/ * *
* @private
* /
stroke = 27 ,
/ * *
* @private
* /
scrollV = 28 ,
/ * *
* @private
* /
numLines = 29 ,
/ * *
* @private
* /
multiline = 30 ,
/ * *
* @private
* /
border = 31 ,
/ * *
* @private
* /
borderColor = 32 ,
/ * *
* @private
* /
background = 33 ,
/ * *
* @private
* /
backgroundColor = 34 ,
/ * *
* @private
* /
restrictAnd = 35 ,
/ * *
* @private
* /
restrictNot = 36 ,
/ * *
* @private
* /
inputType = 37 ,
/ * *
* @private
* /
textLinesChangedForNativeRender = 38 ,
}
}
declare namespace egret {
/ * *
* TextField is the text rendering class of egret . It conducts rendering by using the browser / device API . Due to different ways of font rendering in different browsers / devices , there may be differences in the rendering
* If developers expect no differences among all platforms , please use BitmapText
* @see http : //edn.egret.com/cn/docs/page/141 Create Text
*
* @event egret . Event . CHANGE Dispatched when entering text user input 。
* @event egret . FocusEvent . FOCUS_IN Dispatched after the focus to enter text .
* @event egret . FocusEvent . FOCUS_OUT Enter the text loses focus after dispatch .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / TextField . ts
* @language en_US
* /
/ * *
* TextField是egret的文本渲染类 , 采 用 浏 览 器 / 设 备 的 API进行渲染 , 在 不 同 的 浏 览 器 / 设 备 中 由 于 字 体 渲 染 方 式 不 一 , 可 能 会 有 渲 染 差 异
* 如 果 开 发 者 希 望 所 有 平 台 完 全 无 差 异 , 请 使 用 BitmapText
* @see http : //edn.egret.com/cn/docs/page/141 创建文本
*
* @event egret . Event . CHANGE 输 入 文 本 有 用 户 输 入 时 调 度 。
* @event egret . FocusEvent . FOCUS_IN 聚 焦 输 入 文 本 后 调 度 。
* @event egret . FocusEvent . FOCUS_OUT 输 入 文 本 失 去 焦 点 后 调 度 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / text / TextField . ts
* @language zh_CN
* /
class TextField extends DisplayObject {
/ * *
* default fontFamily
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 默 认 文 本 字 体
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static default_fontFamily : string ;
/ * *
* default size in pixels of text
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 默 认 文 本 字 号 大 小
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
static default_size : number ;
/ * *
* default color of the text .
* @version Egret 3.2 . 1
* @platform Web , Native
* @language en_US
* /
/ * *
* 默 认 文 本 颜 色
* @version Egret 3.2 . 1
* @platform Web , Native
* @language zh_CN
* /
static default_textColor : number ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
constructor ( ) ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* /
$TextField : Object ;
/ * *
* @private
* /
private isInput ( ) ;
$inputEnabled : boolean ;
$setTouchEnabled ( value : boolean ) : void ;
/ * *
* The name of the font to use , or a comma - separated list of font names .
* @default "Arial"
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 要 使 用 的 字 体 的 名 称 或 用 逗 号 分 隔 的 字 体 名 称 列 表 。
* @default "Arial"
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
fontFamily : string ;
$setFontFamily ( value : string ) : boolean ;
/ * *
* The size in pixels of text
* @default 30
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 的 字 号 大 小 。
* @default 30
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
size : number ;
$setSize ( value : number ) : boolean ;
/ * *
* Specifies whether the text is boldface .
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 显 示 为 粗 体 。
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
bold : boolean ;
$setBold ( value : boolean ) : boolean ;
/ * *
* Determines whether the text is italic font .
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 是 否 显 示 为 斜 体 。
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
italic : boolean ;
$setItalic ( value : boolean ) : boolean ;
/ * *
* @private
*
* /
private invalidateFontString ( ) ;
/ * *
* Horizontal alignment of text .
* @default : egret . HorizontalAlign . LEFT
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 的 水 平 对 齐 方 式 。
* @default : egret . HorizontalAlign . LEFT
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
textAlign : string ;
$setTextAlign ( value : string ) : boolean ;
/ * *
* Vertical alignment of text .
* @default : egret . VerticalAlign . TOP
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 字 的 垂 直 对 齐 方 式 。
* @default : egret . VerticalAlign . TOP
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
verticalAlign : string ;
$setVerticalAlign ( value : string ) : boolean ;
/ * *
* An integer representing the amount of vertical space between lines .
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 整 数 , 表 示 行 与 行 之 间 的 垂 直 间 距 量
* @default 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
lineSpacing : number ;
$setLineSpacing ( value : number ) : boolean ;
/ * *
* Color of the text .
* @default 0x000000
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 颜 色
* @default 0x000000
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
textColor : number ;
$setTextColor ( value : number ) : boolean ;
/ * *
* A Boolean value that indicates whether the text field word wrap . If the value is true , then the text field by word wrap ;
* if the value is false , the text field by newline characters .
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 一 个 布 尔 值 , 表 示 文 本 字 段 是 否 按 单 词 换 行 。 如 果 值 为 true , 则 该 文 本 字 段 按 单 词 换 行 ;
* 如 果 值 为 false , 则 该 文 本 字 段 按 字 符 换 行 。
* @default false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
wordWrap : boolean ;
$setWordWrap ( value : boolean ) : void ;
protected inputUtils : InputController ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Type of the text field .
* Any one of the following TextFieldType constants : TextFieldType.DYNAMIC ( specifies the dynamic text field that users can not edit ) , or TextFieldType . INPUT ( specifies the dynamic text field that users can edit ) .
* @default egret . TextFieldType . DYNAMIC
* @language en_US
* /
/ * *
* 文 本 字 段 的 类 型 。
* 以 下 TextFieldType 常 量 中 的 任 一 个 : TextFieldType . DYNAMIC ( 指 定 用 户 无 法 编 辑 的 动 态 文 本 字 段 ) , 或 TextFieldType . INPUT ( 指 定 用 户 可 以 编 辑 的 输 入 文 本 字 段 ) 。
* @default egret . TextFieldType . DYNAMIC
* @language zh_CN
* /
type : string ;
/ * *
* @private
*
* @param value
* /
$setType ( value : string ) : boolean ;
/ * *
* @version Egret 3.1 . 2
* @platform Web , Native
* /
/ * *
* Pop - up keyboard type .
* Any of a TextFieldInputType constants .
* @language en_US
* /
/ * *
* 弹 出 键 盘 的 类 型 。
* TextFieldInputType 常 量 中 的 任 一 个 。
* @language zh_CN
* /
inputType : string ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Serve as a string of the current text field in the text
* @language en_US
* /
/ * *
* 作 为 文 本 字 段 中 当 前 文 本 的 字 符 串
* @language zh_CN
* /
text : string ;
/ * *
* @private
*
* @returns
* /
$getText ( ) : string ;
/ * *
* @private
*
* @param value
* /
$setBaseText ( value : string ) : boolean ;
/ * *
* @private
*
* @param value
* /
$setText ( value : string ) : boolean ;
/ * *
* Specify whether the text field is a password text field .
* If the value of this property is true , the text field is treated as a password text field and hides the input characters using asterisks instead of the actual characters . If false , the text field is not treated as a password text field .
* @default false
* @language en_US
* /
/ * *
* 指 定 文 本 字 段 是 否 是 密 码 文 本 字 段 。
* 如 果 此 属 性 的 值 为 true , 则 文 本 字 段 被 视 为 密 码 文 本 字 段 , 并 使 用 星 号 而 不 是 实 际 字 符 来 隐 藏 输 入 的 字 符 。 如 果 为 false , 则 不 会 将 文 本 字 段 视 为 密 码 文 本 字 段 。
* @default false
* @language zh_CN
* /
displayAsPassword : boolean ;
/ * *
* @private
*
* @param value
* /
$setDisplayAsPassword ( value : boolean ) : boolean ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Represent the stroke color of the text .
* Contain three 8 - bit numbers with RGB color components ; for example , 0xFF0000 is red , 0x00FF00 is green .
* @default 0x000000
* @language en_US
* /
/ * *
* 表 示 文 本 的 描 边 颜 色 。
* 包 含 三 个 8 位 RGB 颜 色 成 分 的 数 字 ; 例 如 , 0xFF0000 为 红 色 , 0x00FF00 为 绿 色 。
* @default 0x000000
* @language zh_CN
* /
strokeColor : number ;
/ * *
* @private
*
* @param value
* /
$setStrokeColor ( value : number ) : boolean ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Indicate the stroke width .
* 0 means no stroke .
* @default 0
* @language en_US
* /
/ * *
* 表 示 描 边 宽 度 。
* 0 为 没 有 描 边 。
* @default 0
* @language zh_CN
* /
stroke : number ;
/ * *
* @private
*
* @param value
* /
$setStroke ( value : number ) : boolean ;
/ * *
* The maximum number of characters that the text field can contain , as entered by a user . \ n A script can insert more text than maxChars allows ; the maxChars property indicates only how much text a user can enter . If the value of this property is 0 , a user can enter an unlimited amount of text .
* The default value is 0 .
* @default 0
* @language en_US
* /
/ * *
* 文 本 字 段 中 最 多 可 包 含 的 字 符 数 ( 即 用 户 输 入 的 字 符 数 ) 。
* 脚 本 可 以 插 入 比 maxChars 允 许 的 字 符 数 更 多 的 文 本 ; maxChars 属 性 仅 表 示 用 户 可 以 输 入 多 少 文 本 。 如 果 此 属 性 的 值 为 0 , 则 用 户 可 以 输 入 无 限 数 量 的 文 本 。
* @default 0
* @language zh_CN
* /
maxChars : number ;
/ * *
* @private
*
* @param value
* /
$setMaxChars ( value : number ) : boolean ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Vertical position of text in a text field . scrollV property helps users locate specific passages in a long article , and create scrolling text fields .
* Vertically scrolling units are lines , and horizontal scrolling unit is pixels .
* If the first displayed line is the first line in the text field , scrollV is set to 1 ( instead of 0 ) .
* @language en_US
* /
/ * *
* 文 本 在 文 本 字 段 中 的 垂 直 位 置 。 scrollV 属 性 可 帮 助 用 户 定 位 到 长 篇 文 章 的 特 定 段 落 , 还 可 用 于 创 建 滚 动 文 本 字 段 。
* 垂 直 滚 动 的 单 位 是 行 , 而 水 平 滚 动 的 单 位 是 像 素 。
* 如 果 显 示 的 第 一 行 是 文 本 字 段 中 的 第 一 行 , 则 scrollV 设 置 为 1 ( 而 非 0 ) 。
* @language zh_CN
* /
scrollV : number ;
/ * *
* The maximum value of scrollV
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* scrollV 的 最 大 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly maxScrollV : number ;
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
readonly selectionBeginIndex : number ;
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
readonly selectionEndIndex : number ;
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
readonly caretIndex : number ;
/ * *
* @private
*
* @param beginIndex
* @param endIndex
* /
$setSelection ( beginIndex : number , endIndex : number ) : boolean ;
/ * *
* @private
*
* @returns
* /
$getLineHeight ( ) : number ;
/ * *
* Number of lines of text .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 行 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly numLines : number ;
/ * *
* Indicate whether field is a multiline text field . Note that this property is valid only when the type is TextFieldType . INPUT .
* If the value is true , the text field is multiline ; if the value is false , the text field is a single - line text field . In a field of type TextFieldType . INPUT , the multiline value determines whether the Enter key creates a new line ( a value of false , and the Enter key is ignored ) .
* @default false
* @language en_US
* /
/ * *
* 表 示 字 段 是 否 为 多 行 文 本 字 段 。 注 意 , 此 属 性 仅 在 type为TextFieldType . INPUT时才有效 。
* 如 果 值 为 true , 则 文 本 字 段 为 多 行 文 本 字 段 ; 如 果 值 为 false , 则 文 本 字 段 为 单 行 文 本 字 段 。 在 类 型 为 TextFieldType . INPUT 的 字 段 中 , multiline 值 将 确 定 Enter 键 是 否 创 建 新 行 ( 如 果 值 为 false , 则 将 忽 略 Enter 键 ) 。
* @default false
* @language zh_CN
* /
multiline : boolean ;
/ * *
* @private
*
* @param value
* /
$setMultiline ( value : boolean ) : boolean ;
/ * *
* Indicates a user can enter into the text field character set . If you restrict property is null , you can enter any character . If you restrict property is an empty string , you can not enter any character . If you restrict property is a string of characters , you can enter only characters in the string in the text field . The string is scanned from left to right . You can use a hyphen ( - ) to specify a range . Only restricts user interaction ; a script may put any text into the text field . < br / >
* If the string of characters caret ( ^ ) at the beginning , all characters are initially accepted , then the string are excluded from receiving ^ character . If the string does not begin with a caret ( ^ ) to , any characters are initially accepted and then a string of characters included in the set of accepted characters . < br / >
* The following example allows only uppercase characters , spaces , and numbers in the text field : < br / >
* My_txt . restrict = "A-Z 0-9" ; < br / >
* The following example includes all characters except lowercase letters : < br / >
* My_txt . restrict = "^ a-z" ; < br / >
* If you need to enter characters \ ^ , use two backslash "\\ -" "\\ ^" : < br / >
* Can be used anywhere in the string ^ to rule out including characters and switch between characters , but can only be used to exclude a ^ . The following code includes only uppercase letters except uppercase Q : < br / >
* My_txt . restrict = "A-Z ^ Q" ; < br / >
* @version Egret 2.4
* @platform Web , Native
* @default null
* @language en_US
* /
/ * *
* 表 示 用 户 可 输 入 到 文 本 字 段 中 的 字 符 集 。 如 果 restrict 属 性 的 值 为 null , 则 可 以 输 入 任 何 字 符 。 如 果 restrict 属 性 的 值 为 空 字 符 串 , 则 不 能 输 入 任 何 字 符 。 如 果 restrict 属 性 的 值 为 一 串 字 符 , 则 只 能 在 文 本 字 段 中 输 入 该 字 符 串 中 的 字 符 。 从 左 向 右 扫 描 该 字 符 串 。 可 以 使 用 连 字 符 ( - ) 指 定 一 个 范 围 。 只 限 制 用 户 交 互 ; 脚 本 可 将 任 何 文 本 放 入 文 本 字 段 中 。 < br / >
* 如 果 字 符 串 以 尖 号 ( ^ ) 开 头 , 则 先 接 受 所 有 字 符 , 然 后 从 接 受 字 符 集 中 排 除 字 符 串 中 ^ 之 后 的 字 符 。 如 果 字 符 串 不 以 尖 号 ( ^ ) 开 头 , 则 最 初 不 接 受 任 何 字 符 , 然 后 将 字 符 串 中 的 字 符 包 括 在 接 受 字 符 集 中 。 < br / >
* 下 例 仅 允 许 在 文 本 字 段 中 输 入 大 写 字 符 、 空 格 和 数 字 : < br / >
* my_txt . restrict = "A-Z 0-9" ; < br / >
* 下 例 包 含 除 小 写 字 母 之 外 的 所 有 字 符 : < br / >
* my_txt . restrict = "^a-z" ; < br / >
* 如 果 需 要 输 入 字 符 \ ^ , 请 使 用 2 个 反 斜 杠 "\\-" "\\^" : < br / >
* 可 在 字 符 串 中 的 任 何 位 置 使 用 ^ , 以 在 包 含 字 符 与 排 除 字 符 之 间 进 行 切 换 , 但 是 最 多 只 能 有 一 个 ^ 用 来 排 除 。 下 面 的 代 码 只 包 含 除 大 写 字 母 Q 之 外 的 大 写 字 母 : < br / >
* my_txt . restrict = "A-Z^Q" ; < br / >
* @version Egret 2.4
* @platform Web , Native
* @default null
* @language zh_CN
* /
restrict : string ;
/ * *
* @private
*
* @param value
* /
$setWidth ( value : number ) : boolean ;
/ * *
* @private
*
* @param value
* /
$setHeight ( value : number ) : boolean ;
/ * *
* @private
* 获 取 显 示 宽 度
* /
$getWidth ( ) : number ;
/ * *
* @private
* 获 取 显 示 宽 度
* /
$getHeight ( ) : number ;
/ * *
* @private
* /
private textNode ;
/ * *
* @private
* /
$graphicsNode : sys.GraphicsNode ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Specifies whether the text field has a border .
* If true , the text field has a border . If false , the text field has no border .
* Use borderColor property to set the border color .
* @default false
* @language en_US
* /
/ * *
* 指 定 文 本 字 段 是 否 具 有 边 框 。
* 如 果 为 true , 则 文 本 字 段 具 有 边 框 。 如 果 为 false , 则 文 本 字 段 没 有 边 框 。
* 使 用 borderColor 属 性 来 设 置 边 框 颜 色 。
* @default false
* @language zh_CN
* /
border : boolean ;
/ * *
* @private
* /
$setBorder ( value : boolean ) : void ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* The color of the text field border .
* Even currently is no border can be retrieved or set this property , but only if the text field has the border property is set to true , the color is visible .
* @default 0x000000
* @language en_US
* /
/ * *
* 文 本 字 段 边 框 的 颜 色 。
* 即 使 当 前 没 有 边 框 , 也 可 检 索 或 设 置 此 属 性 , 但 只 有 当 文 本 字 段 已 将 border 属 性 设 置 为 true 时 , 才 可 以 看 到 颜 色 。
* @default 0x000000
* @language zh_CN
* /
borderColor : number ;
/ * *
* @private
* /
$setBorderColor ( value : number ) : void ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Specifies whether the text field has a background fill .
* If true , the text field has a background fill . If false , the text field has no background fill .
* Use the backgroundColor property to set the background color of the text field .
* @default false
* @language en_US
* /
/ * *
* 指 定 文 本 字 段 是 否 具 有 背 景 填 充 。
* 如 果 为 true , 则 文 本 字 段 具 有 背 景 填 充 。 如 果 为 false , 则 文 本 字 段 没 有 背 景 填 充 。
* 使 用 backgroundColor 属 性 来 设 置 文 本 字 段 的 背 景 颜 色 。
* @default false
* @language zh_CN
* /
background : boolean ;
/ * *
* @private
* /
$setBackground ( value : boolean ) : void ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Color of the text field background .
* Even currently is no background , can be retrieved or set this property , but only if the text field has the background property set to true , the color is visible .
* @default 0xFFFFFF
* @language en_US
* /
/ * *
* 文 本 字 段 背 景 的 颜 色 。
* 即 使 当 前 没 有 背 景 , 也 可 检 索 或 设 置 此 属 性 , 但 只 有 当 文 本 字 段 已 将 background 属 性 设 置 为 true 时 , 才 可 以 看 到 颜 色 。
* @default 0xFFFFFF
* @language zh_CN
* /
backgroundColor : number ;
/ * *
* @private
* /
$setBackgroundColor ( value : number ) : void ;
/ * *
* @private
*
* /
private fillBackground ( lines ? ) ;
/ * *
* Enter the text automatically entered into the input state , the input type is text only and may only be invoked in the user interaction .
* @version Egret 3.0 . 8
* @platform Web , Native
* @language en_US
* /
/ * *
* 输 入 文 本 自 动 进 入 到 输 入 状 态 , 仅 在 类 型 是 输 入 文 本 并 且 是 在 用 户 交 互 下 才 可 以 调 用 。
* @version Egret 3.0 . 8
* @platform Web , Native
* @language zh_CN
* /
setFocus ( ) : void ;
/ * *
* @private
*
* /
$onRemoveFromStage ( ) : void ;
/ * *
* @private
*
* @param stage
* @param nestLevel
* /
$onAddToStage ( stage : Stage , nestLevel : number ) : void ;
$invalidateTextField ( ) : void ;
$getRenderBounds ( ) : Rectangle ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
$updateRenderNode ( ) : void ;
/ * *
* @private
* /
private isFlow ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* Set rich text
* @language en_US
* /
/ * *
* 设 置 富 文 本
* @see http : //edn.egret.com/cn/index.php/article/index/id/146
* @language zh_CN
* /
textFlow : Array < egret.ITextElement > ;
/ * *
* @private
*
* @param text
* @returns
* /
private changeToPassText ( text ) ;
/ * *
* @private
* /
private textArr ;
/ * *
* @private
*
* @param textArr
* /
private setMiddleStyle ( textArr ) ;
/ * *
* Get the text measured width
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 文 本 测 量 宽 度
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textWidth : number ;
/ * *
* Get Text measuring height
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 文 本 测 量 高 度
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly textHeight : number ;
/ * *
* @private
* @param text
* @version Egret 2.4
* @platform Web , Native
* /
appendText ( text : string ) : void ;
/ * *
* @private
* @param element
* @version Egret 2.4
* @platform Web , Native
* /
appendElement ( element : egret.ITextElement ) : void ;
/ * *
* @private
* /
private linesArr ;
$getLinesArr ( ) : Array < egret.ILineElement > ;
/ * *
* @private
*
* @returns
* /
$getLinesArr2 ( ) : Array < egret.ILineElement > ;
/ * *
* @private
* /
$isTyping : boolean ;
/ * *
* @private
* /
$setIsTyping ( value : boolean ) : void ;
/ * *
* @private
* 返 回 要 绘 制 的 下 划 线 列 表
* /
private drawText ( ) ;
private addEvent ( ) ;
private removeEvent ( ) ;
private onTapHandler ( e ) ;
}
interface TextField {
addEventListener < Z > ( type : "link" , listener : ( this : Z , e : TextEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener < Z > ( type : "focusIn" | "focusOut" , listener : ( this : Z , e : FocusEvent ) = > void , thisObject : Z , useCapture? : boolean , priority? : number ) : any ;
addEventListener ( type : string , listener : Function , thisObject : any , useCapture? : boolean , priority? : number ) : any ;
}
}
declare namespace egret {
/ * *
* TextFieldInputType class is an enumeration of constant value used in setting the inputType property of the TextField class .
* @version Egret 3.1 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* TextFieldInputType 类 是 在 设 置 TextField 类 的 inputType 属 性 时 使 用 的 常 数 值 的 枚 举 。
* @version Egret 3.1 . 2
* @platform Web , Native
* @language zh_CN
* /
class TextFieldInputType {
/ * *
* The default
* @version Egret 3.1 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* 默 认 input 类 型
* @version Egret 3.1 . 2
* @platform Web , Native
* @language zh_CN
* /
static TEXT : string ;
/ * *
* Telephone Number Inputs
* @version Egret 3.1 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* 电 话 号 码 input 类 型
* @version Egret 3.1 . 2
* @platform Web , Native
* @language zh_CN
* /
static TEL : string ;
/ * *
* Password Inputs
* @version Egret 3.1 . 2
* @platform Web , Native
* @language en_US
* /
/ * *
* password 类 型
* @version Egret 3.1 . 2
* @platform Web , Native
* @language zh_CN
* /
static PASSWORD : string ;
}
}
declare namespace egret {
/ * *
* TextFieldType class is an enumeration of constant value used in setting the type property of the TextField class .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* TextFieldType 类 是 在 设 置 TextField 类 的 type 属 性 时 使 用 的 常 数 值 的 枚 举 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class TextFieldType {
/ * *
* Used to specify dynamic text
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 于 指 定 动 态 文 本
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static DYNAMIC : string ;
/ * *
* Used to specify the input text
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 用 于 指 定 输 入 文 本
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static INPUT : string ;
}
}
declare namespace egret {
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
class TextFieldUtils {
/ * *
* 获 取 第 一 个 绘 制 的 行 数
* @param textfield 文 本
* @returns { number } 行 数 , 从 0 开 始
* @private
* /
static $getStartLine ( textfield : egret.TextField ) : number ;
/ * *
* 获 取 水 平 比 例
* @param textfield 文 本
* @returns { number } 水 平 比 例
* @private
* /
static $getHalign ( textfield : egret.TextField ) : number ;
/ * *
* @private
*
* @param textfield
* @returns
* /
static $getTextHeight ( textfield : egret.TextField ) : number ;
/ * *
* 获 取 垂 直 比 例
* @param textfield 文 本
* @returns { number } 垂 直 比 例
* @private
* /
static $getValign ( textfield : egret.TextField ) : number ;
/ * *
* 根 据 x 、 y获取文本项
* @param textfield 文 本
* @param x x坐标值
* @param y y坐标值
* @returns 文 本 单 项
* @private
* /
static $getTextElement ( textfield : egret.TextField , x : number , y : number ) : ITextElement ;
/ * *
* 获 取 文 本 点 击 块
* @param textfield 文 本
* @param x x坐标值
* @param y y坐标值
* @returns 文 本 点 击 块
* @private
* /
static $getHit ( textfield : egret.TextField , x : number , y : number ) : IHitTextElement ;
/ * *
* 获 取 当 前 显 示 多 少 行
* @param textfield 文 本
* @returns { number } 显 示 的 行 数
* @private
* /
static $getScrollNum ( textfield : egret.TextField ) : number ;
}
}
/ * *
* @private
* /
declare namespace egret . sys {
/ * *
* 测 量 文 本 在 指 定 样 式 下 的 宽 度 。
* @param text 要 测 量 的 文 本 内 容 。
* @param fontFamily 字 体 名 称
* @param fontSize 字 体 大 小
* @param bold 是 否 粗 体
* @param italic 是 否 斜 体
* /
let measureText : ( text : string , fontFamily : string , fontSize : number , bold : boolean , italic : boolean ) = > number ;
}
declare namespace egret {
/ * *
* The VerticalAlign class defines the possible values for the vertical alignment .
* @see egret . TextField # verticalAlign
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* VerticalAlign 类 为 垂 直 对 齐 方 式 定 义 可 能 的 值 。
* @see egret . TextField # verticalAlign
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class VerticalAlign {
/ * *
* Vertically align content to the top of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 内 容 与 容 器 的 顶 部 对 齐 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static TOP : string ;
/ * *
* Vertically align content to the bottom of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 内 容 与 容 器 的 底 部 对 齐 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static BOTTOM : string ;
/ * *
* Vertically align content in the middle of the container .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 容 器 的 垂 直 中 心 对 齐 内 容 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static MIDDLE : string ;
/ * *
* Vertical alignment with both edges
* Note : TextFiled does not support this alignment method . "
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 垂 直 两 端 对 齐
* 注 意 : TextFiled不支持此对齐方式 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static JUSTIFY : string ;
/ * *
* Align the content of the child items , relative to the container . This operation will adjust uniformly the size of all the child items to be the Content Height \ " of the container \" .
* The Content Height \ " of the container \" is the size of the max . child item . If the size of all child items are less than the height of the container , they will be adjusted to the height of the container .
* Note : TextFiled does not support this alignment method .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 相 对 于 容 器 对 子 项 进 行 内 容 对 齐 。 这 会 将 所 有 子 项 的 大 小 统 一 调 整 为 容 器 的 "内容高度" 。
* 容 器 的 "内容高度" 是 最 大 子 项 的 大 小 , 如 果 所 有 子 项 都 小 于 容 器 的 高 度 , 则 会 将 所 有 子 项 的 大 小 调 整 为 容 器 的 高 度 。
* 注 意 : TextFiled不支持此对齐方式 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static CONTENT_JUSTIFY : string ;
}
}
declare namespace egret {
/ * *
* @language en_US
* The Base64Util class provides methods for encoding and decoding base64 .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / Base64Util . ts
* /
/ * *
* @language zh_CN
* Base64Util 类 提 供 用 于 编 解 码 base64的方法 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / Base64Util . ts
* /
class Base64Util {
/ * *
* @language en_US
* encode base64 .
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* @language zh_CN
* 编 码 base64 。
* @version Egret 2.4
* @platform Web , Native
* /
static encode ( arraybuffer : ArrayBuffer ) : string ;
/ * *
* @language en_US
* decode base64 .
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* @language zh_CN
* 解 码 base64 。
* @version Egret 2.4
* @platform Web , Native
* /
static decode ( base64 : string ) : ArrayBuffer ;
}
}
/ * *
* @private
* /
declare let chars : string ;
/ * *
* @private
* /
declare let lookup : Uint8Array ;
declare namespace egret {
/ * *
* The Endian class contains values that denote the byte order used to represent multibyte numbers .
* The byte order is either bigEndian ( most significant byte first ) or littleEndian ( least significant byte first ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* Endian 类 中 包 含 一 些 值 , 它 们 表 示 用 于 表 示 多 字 节 数 字 的 字 节 顺 序 。
* 字 节 顺 序 为 bigEndian ( 最 高 有 效 字 节 位 于 最 前 ) 或 littleEndian ( 最 低 有 效 字 节 位 于 最 前 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class Endian {
/ * *
* Indicates the least significant byte of the multibyte number appears first in the sequence of bytes .
* The hexadecimal number 0x12345678 has 4 bytes ( 2 hexadecimal digits per byte ) . The most significant byte is 0x12 . The least significant byte is 0x78 . ( For the equivalent decimal number , 305419896 , the most significant digit is 3 , and the least significant digit is 6 ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 多 字 节 数 字 的 最 低 有 效 字 节 位 于 字 节 序 列 的 最 前 面 。
* 十 六 进 制 数 字 0x12345678 包 含 4 个 字 节 ( 每 个 字 节 包 含 2 个 十 六 进 制 数 字 ) 。 最 高 有 效 字 节 为 0x12 。 最 低 有 效 字 节 为 0x78 。 ( 对 于 等 效 的 十 进 制 数 字 305419896 , 最 高 有 效 数 字 是 3 , 最 低 有 效 数 字 是 6 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static LITTLE_ENDIAN : string ;
/ * *
* Indicates the most significant byte of the multibyte number appears first in the sequence of bytes .
* The hexadecimal number 0x12345678 has 4 bytes ( 2 hexadecimal digits per byte ) . The most significant byte is 0x12 . The least significant byte is 0x78 . ( For the equivalent decimal number , 305419896 , the most significant digit is 3 , and the least significant digit is 6 ) .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 表 示 多 字 节 数 字 的 最 高 有 效 字 节 位 于 字 节 序 列 的 最 前 面 。
* 十 六 进 制 数 字 0x12345678 包 含 4 个 字 节 ( 每 个 字 节 包 含 2 个 十 六 进 制 数 字 ) 。 最 高 有 效 字 节 为 0x12 。 最 低 有 效 字 节 为 0x78 。 ( 对 于 等 效 的 十 进 制 数 字 305419896 , 最 高 有 效 数 字 是 3 , 最 低 有 效 数 字 是 6 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static BIG_ENDIAN : string ;
}
const enum EndianConst {
LITTLE_ENDIAN = 0 ,
BIG_ENDIAN = 1 ,
}
/ * *
* The ByteArray class provides methods and attributes for optimized reading and writing as well as dealing with binary data .
* Note : The ByteArray class is applied to the advanced developers who need to access data at the byte layer .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / ByteArray . ts
* @language en_US
* /
/ * *
* ByteArray 类 提 供 用 于 优 化 读 取 、 写 入 以 及 处 理 二 进 制 数 据 的 方 法 和 属 性 。
* 注 意 : ByteArray 类 适 用 于 需 要 在 字 节 层 访 问 数 据 的 高 级 开 发 人 员 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / ByteArray . ts
* @language zh_CN
* /
class ByteArray {
/ * *
* @private
* /
protected bufferExtSize : number ;
protected data : DataView ;
protected _bytes : Uint8Array ;
/ * *
* @private
* /
protected _position : number ;
/ * *
*
* 已 经 使 用 的 字 节 偏 移 量
* @protected
* @type { number }
* @memberOf ByteArray
* /
protected write_position : number ;
/ * *
* Changes or reads the byte order ; egret . EndianConst . BIG_ENDIAN or egret . EndianConst . LITTLE_EndianConst .
* @default egret . EndianConst . BIG_ENDIAN
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 更 改 或 读 取 数 据 的 字 节 顺 序 ; egret . EndianConst . BIG_ENDIAN 或 egret . EndianConst . LITTLE_ENDIAN 。
* @default egret . EndianConst . BIG_ENDIAN
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
endian : string ;
protected $endian : EndianConst ;
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
constructor ( buffer? : ArrayBuffer | Uint8Array , bufferExtSize? : number ) ;
/ * *
* @deprecated
* @version Egret 2.4
* @platform Web , Native
* /
setArrayBuffer ( buffer : ArrayBuffer ) : void ;
/ * *
* 可 读 的 剩 余 字 节 数
*
* @returns
*
* @memberOf ByteArray
* /
readonly readAvailable : number ;
/ * *
* @private
* /
buffer : ArrayBuffer ;
readonly rawBuffer : ArrayBuffer ;
readonly bytes : Uint8Array ;
/ * *
* @private
* @version Egret 2.4
* @platform Web , Native
* /
/ * *
* @private
* /
dataView : DataView ;
/ * *
* @private
* /
readonly bufferOffset : number ;
/ * *
* The current position of the file pointer ( in bytes ) to move or return to the ByteArray object . The next time you start reading reading method call in this position , or will start writing in this position next time call a write method .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 文 件 指 针 的 当 前 位 置 ( 以 字 节 为 单 位 ) 移 动 或 返 回 到 ByteArray 对 象 中 。 下 一 次 调 用 读 取 方 法 时 将 在 此 位 置 开 始 读 取 , 或 者 下 一 次 调 用 写 入 方 法 时 将 在 此 位 置 开 始 写 入 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
position : number ;
/ * *
* The length of the ByteArray object ( in bytes ) .
* If the length is set to be larger than the current length , the right - side zero padding byte array .
* If the length is set smaller than the current length , the byte array is truncated .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* ByteArray 对 象 的 长 度 ( 以 字 节 为 单 位 ) 。
* 如 果 将 长 度 设 置 为 大 于 当 前 长 度 的 值 , 则 用 零 填 充 字 节 数 组 的 右 侧 。
* 如 果 将 长 度 设 置 为 小 于 当 前 长 度 的 值 , 将 会 截 断 该 字 节 数 组 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
length : number ;
protected _validateBuffer ( value : number ) : void ;
/ * *
* The number of bytes that can be read from the current position of the byte array to the end of the array data .
* When you access a ByteArray object , the bytesAvailable property in conjunction with the read methods each use to make sure you are reading valid data .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 可 从 字 节 数 组 的 当 前 位 置 到 数 组 末 尾 读 取 的 数 据 的 字 节 数 。
* 每 次 访 问 ByteArray 对 象 时 , 将 bytesAvailable 属 性 与 读 取 方 法 结 合 使 用 , 以 确 保 读 取 有 效 的 数 据 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly bytesAvailable : number ;
/ * *
* Clears the contents of the byte array and resets the length and position properties to 0 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 清 除 字 节 数 组 的 内 容 , 并 将 length 和 position 属 性 重 置 为 0 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
clear ( ) : void ;
/ * *
* Read a Boolean value from the byte stream . Read a simple byte . If the byte is non - zero , it returns true ; otherwise , it returns false .
* @return If the byte is non - zero , it returns true ; otherwise , it returns false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 布 尔 值 。 读 取 单 个 字 节 , 如 果 字 节 非 零 , 则 返 回 true , 否 则 返 回 false
* @return 如 果 字 节 不 为 零 , 则 返 回 true , 否 则 返 回 false
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readBoolean ( ) : boolean ;
/ * *
* Read signed bytes from the byte stream .
* @return An integer ranging from - 128 to 127
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 带 符 号 的 字 节
* @return 介 于 - 128 和 127 之 间 的 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readByte ( ) : number ;
/ * *
* Read data byte number specified by the length parameter from the byte stream . Starting from the position specified by offset , read bytes into the ByteArray object specified by the bytes parameter , and write bytes into the target ByteArray
* @param bytes ByteArray object that data is read into
* @param offset Offset ( position ) in bytes . Read data should be written from this position
* @param length Byte number to be read Default value 0 indicates reading all available data
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 length 参 数 指 定 的 数 据 字 节 数 。 从 offset 指 定 的 位 置 开 始 , 将 字 节 读 入 bytes 参 数 指 定 的 ByteArray 对 象 中 , 并 将 字 节 写 入 目 标 ByteArray 中
* @param bytes 要 将 数 据 读 入 的 ByteArray 对 象
* @param offset bytes 中 的 偏 移 ( 位 置 ) , 应 从 该 位 置 写 入 读 取 的 数 据
* @param length 要 读 取 的 字 节 数 。 默 认 值 0 导 致 读 取 所 有 可 用 的 数 据
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readBytes ( bytes : ByteArray , offset? : number , length? : number ) : void ;
/ * *
* Read an IEEE 754 double - precision ( 64 bit ) floating point number from the byte stream
* @return Double - precision ( 64 bit ) floating point number
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 IEEE 754 双 精 度 ( 64 位 ) 浮 点 数
* @return 双 精 度 ( 64 位 ) 浮 点 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readDouble ( ) : number ;
/ * *
* Read an IEEE 754 single - precision ( 32 bit ) floating point number from the byte stream
* @return Single - precision ( 32 bit ) floating point number
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 IEEE 754 单 精 度 ( 32 位 ) 浮 点 数
* @return 单 精 度 ( 32 位 ) 浮 点 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readFloat ( ) : number ;
/ * *
* Read a 32 - bit signed integer from the byte stream .
* @return A 32 - bit signed integer ranging from - 2147483648 to 2147483647
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 带 符 号 的 32 位 整 数
* @return 介 于 - 2147483648 和 2147483647 之 间 的 32 位 带 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readInt ( ) : number ;
/ * *
* Read a 16 - bit signed integer from the byte stream .
* @return A 16 - bit signed integer ranging from - 32768 to 32767
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 带 符 号 的 16 位 整 数
* @return 介 于 - 32768 和 32767 之 间 的 16 位 带 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readShort ( ) : number ;
/ * *
* Read unsigned bytes from the byte stream .
* @return A unsigned integer ranging from 0 to 255
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 无 符 号 的 字 节
* @return 介 于 0 和 255 之 间 的 无 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readUnsignedByte ( ) : number ;
/ * *
* Read a 32 - bit unsigned integer from the byte stream .
* @return A 32 - bit unsigned integer ranging from 0 to 4294967295
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 无 符 号 的 32 位 整 数
* @return 介 于 0 和 4294967295 之 间 的 32 位 无 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readUnsignedInt ( ) : number ;
/ * *
* Read a 16 - bit unsigned integer from the byte stream .
* @return A 16 - bit unsigned integer ranging from 0 to 65535
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 无 符 号 的 16 位 整 数
* @return 介 于 0 和 65535 之 间 的 16 位 无 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readUnsignedShort ( ) : number ;
/ * *
* Read a UTF - 8 character string from the byte stream Assume that the prefix of the character string is a short unsigned integer ( use byte to express length )
* @return UTF - 8 character string
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 UTF - 8 字 符 串 。 假 定 字 符 串 的 前 缀 是 无 符 号 的 短 整 型 ( 以 字 节 表 示 长 度 )
* @return UTF - 8 编 码 的 字 符 串
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readUTF ( ) : string ;
/ * *
* Read a UTF - 8 byte sequence specified by the length parameter from the byte stream , and then return a character string
* @param Specify a short unsigned integer of the UTF - 8 byte length
* @return A character string consists of UTF - 8 bytes of the specified length
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 从 字 节 流 中 读 取 一 个 由 length 参 数 指 定 的 UTF - 8 字 节 序 列 , 并 返 回 一 个 字 符 串
* @param length 指 明 UTF - 8 字 节 长 度 的 无 符 号 短 整 型 数
* @return 由 指 定 长 度 的 UTF - 8 字 节 组 成 的 字 符 串
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readUTFBytes ( length : number ) : string ;
/ * *
* Write a Boolean value . A single byte is written according to the value parameter . If the value is true , write 1 ; if the value is false , write 0 .
* @param value A Boolean value determining which byte is written . If the value is true , write 1 ; if the value is false , write 0 .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 写 入 布 尔 值 。 根 据 value 参 数 写 入 单 个 字 节 。 如 果 为 true , 则 写 入 1 , 如 果 为 false , 则 写 入 0
* @param value 确 定 写 入 哪 个 字 节 的 布 尔 值 。 如 果 该 参 数 为 true , 则 该 方 法 写 入 1 ; 如 果 该 参 数 为 false , 则 该 方 法 写 入 0
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeBoolean ( value : boolean ) : void ;
/ * *
* Write a byte into the byte stream
* The low 8 bits of the parameter are used . The high 24 bits are ignored .
* @param value A 32 - bit integer . The low 8 bits will be written into the byte stream
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 字 节
* 使 用 参 数 的 低 8 位 。 忽 略 高 24 位
* @param value 一 个 32 位 整 数 。 低 8 位 将 被 写 入 字 节 流
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeByte ( value : number ) : void ;
/ * *
* Write the byte sequence that includes length bytes in the specified byte array , bytes , ( starting at the byte specified by offset , using a zero - based index ) , into the byte stream
* If the length parameter is omitted , the default length value 0 is used and the entire buffer starting at offset is written . If the offset parameter is also omitted , the entire buffer is written
* If the offset or length parameter is out of range , they are clamped to the beginning and end of the bytes array .
* @param bytes ByteArray Object
* @param offset A zero - based index specifying the position into the array to begin writing
* @param length An unsigned integer specifying how far into the buffer to write
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 指 定 字 节 数 组 bytes ( 起 始 偏 移 量 为 offset , 从 零 开 始 的 索 引 ) 中 包 含 length 个 字 节 的 字 节 序 列 写 入 字 节 流
* 如 果 省 略 length 参 数 , 则 使 用 默 认 长 度 0 ; 该 方 法 将 从 offset 开 始 写 入 整 个 缓 冲 区 。 如 果 还 省 略 了 offset 参 数 , 则 写 入 整 个 缓 冲 区
* 如 果 offset 或 length 超 出 范 围 , 它 们 将 被 锁 定 到 bytes 数 组 的 开 头 和 结 尾
* @param bytes ByteArray 对 象
* @param offset 从 0 开 始 的 索 引 , 表 示 在 数 组 中 开 始 写 入 的 位 置
* @param length 一 个 无 符 号 整 数 , 表 示 在 缓 冲 区 中 的 写 入 范 围
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeBytes ( bytes : ByteArray , offset? : number , length? : number ) : void ;
/ * *
* Write an IEEE 754 double - precision ( 64 bit ) floating point number into the byte stream
* @param value Double - precision ( 64 bit ) floating point number
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 IEEE 754 双 精 度 ( 64 位 ) 浮 点 数
* @param value 双 精 度 ( 64 位 ) 浮 点 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeDouble ( value : number ) : void ;
/ * *
* Write an IEEE 754 single - precision ( 32 bit ) floating point number into the byte stream
* @param value Single - precision ( 32 bit ) floating point number
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 IEEE 754 单 精 度 ( 32 位 ) 浮 点 数
* @param value 单 精 度 ( 32 位 ) 浮 点 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeFloat ( value : number ) : void ;
/ * *
* Write a 32 - bit signed integer into the byte stream
* @param value An integer to be written into the byte stream
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 带 符 号 的 32 位 整 数
* @param value 要 写 入 字 节 流 的 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeInt ( value : number ) : void ;
/ * *
* Write a 16 - bit integer into the byte stream . The low 16 bits of the parameter are used . The high 16 bits are ignored .
* @param value A 32 - bit integer . Its low 16 bits will be written into the byte stream
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 16 位 整 数 。 使 用 参 数 的 低 16 位 。 忽 略 高 16 位
* @param value 32 位 整 数 , 该 整 数 的 低 16 位 将 被 写 入 字 节 流
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeShort ( value : number ) : void ;
/ * *
* Write a 32 - bit unsigned integer into the byte stream
* @param value An unsigned integer to be written into the byte stream
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 无 符 号 的 32 位 整 数
* @param value 要 写 入 字 节 流 的 无 符 号 整 数
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeUnsignedInt ( value : number ) : void ;
/ * *
* Write a 16 - bit unsigned integer into the byte stream
* @param value An unsigned integer to be written into the byte stream
* @version Egret 2.5
* @platform Web , Native
* @language en_US
* /
/ * *
* 在 字 节 流 中 写 入 一 个 无 符 号 的 16 位 整 数
* @param value 要 写 入 字 节 流 的 无 符 号 整 数
* @version Egret 2.5
* @platform Web , Native
* @language zh_CN
* /
writeUnsignedShort ( value : number ) : void ;
/ * *
* Write a UTF - 8 string into the byte stream . The length of the UTF - 8 string in bytes is written first , as a 16 - bit integer , followed by the bytes representing the characters of the string
* @param value Character string value to be written
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 UTF - 8 字 符 串 写 入 字 节 流 。 先 写 入 以 字 节 表 示 的 UTF - 8 字 符 串 长 度 ( 作 为 16 位 整 数 ) , 然 后 写 入 表 示 字 符 串 字 符 的 字 节
* @param value 要 写 入 的 字 符 串 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeUTF ( value : string ) : void ;
/ * *
* Write a UTF - 8 string into the byte stream . Similar to the writeUTF ( ) method , but the writeUTFBytes ( ) method does not prefix the string with a 16 - bit length word
* @param value Character string value to be written
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 将 UTF - 8 字 符 串 写 入 字 节 流 。 类 似 于 writeUTF ( ) 方 法 , 但 writeUTFBytes ( ) 不 使 用 16 位 长 度 的 词 为 字 符 串 添 加 前 缀
* @param value 要 写 入 的 字 符 串 值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
writeUTFBytes ( value : string ) : void ;
/ * *
*
* @returns
* @version Egret 2.4
* @platform Web , Native
* /
toString ( ) : string ;
/ * *
* @private
* 将 Uint8Array 写 入 字 节 流
* @param bytes 要 写 入 的 Uint8Array
* @param validateBuffer
* /
_writeUint8Array ( bytes : Uint8Array | ArrayLike < number > , validateBuffer? : boolean ) : void ;
/ * *
* @param len
* @returns
* @version Egret 2.4
* @platform Web , Native
* @private
* /
validate ( len : number ) : boolean ;
/**********************/
/**********************/
/ * *
* @private
* @param len
* @param needReplace
* /
protected validateBuffer ( len : number ) : void ;
/ * *
* @private
* UTF - 8 Encoding / Decoding
* /
private encodeUTF8 ( str ) ;
/ * *
* @private
*
* @param data
* @returns
* /
private decodeUTF8 ( data ) ;
/ * *
* @private
*
* @param code_point
* /
private encoderError ( code_point ) ;
/ * *
* @private
*
* @param fatal
* @param opt_code_point
* @returns
* /
private decoderError ( fatal , opt_code_point ? ) ;
/ * *
* @private
* /
private EOF_byte ;
/ * *
* @private
* /
private EOF_code_point ;
/ * *
* @private
*
* @param a
* @param min
* @param max
* /
private inRange ( a , min , max ) ;
/ * *
* @private
*
* @param n
* @param d
* /
private div ( n , d ) ;
/ * *
* @private
*
* @param string
* /
private stringToCodePoints ( string ) ;
}
}
declare namespace egret {
/ * *
* The Sprite class is a basic display list building block : a display list node that can contain children .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Sprite . ts
* @language en_US
* /
/ * *
* Sprite 类 是 基 本 显 示 列 表 构 造 块 : 一 个 可 包 含 子 项 的 显 示 列 表 节 点 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / Sprite . ts
* @language zh_CN
* /
class Sprite extends DisplayObjectContainer {
/ * *
* Creates a new Sprite instance .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 实 例 化 一 个 容 器
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( ) ;
protected createNativeDisplayObject ( ) : void ;
/ * *
* @private
* /
$graphics : Graphics ;
/ * *
* Specifies the Graphics object belonging to this Shape object , where vector drawing commands can occur .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 Shape 中 的 Graphics 对 象 。 可 通 过 此 对 象 执 行 矢 量 绘 图 命 令 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly graphics : Graphics ;
$hitTest ( stageX : number , stageY : number ) : DisplayObject ;
/ * *
* @private
* /
$measureContentBounds ( bounds : Rectangle ) : void ;
/ * *
* @private
* /
$onRemoveFromStage ( ) : void ;
}
}
declare namespace egret {
/ * *
* Registers the runtime class information for a class . This method adds some strings which represent the class name or
* some interface names to the class definition . After the registration , you can use egret . is ( ) method to do the type checking
* for the instance of this class . < br / >
* Note :If you use the TypeScript programming language , the egret command line tool will automatically generate the registration code line .
* You don ' t need to manually call this method .
*
* @example the following code shows how to register the runtime class information for the EventDispatcher class and do the type checking :
* < pre >
* egret . registerClass ( egret . EventDispatcher , "egret.EventDispatcher" , [ "egret.IEventDispatcher" ] ) ;
* let dispatcher = new egret . EventDispatcher ( ) ;
* egret . log ( egret . is ( dispatcher , "egret.IEventDispatcher" ) ) ; //true。
* egret . log ( egret . is ( dispatcher , "egret.EventDispatcher" ) ) ; //true。
* egret . log ( egret . is ( dispatcher , "egret.Bitmap" ) ) ; //false。
* < / pre >
* @param classDefinition the class definition to be registered .
* @param className a unique identification string of the specific class
* @param interfaceNames a list of unique identification string of the specific interfaces .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 为 一 个 类 定 义 注 册 运 行 时 类 信 息 , 用 此 方 法 往 类 定 义 上 注 册 它 自 身 以 及 所 有 接 口 对 应 的 字 符 串 。
* 在 运 行 时 , 这 个 类 的 实 例 将 可 以 使 用 egret . is ( ) 方 法 传 入 一 个 字 符 串 来 判 断 实 例 类 型 。
* @example 以 下 代 码 演 示 了 如 何 为 EventDispatcher类注册运行时类信息并判断类型 :
* < pre >
* //为egret.EventDispatcher类注册运行时类信息, 由于它实现了IEventDispatcher接口, 这里应同时传入接口名对应的字符串。
* egret . registerClass ( egret . EventDispatcher , "egret.EventDispatcher" , [ "egret.IEventDispatcher" ] ) ;
* let dispatcher = new egret . EventDispatcher ( ) ;
* egret . log ( egret . is ( dispatcher , "egret.IEventDispatcher" ) ) ; //true。
* egret . log ( egret . is ( dispatcher , "egret.EventDispatcher" ) ) ; //true。
* egret . log ( egret . is ( dispatcher , "egret.Bitmap" ) ) ; //false。
* < / pre >
* 注 意 : 若 您 使 用 TypeScript 来 编 写 程 序 , egret 命 令 行 会 自 动 帮 您 生 成 类 信 息 注 册 代 码 行 到 最 终 的 Javascript 文 件 中 。 因 此 您 不 需 要 手 动 调 用 此 方 法 。
*
* @param classDefinition 要 注 册 的 类 定 义 。
* @param className 要 注 册 的 类 名 。
* @param interfaceNames 要 注 册 的 类 所 实 现 的 接 口 名 列 表 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
function registerClass ( classDefinition : any , className : string , interfaceNames? : string [ ] ) : void ;
}
declare namespace egret {
/ * *
* The BitmapFillMode class defines the image fill mode of Bitmap .
* The BitmapFillMode class defines a pattern enumeration for adjusting size . These patterns determine how Bitmap fill the size designated by the layout system .
* @see http : //edn.egret.com/cn/docs/page/134 Texture filling way
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / BitmapFillMode . ts
* @language en_US
* /
/ * *
* BitmapFillMode 类 定 义 Bitmap的图像填充方式 。
* BitmapFillMode 类 定 义 了 调 整 大 小 模 式 的 一 个 枚 举 , 这 些 模 式 确 定 Bitmap 如 何 填 充 由 布 局 系 统 指 定 的 尺 寸 。
* @see http : //edn.egret.com/cn/docs/page/134 纹理的填充方式
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / display / BitmapFillMode . ts
* @language zh_CN
* /
const BitmapFillMode : {
REPEAT : string ;
SCALE : string ;
CLIP : string ;
} ;
}
declare namespace egret {
/ * *
* Logger is an entrance for the log processing namespace of the engine
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* Logger是引擎的日志处理模块入口
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
class Logger {
/ * *
* open all
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 全 开
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ALL : string ;
/ * *
* level : DEBUG
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 等 级 为 DEBUG
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static DEBUG : string ;
/ * *
* level : INFO
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 等 级 为 INFO
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static INFO : string ;
/ * *
* level : WARN
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 等 级 为 WARN
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static WARN : string ;
/ * *
* level : ERROR
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 等 级 为 ERROR
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static ERROR : string ;
/ * *
* close all
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 全 关
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static OFF : string ;
/ * *
* Set the current need to open the log level . Grade level are : ALL < DEBUG < INFO < WARN < ERROR < OFF < br / >
* This feature is only in DEBUG mode to take effect . < br / >
* < Ul >
* < Li > Logger . ALL - all levels of log can be printed out . < / l i >
* < Li > Logger . DEBUG - print debug , info , log , warn , error . < / l i >
* < Li > Logger . INFO - print info , log , warn , error . < / l i >
* < Li > Logger . WARN - can print warn , error . < / l i >
* < Li > Logger . ERROR - You can print error . < / l i >
* < Li > Logger . OFF - all closed . < / l i >
* < / U l >
* param LogType from this level to start printing .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 当 前 需 要 开 启 的 log级别 。 级 别 等 级 分 别 为 : ALL < DEBUG < INFO < WARN < ERROR < OFF < br / >
* 此 功 能 只 在 DEBUG 模 式 下 才 生 效 。 < br / >
* < ul >
* < li > Logger . ALL -- 所 有 等 级 的 log都可以打印出来 。 < / li >
* < li > Logger . DEBUG -- 可 以 打 印 debug 、 info 、 log 、 warn 、 error 。 < / li >
* < li > Logger . INFO -- 可 以 打 印 info 、 log 、 warn 、 error 。 < / li >
* < li > Logger . WARN -- 可 以 打 印 warn 、 error 。 < / li >
* < li > Logger . ERROR -- 可 以 打 印 error 。 < / li >
* < li > Logger . OFF -- 全 部 关 闭 。 < / li >
* < / ul >
* @param logType 从 这 个 等 级 开 始 打 印 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static logLevel : string ;
}
}
declare namespace egret {
/ * *
* @version Egret 2.4
* @platform Web , Native
* /
class NumberUtils {
/ * *
* Judge whether it is a numerical value
* @param value Parameter that needs to be judged
* @returns
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 判 断 是 否 是 数 值
* @param value 需 要 判 断 的 参 数
* @returns
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static isNumber ( value : any ) : boolean ;
/ * *
* Obtain the approximate sin value of the corresponding angle value
* @param value { number } Angle value
* @returns { number } sin value
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 得 到 对 应 角 度 值 的 sin近似值
* @param value { number } 角 度 值
* @returns { number } sin值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static sin ( value : number ) : number ;
/ * *
* @private
*
* @param value
* @returns
* /
private static sinInt ( value ) ;
/ * *
* Obtain the approximate cos value of the corresponding angle value
* @param value { number } Angle value
* @returns { number } cos value
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 得 到 对 应 角 度 值 的 cos近似值
* @param value { number } 角 度 值
* @returns { number } cos值
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
static cos ( value : number ) : number ;
/ * *
* @private
*
* @param value
* @returns
* /
private static cosInt ( value ) ;
static convertStringToHashCode ( str : string ) : number ;
}
}
/ * *
* @private
* /
declare let egret_sin_map : { } ;
/ * *
* @private
* /
declare let egret_cos_map : { } ;
/ * *
* @private
* /
declare let DEG_TO_RAD : number ;
declare namespace egret {
/ * *
* The Timer class is the interface to timers , which let you run code on a specified time sequence . Use the start ( )
* method to start a timer . Add an event listener for the timer event to set up code to be run on the timer interval . < br / >
* You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule . Depending
* on the framerate or the runtime environment ( available memory and other factors ) , the runtime may dispatchEvent events at
* slightly offset intervals .
* @see egret . TimerEvent
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / Timer . ts
* @language en_US
* /
/ * *
* Timer 类 是 计 时 器 的 接 口 , 它 使 您 能 按 指 定 的 时 间 序 列 运 行 代 码 。
* 使 用 start ( ) 方 法 来 启 动 计 时 器 。 为 timer 事 件 添 加 事 件 侦 听 器 , 以 便 将 代 码 设 置 为 按 计 时 器 间 隔 运 行 。
* 可 以 创 建 Timer 对 象 以 运 行 一 次 或 按 指 定 间 隔 重 复 运 行 , 从 而 按 计 划 执 行 代 码 。
* 根 据 Egret 的 帧 速 率 或 运 行 时 环 境 ( 可 用 内 存 和 其 他 因 素 ) , 运 行 时 调 度 事 件 的 间 隔 可 能 稍 有 不 同 。
* @see egret . TimerEvent
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / Timer . ts
* @language zh_CN
* /
class Timer extends EventDispatcher {
/ * *
* Constructs a new Timer object with the specified delay and repeatCount states .
* @param delay The delay between timer events , in milliseconds . A delay lower than 20 milliseconds is not recommended .
* Timer frequency is limited to 60 frames per second , meaning a delay lower than 16.6 milliseconds causes runtime problems .
* @param repeatCount Specifies the number of repetitions . If zero , the timer repeats indefinitely . If nonzero ,
* the timer runs the specified number of times and then stops .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 使 用 指 定 的 delay 和 repeatCount 状 态 构 造 新 的 Timer 对 象 。
* @param delay 计 时 器 事 件 间 的 延 迟 ( 以 毫 秒 为 单 位 ) 。 建 议 delay 不 要 低 于 20 毫 秒 。 计 时 器 频 率 不 得 超 过 60 帧 / 秒 , 这 意 味 着 低 于 16.6 毫 秒 的 延 迟 可 导 致 出 现 运 行 时 问 题 。
* @param repeatCount 指 定 重 复 次 数 。 如 果 为 零 , 则 计 时 器 将 持 续 不 断 重 复 运 行 。 如 果 不 为 0 , 则 将 运 行 计 时 器 , 运 行 次 数 为 指 定 的 次 数 , 然 后 停 止 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
constructor ( delay : number , repeatCount? : number ) ;
/ * *
* @private
* /
private _delay ;
/ * *
* The delay between timer events , in milliseconds . A delay lower than 20 milliseconds is not recommended . < br / >
* Note : Timer frequency is limited to 60 frames per second , meaning a delay lower than 16.6 milliseconds causes runtime problems .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 计 时 器 事 件 间 的 延 迟 ( 以 毫 秒 为 单 位 ) 。 如 果 在 计 时 器 正 在 运 行 时 设 置 延 迟 间 隔 , 则 计 时 器 将 按 相 同 的 repeatCount 迭 代 重 新 启 动 。 < br / >
* 注 意 : 建 议 delay 不 要 低 于 20 毫 秒 。 计 时 器 频 率 不 得 超 过 60 帧 / 秒 , 这 意 味 着 低 于 16.6 毫 秒 的 延 迟 可 导 致 出 现 运 行 时 问 题 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
delay : number ;
/ * *
* The total number of times the timer is set to run . If the repeat count is set to 0 , the timer continues indefinitely ,
* until the stop ( ) method is invoked or the program stops . If the repeat count is nonzero , the timer runs the specified
* number of times . If repeatCount is set to a total that is the same or less then currentCount the timer stops and will not fire again .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 设 置 的 计 时 器 运 行 总 次 数 。 如 果 重 复 计 数 设 置 为 0 , 则 计 时 器 将 持 续 不 断 运 行 , 或 直 至 调 用 了 stop ( ) 方 法 或 节 目 停 止 。
* 如 果 重 复 计 数 不 为 0 , 则 将 运 行 计 时 器 , 运 行 次 数 为 指 定 的 次 数 。 如 果 设 置 的 repeatCount 总 数 等 于 或 小 于 currentCount , 则 计 时 器 将 停 止 并 且 不 会 再 次 触 发 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
repeatCount : number ;
/ * *
* @private
* /
private _currentCount ;
/ * *
* The total number of times the timer has fired since it started at zero . If the timer has been reset , only the fires since the reset are counted .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 计 时 器 从 0 开 始 后 触 发 的 总 次 数 。 如 果 已 重 置 了 计 时 器 , 则 只 会 计 入 重 置 后 的 触 发 次 数 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly currentCount : number ;
/ * *
* @private
* /
private _running ;
/ * *
* The timer ' s current state ; true if the timer is running , otherwise false .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 计 时 器 的 当 前 状 态 ; 如 果 计 时 器 正 在 运 行 , 则 为 true , 否 则 为 false 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
readonly running : boolean ;
/ * *
* Stops the timer , if it is running , and sets the currentCount property back to 0 , like the reset button of a stopwatch .
* Then , when start ( ) is called , the timer instance runs for the specified number of repetitions , as set by the repeatCount value .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 计 时 器 正 在 运 行 , 则 停 止 计 时 器 , 并 将 currentCount 属 性 设 回 为 0 , 这 类 似 于 秒 表 的 重 置 按 钮 。 然 后 , 在 调 用 start ( ) 后 , 将 运 行 计 时 器 实 例 , 运 行 次 数 为 指 定 的 重 复 次 数 ( 由 repeatCount 值 设 置 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
reset ( ) : void ;
/ * *
* Starts the timer , if it is not already running .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 如 果 计 时 器 尚 未 运 行 , 则 启 动 计 时 器 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
start ( ) : void ;
/ * *
* Stops the timer . When start ( ) is called after stop ( ) , the timer instance runs for the remaining number of
* repetitions , as set by the repeatCount property .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 停 止 计 时 器 。 如 果 在 调 用 stop ( ) 后 调 用 start ( ) , 则 将 继 续 运 行 计 时 器 实 例 , 运 行 次 数 为 剩 余 的 重 复 次 数 ( 由 repeatCount 属 性 设 置 ) 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
stop ( ) : void ;
/ * *
* @private
* /
private updateInterval ;
/ * *
* @private
* /
private lastCount ;
/ * *
* @private
* /
private lastTimeStamp ;
/ * *
* @private
* Ticker以60FPS频率刷新此方法
* /
$update ( timeStamp : number ) : boolean ;
}
}
declare namespace egret {
/ * *
* The XMLNode class is the base class for all xml node .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* XML节点基类
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface XMLNode {
/ * *
* a integer representing the type of the node , 1 : XML , 2 : XMLAttribute , 3 : XMLText
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 类 型 , 1 : XML , 2 : XMLAttribute , 3 : XMLText
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
nodeType : number ;
/ * *
* the parent node of this xml node .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 所 属 的 父 级 节 点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
parent : XML ;
}
/ * *
* The XML class contains properties for working with XML objects .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / XML . ts
* @language en_US
* /
/ * *
* XML 类 包 含 用 于 处 理 XML 对 象 的 属 性 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / XML . ts
* @language zh_CN
* /
interface XML extends XMLNode {
/ * *
* the attributes of this xml node .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 节 点 上 的 属 性 列 表
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
attributes : any ;
/ * *
* the children of the xml node .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 当 前 节 点 的 子 节 点 列 表
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
children : XMLNode [ ] ;
/ * *
* the full name of this xml node . For example , the name of < s : Button / > is "s:Button" .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 完 整 名 称 。 例 如 节 点 < s : Button / > 的 name 为 : "s:Button"
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
name : string ;
/ * *
* thie namesapce prefix of this xml node . For example , the prefix of < s : Button / > is "s" .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 的 命 名 空 间 前 缀 。 例 如 节 点 < s : Button / > 的 prefix 为 : s
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
prefix : string ;
/ * *
* the local name of this xml node . For example , the local name of < s : Button / > is "Button" .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 的 本 地 名 称 。 例 如 节 点 < s : Button / > 的 localName 为 : Button
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
localName : string ;
/ * *
* the namesapce uri of this xml node . For example , the namespace uri of < s : Skin xmlns : s = "http://ns.egret.com/eui" / > is "http://ns.egret.com/eui" .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 节 点 的 命 名 空 间 地 址 。 例 如 节 点 < s : Skin xmlns : s = "http://ns.egret.com/eui" / > 的 namespace 为 : http : //ns.egret.com/eui
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
namespace : string ;
}
/ * *
* The XMLText class represents a string node in the XML .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* XMLText 类 表 示 在 XML中的文本节点
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
interface XMLText extends XMLNode {
/ * *
* the text content
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 文 本 内 容
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
text : string ;
}
/ * *
* The XML class contains properties for working with XML objects .
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* XML 类 包 含 用 于 处 理 XML 对 象 的 属 性 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let XML : {
/ * *
* parses a text to XML instance .
* @param text the text to be parsed .
* @language en_US
* /
/ * *
* 解 析 字 符 串 为 XML对象
* @param text 要 解 析 的 XML对象 。
* @language zh_CN
* /
parse ( text : string ) : XML ;
} ;
}
declare namespace egret {
/ * *
* @private
* /
let $callLaterFunctionList : any [ ] ;
/ * *
* @private
* /
let $callLaterThisList : any [ ] ;
/ * *
* @private
* /
let $callLaterArgsList : any [ ] ;
/ * *
* Delay the function to run unless screen is redrawn .
* @param method { Function } The function to be delayed to run
* @param thisObject { any } this reference of callback function
* @param . . . args { any } Function parameter list
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / callLater . ts
* @language en_US
* /
/ * *
* 延 迟 函 数 到 屏 幕 重 绘 前 执 行 。
* @param method { Function } 要 延 迟 执 行 的 函 数
* @param thisObject { any } 回 调 函 数 的 this引用
* @param . . . args { any } 函 数 参 数 列 表
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / callLater . ts
* @language zh_CN
* /
function callLater ( method : Function , thisObject : any , . . . args : any [ ] ) : void ;
/ * *
* @private
* /
let $callAsyncFunctionList : any [ ] ;
/ * *
* @private
* /
let $callAsyncThisList : any [ ] ;
/ * *
* @private
* /
let $callAsyncArgsList : any [ ] ;
/ * *
* 异 步 调 用 函 数
* @param method { Function } 要 异 步 调 用 的 函 数
* @param thisObject { any } 函 数 的 this引用
* @param . . . args { any } 函 数 参 数 列 表
* @private
* /
function $callAsync ( method : Function , thisObject : any , . . . args : any [ ] ) : void ;
}
declare namespace egret {
/ * *
* Call setter properties of the parent class , instead of the other writing languages , such as super . alpha = 1 ;
* @param currentClass The current class class name , non - string
* @param thisObj The current object . Always this
* @param type Setter property names need to call
* @param values Value passed to the parent class
*
* @exmaple egret . superSetter ( egret . Sprite , this , "alpha" , 1 ) ;
* @language en_US
* /
/ * *
* 调 用 父 类 的 setter属性 , 代 替 其 他 语 言 的 写 法 , 如 super . alpha = 1 ;
* @param currentClass 当 前 class 类 名 , 非 字 符 串
* @param thisObj 当 前 对 象 。 永 远 都 this
* @param type 需 要 调 用 的 setter属性名称
* @param values 传 给 父 类 的 值
*
* @exmaple egret . superSetter ( egret . Sprite , this , "alpha" , 1 ) ;
* @language zh_CN
* /
function superSetter ( currentClass : any , thisObj : any , type : string , . . . values : any [ ] ) : any ;
/ * *
* Get getter property value of the parent class . Instead of writing in other languages , such as super . alpha ;
* @param currentClass The current class class name , non - string
* @param thisObj The current object . Always this
* @param type Setter property names need to call
* @returns { any } The value returned by the parent
*
* @exmaple egret . superGetter ( egret . Sprite , this , "alpha" ) ;
* @language en_US
* /
/ * *
* 获 取 父 类 的 getter属性值 。 代 替 其 他 语 言 的 写 法 , 如 super . alpha ;
* @param currentClass 当 前 class 类 名 , 非 字 符 串
* @param thisObj 当 前 对 象 。 永 远 都 this
* @param type 需 要 调 用 的 getter属性名称
* @returns { any } 父 类 返 回 的 值
*
* @exmaple egret . superGetter ( egret . Sprite , this , "alpha" ) ;
* @language zh_CN
* /
function superGetter ( currentClass : any , thisObj : any , type : string ) : any ;
}
declare namespace egret {
/ * *
* Returns a reference to the class object of the class specified by the name parameter .
* @param name The name of a class .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getDefinitionByName . ts
* @language en_US
* /
/ * *
* 返 回 name 参 数 指 定 的 类 的 类 对 象 引 用 。
* @param name 类 的 名 称 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getDefinitionByName . ts
* @language zh_CN
* /
function getDefinitionByName ( name : string ) : any ;
}
declare namespace egret {
/ * *
* Get browser or Runtime parameters , returns an empty string if not set
* Get the url parameter corresponds to the browser , access to the corresponding parameter in the Runtime setOption
* @method egret . getOption
* @param key { string } Parameters key
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 获 取 浏 览 器 或 者 Runtime参数 , 如 果 没 有 设 置 返 回 空 字 符 串
* 在 浏 览 器 中 相 当 于 获 取 url中参数 , 在 Runtime获取对应setOption参数
* @method egret . getOption
* @param key { string } 参 数 key
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
let getOption : ( key : string ) = > string ;
}
declare namespace egret {
/ * *
* Return the fully qualified class name of an object
* @param value The object for which a fully qualified class name is desired . Any JavaScript value may be passed to
* this method including all available JavaScript types , object instances , primitive types such as number , and class objects .
* @returns A string containing the fully qualified class name .
* @example
* < pre >
* egret . getQualifiedClassName ( egret . DisplayObject ) //return "egret.DisplayObject"
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getQualifiedClassName . ts
* @language en_US
* /
/ * *
* 返 回 对 象 的 完 全 限 定 类 名 。
* @param value 需 要 完 全 限 定 类 名 称 的 对 象 , 可 以 将 任 何 JavaScript 值 传 递 给 此 方 法 , 包 括 所 有 可 用 的 JavaScript 类 型 、 对 象 实 例 、 原 始 类 型
* ( 如 number ) 和 类 对 象
* @returns 包 含 完 全 限 定 类 名 称 的 字 符 串 。
* @example
* < pre >
* egret . getQualifiedClassName ( egret . DisplayObject ) //返回 "egret.DisplayObject"
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getQualifiedClassName . ts
* @language zh_CN
* /
function getQualifiedClassName ( value : any ) : string ;
}
declare namespace egret {
/ * *
* Returns the fully qualified class name of the base class of the object specified by the value parameter .
* @param value The object for which a parent class is desired . Any JavaScript value may be passed to this method including
* all available JavaScript types , object instances , primitive types such as number , and class objects .
* @returns A fully qualified base class name , or null if none exists .
* @example
* < pre >
* egret . getQualifiedSuperclassName ( egret . Bitmap ) //return "egret.DisplayObject"
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getQualifiedSuperclassName . ts
* @language en_US
* /
/ * *
* 返 回 value 参 数 指 定 的 对 象 的 基 类 的 完 全 限 定 类 名 。
* @param value 需 要 取 得 父 类 的 对 象 , 可 以 将 任 何 JavaScript 值 传 递 给 此 方 法 , 包 括 所 有 可 用 的 JavaScript 类 型 、 对 象 实 例 、 原 始 类 型 ( 如 number ) 和 类 对 象
* @returns 完 全 限 定 的 基 类 名 称 , 或 null ( 如 果 不 存 在 基 类 名 称 ) 。
* @example
* < pre >
* egret . getQualifiedSuperclassName ( egret . Sprite ) //返回 "egret.DisplayObject"
* < / pre >
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getQualifiedSuperclassName . ts
* @language zh_CN
* /
function getQualifiedSuperclassName ( value : any ) : string ;
}
declare namespace egret {
/ * *
* Used to compute relative time . this method returns the number of milliseconds since the Egret framework was initialized
* @returns The number of milliseconds since the Egret framework was initialized
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getTimer . ts
* @language en_US
* /
/ * *
* 用 于 计 算 相 对 时 间 。 此 方 法 返 回 自 启 动 Egret 框 架 以 来 经 过 的 毫 秒 数 。
* @returns 启 动 Egret 框 架 以 来 经 过 的 毫 秒 数 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / getTimer . ts
* @language zh_CN
* /
function getTimer ( ) : number ;
}
declare namespace egret {
/ * *
* Check whether a public definition exists in the specified application domain . The definition can be that of a class , a naming space or a function .
* @param name { string } Name of the definition .
* @returns { boolean } Whether the public definition exists
* @example
* egret . hasDefinition ( "egret.DisplayObject" ) //return true
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / hasDefinition . ts
* @language en_US
* /
/ * *
* 检 查 指 定 的 应 用 程 序 域 之 内 是 否 存 在 一 个 公 共 定 义 。 该 定 义 可 以 是 一 个 类 、 一 个 命 名 空 间 或 一 个 函 数 的 定 义 。
* @param name { string } 定 义 的 名 称 。
* @returns { boolean } 公 共 定 义 是 否 存 在
* @example
* egret . hasDefinition ( "egret.DisplayObject" ) //返回 true
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / hasDefinition . ts
* @language zh_CN
* /
function hasDefinition ( name : string ) : boolean ;
}
declare namespace egret {
/ * *
* Indicates whether an object is a instance of the class or interface specified as the parameter . This method has better performance
* compared width the instanceOf operator , and it can indicate whether an object is a instance of the specific interface .
* @param instance the instance to be checked .
* @param typeName the string value representing a specific class or interface .
* @returns A value of true if the object is a instance of the class or interface specified as the parameter .
* @example
* < pre >
* let instance = new egret . Sprite ( ) ;
* egret . log ( egret . is ( instance , "egret.Sprite" ) ) //true
* egret . log ( egret . is ( instance , "egret.DisplayObjectContainer" ) ) //true
* egret . log ( egret . is ( instance , "egret.Bitmap" ) ) //false
* < / pre >
* @see egret . registerClass ( )
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 检 查 指 定 对 象 是 否 为 Egret 框 架 内 指 定 接 口 或 类 或 其 子 类 的 实 例 。 此 方 法 与 使 用 instanceOf 关 键 字 相 比 具 有 更 高 的 性 能 , 并 且 能 判 断 接 口 的 实 现 。
* @param instance 要 判 断 的 实 例 。
* @param typeName 类 或 接 口 的 完 全 名 称 .
* @returns 返 回 true表示当前对象是指定类或接口的实例 。
* @example
* < pre >
* let instance = new egret . Sprite ( ) ;
* egret . log ( egret . is ( instance , "egret.Sprite" ) ) //true
* egret . log ( egret . is ( instance , "egret.DisplayObjectContainer" ) ) //true
* egret . log ( egret . is ( instance , "egret.Bitmap" ) ) //false
* < / pre >
* @see egret . registerClass ( )
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
function is ( instance : any , typeName : string ) : boolean ;
}
declare namespace egret {
/ * *
* Register and start a timer , which will notify the callback method at a rate of 60 FPS , and pass the current time stamp as parameters . < br / >
* Note : After the registration , it will notify the callback method continuously , you can call the stopTick ( ) method to stop it .
* @param callBack the call back method . the timeStamp parameter of this method represents the number of milliseconds
* since the Egret framework was initialized . If the return value of this method is true , it will force Egret runtime
* to render after processing of this method completes .
* @param thisObject the call back method ' s "this"
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 注 册 并 启 动 一 个 计 时 器 , 通 常 会 以 60 FPS的速率触发回调方法 , 并 传 入 当 前 时 间 戳 。 注 意 : 注 册 后 将 会 持 续 触 发 回 调 方 法 , 若 要 停 止 回 调 , 需 要 手 动 调 用 stopTick ( ) 方 法 。
* @param callBack 要 执 行 的 回 调 方 法 。 参 数 timeStamp 表 示 从 启 动 Egret框架开始经过的时间 ( 毫 秒 ) 。
* 若 回 调 方 法 返 回 值 为 true , 其 作 用 与 TimerEvent . updateAfterEvent ( ) 类 似 , 将 会 忽 略 帧 频 限 制 , 在 此 方 法 处 理 完 成 后 立 即 重 绘 屏 幕 。
* @param thisObject 回 调 方 法 的 this对象引用 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
function startTick ( callBack : ( timeStamp : number ) = > boolean , thisObject : any ) : void ;
}
declare namespace egret {
/ * *
* Stops the timer started by the egret . startTick ( ) method .
* @param callBack the call back method . the timeStamp parameter of this method represents the number of milliseconds
* since the Egret framework was initialized . If the return value of this method is true , it will force Egret runtime
* to render after processing of this method completes .
* @param thisObject the call back method ' s "this"
* @version Egret 2.4
* @platform Web , Native
* @language en_US
* /
/ * *
* 停 止 之 前 用 startTick ( ) 方 法 启 动 的 计 时 器 。
* @param callBack 要 执 行 的 回 调 方 法 。 参 数 timeStamp 表 示 从 启 动 Egret框架开始经过的时间 ( 毫 秒 ) 。
* 若 回 调 方 法 返 回 值 为 true , 其 作 用 与 TimerEvent . updateAfterEvent ( ) 类 似 , 将 会 忽 略 帧 频 限 制 , 在 此 方 法 处 理 完 成 后 立 即 重 绘 屏 幕 。
* @param thisObject 回 调 方 法 的 this对象引用 。
* @version Egret 2.4
* @platform Web , Native
* @language zh_CN
* /
function stopTick ( callBack : ( timeStamp : number ) = > boolean , thisObject : any ) : void ;
}
declare namespace egret {
/ * *
* Transfer number to color character string
* @param value { number } color value , such as 0xffffff
* @returns { string } Color character string , for example , # ffffff .
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / toColorString . ts
* @language en_US
* /
/ * *
* 转 换 数 字 为 颜 色 字 符 串
* @param value { number } 颜 色 值 , 例 如 0xffffff
* @returns { string } 颜 色 字 符 串 , 例 如 "#ffffff" 。
* @version Egret 2.4
* @platform Web , Native
* @includeExample egret / utils / toColorString . ts
* @language zh_CN
* /
function toColorString ( value : number ) : string ;
}
/ * *
* @private
* /
interface PlayerOption {
/ * *
* 入 口 类 完 整 类 名
* /
entryClassName? : string ;
/ * *
* 默 认 帧 率
* /
frameRate? : number ;
/ * *
* 屏 幕 适 配 模 式
* /
scaleMode? : string ;
/ * *
* 初 始 内 容 宽 度
* /
contentWidth? : number ;
/ * *
* 初 始 内 容 高 度
* /
contentHeight? : number ;
/ * *
* 屏 幕 方 向
* /
orientation? : string ;
/ * *
* 显 示 FPS
* /
showFPS? : boolean ;
/ * *
*
* /
fpsStyles? : Object ;
/ * *
* 显 示 日 志
* /
showLog? : boolean ;
/ * *
* 过 滤 日 志 的 正 则 表 达 式
* /
logFilter? : string ;
/ * *
*
* /
maxTouches? : number ;
/ * *
*
* /
textureScaleFactor? : number ;
}