Files
esengine/source/lib/egret.d.ts

15372 lines
586 KiB
TypeScript
Raw Normal View History

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
* 1230.
*/
$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 1alpha 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中写一个简单的测试TextFielduseCapture为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 .00
* @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 0DisplayObject对象将会放置于最上层
* @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
* 2D路径命令
*/
const enum PathCommand {
MoveTo = 1,
LineTo = 2,
CurveTo = 3,
CubicCurveTo = 4,
}
/**
* @private
* 2D路径
*/
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
* trueendAngle必须小于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是否为truefalse则抛出异常并且在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 0xRRGGBB. 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} 0xRRGGBB 0xFF0000
* @param alpha {number} Alpha 0 10.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 类具有多个祖代类: SpriteDisplayObject 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 > 0xFF0xA6 + 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 0heading 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 truefalse
* @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
*/
/**
* functionNamevalue传入到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 4x5 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
*/
/**
* 4x5 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的初始值keyvalue一一对应
* @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的初始值keyvalue一一对应
* @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 0xRRGGBB. 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} 0xRRGGBB 0xFF0000
* @param alpha {number} Alpha 0 10.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;
/**
* 130.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=1b=0c=0d=1tx=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 abc 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 sxy 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 abcdtx 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 xywidth 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 truefalse
* @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 xywidth
* 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
* xywidth height Rectangle
* @param toIntersect Rectangle Rectangle
* @returns truefalse
* @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 xywidth height Rectangle
* @returns Rectangle xywidth 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 truefalse
* @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
* xywidth height Rectangle
* @param toCompare Rectangle
* @returns Rectangle xywidth 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 xywidth 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 URLurl不为空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 videoonly 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.TEXTHttpResponseType.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 JPGPNG 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对象RenderBuffernull
*/
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 {
/** !!!!!!!!inspired by Babylon.js!!!!!!!!!!!!!
* 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 3D 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 trueGraphicsNode时
*/
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
* 线
* 线lineWidth130.5线
*/
class StrokePath extends Path2D {
constructor();
/**
* 线
* 130.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
* @version Egret 5.2.23
* @platform All
* @language en_US
*/
/**
*
* @version Egret 5.2.26
* @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.
* @defaultegret.HorizontalAlign.LEFT
* @version Egret 2.5.6
* @platform Web,Native
* @language en_US
*/
/**
*
* @defaultegret.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.
* @defaultegret.VerticalAlign.TOP
* @version Egret 2.5.6
* @platform Web,Native
* @language en_US
*/
/**
*
* @defaultegret.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.
* @defaultegret.HorizontalAlign.LEFT
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @defaultegret.HorizontalAlign.LEFT
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
textAlign: string;
$setTextAlign(value: string): boolean;
/**
* Vertical alignment of text.
* @defaultegret.VerticalAlign.TOP
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @defaultegret.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;
/**
* xy获取文本项
* @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. </ li>
* <Li> Logger.DEBUG - print debug, info, log, warn, error. </ li>
* <Li> Logger.INFO - print info, log, warn, error. </ li>
* <Li> Logger.WARN - can print warn, error. </ li>
* <Li> Logger.ERROR - You can print error. </ li>
* <Li> Logger.OFF - all closed. </ li>
* </ Ul>
*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 -- debuginfologwarnerror</li>
* <li>Logger.INFO -- infologwarnerror</li>
* <li>Logger.WARN -- warnerror</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, 1XML2XMLAttribute3XMLText
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* 1XML2XMLAttribute3XMLText
* @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
*/
/**
* 60FPS的速率触发回调方法stopTick()
* @param callBack timeStamp Egret框架开始经过的时间()
* trueTimerEvent.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框架开始经过的时间()
* trueTimerEvent.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;
}