Commit 8b44bc20 authored by wjf's avatar wjf

l

parent 29783410
...@@ -352,17 +352,13 @@ export default class Sprite extends Container { ...@@ -352,17 +352,13 @@ export default class Sprite extends Container {
if (!this.visible) return null if (!this.visible) return null
if (isMouseEvent && !this.mouseEnabled && !this.mouseChildren) return null; if (isMouseEvent && !this.mouseEnabled && !this.mouseChildren) return null;
let hitDisplayObject; let hitDisplayObject;
//子级可选,先找子级,子级层级更高 //先检查子级,因为子级层级更高
if (this.mouseChildren) { hitDisplayObject = super.hitTestPoint(globalPoint, isMouseEvent);
hitDisplayObject = super.hitTestPoint(globalPoint, isMouseEvent); //子级已有,返回
//子级已有,返回 if (hitDisplayObject) return hitDisplayObject;
if (hitDisplayObject) return hitDisplayObject;
}
//检查自己 //检查自己
if (this.mouseEnabled) { hitDisplayObject = this.displayObjectHitTestPoint(globalPoint, isMouseEvent);
hitDisplayObject = this.displayObjectHitTestPoint(globalPoint, isMouseEvent); if (hitDisplayObject) return hitDisplayObject;
if (hitDisplayObject) return hitDisplayObject;
}
return null; return null;
} }
......
...@@ -1155,24 +1155,19 @@ export default class Graphics extends Container { ...@@ -1155,24 +1155,19 @@ export default class Graphics extends Container {
if (!this.visible) return null if (!this.visible) return null
if (isMouseEvent && !this.mouseEnabled && !this.mouseChildren) return null; if (isMouseEvent && !this.mouseEnabled && !this.mouseChildren) return null;
let hitDisplayObject; let hitDisplayObject;
//子级可选,先找子级,子级层级更高 //先检查子级,因为子级层级更高
if (this.mouseChildren) { hitDisplayObject = super.hitTestPoint(point, isMouseEvent);
hitDisplayObject = super.hitTestPoint(point, isMouseEvent); //子级已有,返回
//子级已有,返回 if (hitDisplayObject) return hitDisplayObject;
if (hitDisplayObject) return hitDisplayObject; //再粗略检查自己,先计算自身盒子
} this.updateLocalBoundsSelf();
//检查自己 hitDisplayObject = this.displayObjectHitTestPoint(point, isMouseEvent);
if (this.mouseEnabled) { //有的话
//再粗略检查自己,先计算自身盒子 if (hitDisplayObject) {
this.updateLocalBoundsSelf(); //不需要像素级检测直接返回
hitDisplayObject = this.displayObjectHitTestPoint(point, isMouseEvent); if (!this.hitTestByPixel) return hitDisplayObject;
//有的话 //精确检测
if (hitDisplayObject) { return this.hitTestPointAccuratly(point)
//不需要像素级检测直接返回
if (!this.hitTestByPixel) return hitDisplayObject;
//精确检测
return this.hitTestPointAccuratly(point)
}
} }
return null; return null;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"sourceMap": true, "sourceMap": true,
"removeComments": true, "removeComments": true,
"noEmitOnError": true, "noEmitOnError": true,
"declarationDir": "types", // "declarationDir": "types",
"declaration": true, "declaration": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"outDir": "dist", "outDir": "dist",
......
export declare abstract class HashObject {
protected _instanceId: number;
protected _instanceType: string;
protected static _object_id: number;
constructor();
readonly instanceId: number;
readonly instanceType: string;
abstract destroy(): void;
}
import { HashObject } from "../HashObject";
import { DisplayObject } from "../display/DisplayObject";
export declare class Component extends HashObject {
entity: DisplayObject;
protected _enabled: boolean;
constructor();
enabled: boolean;
_setup(entity: DisplayObject): void;
_unSetup(): void;
onCreate(): void;
onEnable(): void;
onDisable(): void;
onUpdate(): void;
onDestroy(): void;
destroy(): void;
}
export declare const VERSION = "1.0";
export declare const devicePixelRatio: number;
export declare let StageScaleMode: {
EXACT_FIT: string;
NO_BORDER: string;
NO_SCALE: string;
SHOW_ALL: string;
FIXED_WIDTH: string;
FIXED_HEIGHT: string;
};
export declare const osType: string;
export declare function cos(angle: number): number;
export declare function sin(angle: number): number;
export declare const PI_2: number;
export declare const RAD_TO_DEG: number;
export declare const DEG_TO_RAD: number;
export declare enum RENDERER_TYPE {
UNKNOWN = 0,
WEBGL = 1,
CANVAS = 2
}
export declare enum SHAPES {
POLY = 0,
RECT = 1,
CIRC = 2,
ELIP = 3,
RREC = 4
}
export declare enum PRECISION {
LOW = "lowp",
MEDIUM = "mediump",
HIGH = "highp"
}
export declare enum TEXT_GRADIENT {
LINEAR_VERTICAL = 0,
LINEAR_HORIZONTAL = 1
}
export declare enum TEXT_ALIGN {
CENTER = "center",
LEFT = "left",
RIGHT = "right"
}
export declare enum VERTICAL_ALIGN {
MIDDLE = "middle",
UP = "up",
DOWN = "down"
}
export declare enum TEXT_lINETYPE {
SINGLE = "single",
MULTI = "multi"
}
export declare enum LINE_ALIGNMENT {
middle = 0.5,
outter = 1,
inner = 0
}
export declare enum LINE_CAP {
BUTT = "butt",
ROUND = "round",
SQUARE = "square"
}
export declare enum LINE_JOIN {
MITER = "miter",
ROUND = "round",
BEVEL = "bevel"
}
export declare enum BLEND_MODES {
NORMAL = 0,
ADD = 1,
MULTIPLY = 2,
SCREEN = 3,
OVERLAY = 4,
DARKEN = 5,
LIGHTEN = 6,
COLOR_DODGE = 7,
COLOR_BURN = 8,
HARD_LIGHT = 9,
SOFT_LIGHT = 10,
DIFFERENCE = 11,
EXCLUSION = 12,
HUE = 13,
SATURATION = 14,
COLOR = 15,
LUMINOSITY = 16,
NORMAL_NPM = 17,
ADD_NPM = 18,
SCREEN_NPM = 19
}
export declare enum DRAW_MODES {
POINTS = 0,
LINES = 1,
LINE_LOOP = 2,
LINE_STRIP = 3,
TRIANGLES = 4,
TRIANGLE_STRIP = 5,
TRIANGLE_FAN = 6
}
export declare enum SCALE_MODES {
LINEAR = 0,
NEAREST = 1
}
export declare enum WRAP_MODES {
CLAMP = 33071,
REPEAT = 10497,
MIRRORED_REPEAT = 33648
}
export declare enum GC_MODES {
AUTO = 0,
MANUAL = 1
}
export declare const URL_FILE_EXTENSION: any;
export declare const DATA_URI: any;
import { DisplayObject } from './DisplayObject';
import { Point } from '../math';
import CanvasRenderer from '../renderers/CanvasRenderer';
import { WebglRenderer } from '../renderers/WebglRenderer';
export default class Container extends DisplayObject {
mouseChildren: boolean;
children: any[];
containerUpdateTransform: any;
constructor();
applyAutoAdjust(): void;
applyScripts(): void;
onChildrenChange(index: any): void;
addChild(child: DisplayObject): DisplayObject;
addChildAt(child: DisplayObject, index: number): DisplayObject;
swapChildren(child1: DisplayObject, child2: DisplayObject): boolean;
getChildIndex(child: DisplayObject): number;
setChildIndex(child: DisplayObject, index: number): void;
getChildAt(index: number): DisplayObject;
getChildByName(name: string | RegExp, isOnlyOne?: boolean, isRecursive?: boolean): any;
removeChild(child: DisplayObject): DisplayObject;
removeChildAt(index: number): DisplayObject;
removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[];
updateTransform(): void;
calculateBounds(): void;
protected _calculateBounds(): void;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): any;
renderWebGL(renderer: WebglRenderer): void;
private renderAdvancedWebGL;
protected _renderWebGL(renderer: WebglRenderer): void;
renderCanvas(renderer: CanvasRenderer): void;
protected _renderCanvas(renderer: CanvasRenderer): void;
update(deltaTime: number): void;
_onDispatchBubbledEvent(type: string): void;
destroy(): void;
width: number;
height: number;
private static _getElementsByName;
}
import { EventDispatcher } from '../events/EventDispatcher';
import Transform from '../math/Transform';
import { Rectangle } from '../math/Rectangle';
import { Point } from "../math/Point";
import { Component } from '../component/Component';
import Graphics from '../graphics/Graphics';
export declare class DisplayObject extends EventDispatcher {
transform: Transform;
visible: boolean;
renderable: boolean;
parent: any;
stage: any;
name: string;
worldAlpha: number;
protected _localBoundsSelf: Rectangle;
protected _bounds: Rectangle;
protected _boundsID: number;
protected _lastBoundsID: number;
private _mask;
private _alpha;
destroyed: boolean;
mouseEnable: boolean;
tempDisplayObjectParent: DisplayObject;
displayObjectUpdateTransform: any;
displayObjectHitTestPoint: any;
protected _width: number;
protected _height: number;
constructor();
private readonly _tempDisplayObjectParent;
updateTransform(): void;
static _bp: Point;
static _p1: Point;
static _p2: Point;
static _p3: Point;
static _p4: Point;
static temBounds: Rectangle;
hitTestPoint(point: Point, isMouseEvent?: boolean): DisplayObject;
private _recursivePostUpdateTransform;
getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle;
getLocalBounds(rect?: Rectangle): Rectangle;
calculateBounds(): void;
globalToLocal(point: Point, bp?: Point): Point;
localToGlobal(point: Point, bp?: Point): Point;
_onDispatchBubbledEvent(type: string): void;
renderWebGL(renderer: any): void;
renderCanvas(renderer: any): void;
setParent(container: any): any;
setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, anchorX?: number, anchorY?: number): DisplayObject;
destroy(): void;
alpha: number;
x: number;
y: number;
readonly worldMatrix: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/Matrix").Matrix;
readonly localMatrix: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/Matrix").Matrix;
position: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/ObservablePoint").ObservablePoint;
scale: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/ObservablePoint").ObservablePoint;
scaleX: number;
scaleY: number;
anchor: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/ObservablePoint").ObservablePoint;
anchorX: number;
anchorY: number;
skew: import("../../../../../../../../Users/rockyl/WorkSpaces/VisualEditor/renderingengine/src/2d/math/ObservablePoint").ObservablePoint;
rotation: number;
readonly worldVisible: boolean;
mask: Graphics;
width: number;
height: number;
private _components;
update(deltaTime: number): void;
addComponent(component: Component): void;
addComponentAt(component: Component, index: number): void;
removeComponent(component: Component): void;
removeAllComponents(): void;
onAddComponent(component: Component): void;
onRemoveComponent(component: Component): void;
}
import { DisplayObject } from "./DisplayObject";
export declare class FloatDisplay extends DisplayObject {
htmlElement: any;
private _isAdded;
private _transformID;
constructor();
init(htmlElement: any): void;
private getStyle;
updateStyle(): void;
destroy(): void;
}
import { Point, Rectangle } from '../math';
import Texture from '../texture/Texture';
import Container from './Container';
import CanvasRenderer from '../renderers/CanvasRenderer';
import { WebglRenderer } from '../renderers/WebglRenderer';
export default class Sprite extends Container {
private _anchorTexture;
_texture: Texture;
_width: number;
_height: number;
_transformID: number;
_textureID: number;
_transformTrimmedID: number;
_textureTrimmedID: number;
pluginName: string;
indices: Uint16Array;
start: number;
uvs: Float32Array;
vertexData: Float32Array;
vertexTrimmedData: Float32Array;
constructor(texture?: Texture);
_onTextureUpdate(): void;
_onAnchorUpdate(): void;
calculateVertices(): void;
calculateTrimmedVertices(): void;
_renderWebGL(renderer: WebglRenderer): void;
_renderCanvas(renderer: CanvasRenderer): void;
_calculateBounds(): void;
getLocalBounds(rect?: Rectangle): Rectangle;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): any;
destroy(): void;
anchorTexture: any;
texture: Texture;
static from(source: any): Sprite;
static fromFrame(frameId: string): Sprite;
static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite;
}
import Container from "./Container";
import SystemRenderer from "../renderers/SystemRenderer";
import { Rectangle } from "../math";
import { DisplayObject } from "./DisplayObject";
export declare class Stage extends Container {
iosTouchendPreventDefault: boolean;
isPreventDefaultEvent: boolean;
rootDiv: any;
renderObj: SystemRenderer;
renderType: number;
static getStage(stageName?: string): Stage;
private static _stageList;
static pause: boolean;
private static _pause;
viewRect: Rectangle;
autoSteering: boolean;
autoResize: boolean;
desWidth: number;
desHeight: number;
divHeight: number;
divWidth: number;
private _bgColor;
bgColor: number;
scaleMode: string;
private _scaleMode;
private _flush;
private _currentFlush;
static _dragDisplay: DisplayObject;
private static _isLoadedVConsole;
private _lastDpList;
private _rid;
private _floatDisplayList;
constructor(rootDivId?: string, desW?: number, desH?: number, frameRate?: number, scaleMode?: string, renderType?: number, transparent?: boolean, bgColor?: number);
render(): void;
private _ml;
private _mp;
private _initMouseEvent;
private _mouseDownPoint;
flush(): void;
setFrameRate(fps: number): void;
getFrameRate(): number;
getRootDivWH(div: HTMLDivElement): {
w: number;
h: number;
};
kill(): void;
private _mouseEventTypes;
private onMouseEvent;
private setAlign;
resize(): void;
getBounds(): Rectangle;
private static allUpdateObjList;
static flushAll(): void;
static addUpdateObj(target: any): void;
static removeUpdateObj(target: any): void;
destroy(): void;
}
export { default as Container } from './Container';
export { DisplayObject } from './DisplayObject';
export { FloatDisplay } from "./FloatDisplay";
export { default as Sprite } from "./Sprite";
export { Stage } from "./Stage";
import { HashObject } from "../HashObject";
export declare class Event extends HashObject {
static RESIZE: string;
static ON_SCROLL_TO_HEAD: string;
static ON_SCROLL_STOP: string;
static ON_SCROLL_START: string;
static ON_SCROLL_TO_END: string;
static ON_INIT_STAGE: string;
static ADDED_TO_STAGE: string;
static REMOVED_FROM_STAGE: string;
static ENTER_FRAME: string;
static END_FRAME: string;
static CALL_FRAME: string;
static COMPLETE: string;
static PROGRESS: string;
static ERROR: string;
static ABORT: string;
static START: string;
static TIMER: string;
static TIMER_COMPLETE: string;
type: string;
target: any;
data: any;
constructor(type: string);
stopImmediatePropagation(): void;
stopPropagation(): void;
private _bpd;
private _pd;
destroy(): void;
reset(type: string, target: any): void;
}
import { HashObject } from "../HashObject";
export declare class EventDispatcher extends HashObject {
protected eventTypes: any;
protected eventTypes1: any;
constructor();
private static _MECO;
static _totalMEC: number;
static getMouseEventCount(type?: string): number;
addEventListener(type: string, listener: Function, context?: any, useCapture?: boolean): void;
once(type: string, listener: Function, context?: any, useCapture?: boolean): void;
private _changeMouseCount;
private _defaultEvent;
dispatchEvent(event: any, data?: any, useCapture?: boolean): boolean;
hasEventListener(type: string, useCapture?: boolean): boolean;
removeEventListener(type: string, listener: Function, context?: any, useCapture?: boolean): void;
removeAllEventListener(): void;
destroy(): void;
}
export declare class GDispatcher {
private static callbackPool;
private static thisObjPool;
static addEvent(name: string, callback: any, thisObj: any): void;
static removeEvent(name: string, callback: any, thisObj?: any): void;
static dispatchEvent(name: string, ...args: any[]): void;
}
import { Event } from "./Event";
import { DisplayObject } from "../display/DisplayObject";
export declare class MouseEvent extends Event {
static MOUSE_DOWN: string;
static MOUSE_UP: string;
static CLICK: string;
static MOUSE_MOVE: string;
static MOUSE_OVER: string;
static MOUSE_OUT: string;
clientX: number;
clientY: number;
stageX: number;
stageY: number;
localX: number;
localY: number;
currentTarget: DisplayObject;
identifier: any;
constructor(type: string);
updateAfterEvent(): void;
destroy(): void;
}
export * from './Event';
export * from './EventDispatcher';
export * from './GDispatcher';
export * from './MouseEvent';
import GraphicsData from './GraphicsData';
import { Matrix, Point } from '../math';
import { Polygon } from "./shapes";
import { DisplayObject } from '../display/DisplayObject';
import Texture from '../texture/Texture';
import CanvasRenderer from '../renderers/CanvasRenderer';
import { WebglRenderer } from '../renderers/WebglRenderer';
import FillStyle from './styles/FillStyle';
import LineStyle from './styles/LineStyle';
import Container from '../display/Container';
export default class Graphics extends Container {
private _fillStyle;
private _lineStyle;
readonly fill: FillStyle;
readonly line: LineStyle;
private _tint;
tint: number;
private batchTint;
private _matrix;
matrix: Matrix;
hitTestByPixel: boolean;
private _holeMode;
private _currentPath;
graphicsData: GraphicsData[];
isUsedToMask: boolean;
boundsPadding: number;
private dirty;
private boundsDirty;
cacheAsBitmap: boolean;
private cacheDirty;
private _canvasBuffer;
_texture: Texture;
offsetX: number;
offsetY: number;
verts: any;
indices: any;
private batches;
private geoBatches;
private batchDirty;
private uvs;
private vertexData;
private shapeIndex;
private _transformID;
constructor();
clone(): Graphics;
lineStyle(lineWidth?: number, color?: number, alpha?: number, alignment?: number, native?: boolean): Graphics;
lineTextureStyle(width?: number, texture?: Texture, color?: number, alpha?: number, matrix?: any, alignment?: number, native?: boolean): this;
private startPoly;
private finishPoly;
moveTo(x: number, y: number): Graphics;
lineTo(x: number, y: number): Graphics;
private _initCurve;
quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics;
bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics;
arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics;
beginFill(color?: number | string, alpha?: number): Graphics;
beginTextureFill(texture?: Texture, color?: number, alpha?: number, matrix?: Matrix): this;
endFill(): Graphics;
closePath(): Graphics;
beginHole(): this;
endHole(): this;
drawRect(x: number, y: number, width: number, height: number): Graphics;
drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics;
drawCircle(x: number, y: number, radius: number): Graphics;
drawEllipse(x: number, y: number, width: number, height: number): Graphics;
drawPolygon(path: number[] | Point[] | Polygon): Graphics;
drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: number): Graphics;
private drawShape;
clear(): Graphics;
isFastRect(): boolean;
_renderWebGL(renderer: WebglRenderer): void;
private updateBatch;
private calculateTints;
private calculateVertices;
private transformPoints;
_renderCanvas(renderer: CanvasRenderer): void;
_calculateBounds(): void;
hitTestPoint(point: Point, isMouseEvent?: boolean): DisplayObject;
private hitTestPointAccuratly;
updateLocalBoundsSelf(): void;
private generateCanvasTexture;
destroy(): void;
private proccessHoles;
private addUvs;
private adjustUvs;
}
import Circle from "./shapes/Circle";
import { Matrix, Rectangle } from "../math";
import Ellipse from "./shapes/Ellipse";
import Polygon from "./shapes/Polygon";
import RoundedRectangle from "./shapes/RoundedRectangle";
import { HashObject } from "../HashObject";
import LineStyle from "./styles/LineStyle";
import FillStyle from "./styles/FillStyle";
export default class GraphicsData extends HashObject {
fillStyle: FillStyle;
lineStyle: LineStyle;
matrix: Matrix;
holes: any[];
shape: any;
type: number;
points: number[];
constructor(shape: Circle | Rectangle | Ellipse | Polygon | RoundedRectangle, fillStyle?: FillStyle, lineStyle?: LineStyle, matrix?: Matrix);
clone(): GraphicsData;
destroy(): void;
}
import { LINE_CAP, LINE_JOIN } from "../const";
import { Point } from "../math";
import { DisplayObject } from "../display/DisplayObject";
import Sprite from "../display/Sprite";
export declare class Shape extends Sprite {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
dirty: boolean;
offsetX: number;
offsetY: number;
constructor();
private _command;
private _isBitmapStroke;
private _isBitmapFill;
hitTestByPixel: boolean;
drawRoundRect(x: number, y: number, w: number, h: number, rTL?: number, rTR?: number, rBL?: number, rBR?: number): void;
moveTo(x: number, y: number): void;
lineTo(x: number, y: number): void;
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
quadraticCurveTo(cpX: number, cpY: number, x: number, y: number): void;
bezierCurveTo(cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, x: number, y: number): void;
closePath(): void;
drawRect(x: number, y: number, w: number, h: number): void;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
drawCircle(x: number, y: number, radius: number, counterclockwise?: boolean): void;
drawEllipse(x: number, y: number, w: number, h: number): void;
clear(): void;
beginFill(color: number, alpha?: number): void;
beginLinearGradientFill(points: any, colors: any): void;
beginRadialGradientFill: (points: any, colors: any) => void;
beginBitmapFill(image: any, matrix: Array<number>): void;
private _fill;
beginStroke(color: number, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number, alpha?: number): void;
beginLinearGradientStroke(points: Array<number>, colors: any, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
beginRadialGradientStroke(points: Array<number>, colors: any, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
beginBitmapStroke(image: any, matrix: Array<number>, lineWidth?: number, cap?: LINE_CAP, join?: LINE_JOIN, miter?: number): void;
private _stroke;
endFill(): void;
endStroke(): void;
updateShape(): void;
private _drawShape;
hitTestPoint(globalPoint: Point, isMouseEvent?: boolean): DisplayObject;
changeColor(infoObj: any): void;
updateTexture(): void;
_renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void;
destroy(): void;
}
import GraphicsData from "../GraphicsData";
import Graphics from "../Graphics";
declare const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: any, graphicsGeometry: Graphics): void;
};
export default _default;
import GraphicsData from "../GraphicsData";
import Graphics from "../Graphics";
export default function (graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
import Graphics from "../Graphics";
import GraphicsData from "../GraphicsData";
declare const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
};
export default _default;
import GraphicsData from "../GraphicsData";
import Graphics from "../Graphics";
declare const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphics: Graphics): void;
};
export default _default;
import GraphicsData from "../GraphicsData";
import Graphics from "../Graphics";
declare const _default: {
build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
};
export default _default;
export declare function earcut(data: any, holeIndices: any, dim: any): any[];
import { Point, Rectangle } from '../../math';
export default class Circle {
x: number;
y: number;
radius: number;
type: number;
constructor(x?: number, y?: number, radius?: number);
clone(): Circle;
isPointIn(point: Point): boolean;
getBounds(): Rectangle;
}
import { Point, Rectangle } from '../../math';
export default class Ellipse {
x: number;
y: number;
width: number;
height: number;
type: number;
constructor(x?: number, y?: number, width?: number, height?: number);
clone(): Ellipse;
isPointIn(point: Point): boolean;
getBounds(): Rectangle;
}
import { Point } from '../../math/Point';
export default class Polygon {
closed: boolean;
points: number[];
type: number;
constructor(...points: any[]);
clone(): Polygon;
close(): void;
isPointIn(point: Point): boolean;
}
import { Point } from '../../math';
export default class RoundedRectangle {
x: number;
y: number;
width: number;
height: number;
radius: number;
type: number;
constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
clone(): RoundedRectangle;
isPointIn(point: Point): boolean;
}
export { default as Circle } from './Circle';
export { default as Ellipse } from './Ellipse';
export { default as Polygon } from './Polygon';
export { default as RoundedRectangle } from './RoundedRectangle';
import Texture from "../../texture/Texture";
import { Matrix } from "../../math";
export default class FillStyle {
color: number;
alpha: number;
texture: Texture;
matrix: Matrix;
visible: boolean;
alphaBlock: boolean;
constructor();
clone(): FillStyle;
reset(): void;
destroy(): void;
}
import FillStyle from './FillStyle';
import { LINE_ALIGNMENT } from '../../const';
export default class LineStyle extends FillStyle {
native: boolean;
width: number;
alignment: LINE_ALIGNMENT;
clone(): LineStyle;
reset(): void;
}
export declare function bezierCurveControlPoint(points: any): {
A: any[];
B: any[];
};
export default function bezierCurveTo(fromX: number, fromY: number, cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number, n: number, path?: number[]): number[];
export { default as bezierCurveTo } from './bezierCurveTo';
export { bezierCurveControlPoint } from "./bezierCurveControlPoint";
export declare const GRAPHICS_CURVES: {
adaptive: boolean;
maxLength: number;
minSegments: number;
maxSegments: number;
segmentsCount: Function;
};
export declare function quadraticCurveLength(fromX: number, fromY: number, cpX: number, cpY: number, toX: number, toY: number): number;
export declare function bezierCurveLength(fromX: number, fromY: number, cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): number;
import { EventDispatcher } from "../events/EventDispatcher";
import { Parser } from "../svga/parser";
import { VideoEntity } from "../svga/VideoEntity";
export declare class Loader extends EventDispatcher {
caches: {};
parser: Parser;
_req: XMLHttpRequest;
constructor();
loadSheet(callback: Function, url: string): void;
loadRaw(callback: Function, url: string, type: 'text' | 'json'): void;
loadJson(callback: Function, url: string): void;
loadText(callback: Function, url: string): void;
loadTexture(callback: Function, url: string): void;
loadImage(callback: Function, url: string, crossOrigin?: boolean): HTMLImageElement;
loadSvga(callback: (suc: boolean, data: VideoEntity) => void, url: string): void;
cache(name: string, data: any): void;
}
export declare const globalLoader: Loader;
declare const GroupD8: {
E: number;
SE: number;
S: number;
SW: number;
W: number;
NW: number;
N: number;
NE: number;
MIRROR_VERTICAL: number;
MIRROR_HORIZONTAL: number;
uX: (ind: any) => number;
uY: (ind: any) => number;
vX: (ind: any) => number;
vY: (ind: any) => number;
inv: (rotation: any) => number;
add: (rotationSecond: any, rotationFirst: any) => any;
sub: (rotationSecond: any, rotationFirst: any) => any;
rotate180: (rotation: any) => number;
isVertical: (rotation: any) => boolean;
byDirection: (dx: any, dy: any) => number;
matrixAppendRotationInv: (matrix: any, rotation: any, tx?: number, ty?: number) => void;
};
export default GroupD8;
import { Point } from "././Point";
import { HashObject } from "../HashObject";
export declare class Matrix extends HashObject {
a: number;
b: number;
c: number;
d: number;
tx: number;
ty: number;
array: any;
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
clone(): Matrix;
copy(matrix: Matrix | any): this;
transformPoint(x: number, y: number, bp?: Point): Point;
transformPointInverse(x: number, y: number, bp?: Point): Point;
setFrom(mtx: Matrix): void;
identity(): void;
invert(): Matrix;
createBox(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number, ax: number, ay: number): void;
prepend: (mtx: Matrix) => void;
append(matrix: Matrix): void;
static isEqual(m1: Matrix, m2: Matrix): boolean;
concat(mtx: Matrix): void;
rotate(angle: number): void;
scale(sx: number, sy: number): void;
translate(dx: number, dy: number): void;
set(a: any, b: any, c: any, d: any, tx: any, ty: any): this;
getRotation(): number;
toArray(transpose?: boolean, out?: any): any;
static readonly IDENTITY: Matrix;
static readonly TEMP_MATRIX: Matrix;
destroy(): void;
}
import { Point } from "../math/Point";
import { HashObject } from "../HashObject";
export declare class ObservablePoint extends HashObject {
_x: number;
_y: number;
cb: any;
scope: any;
constructor(cb: Function, scope: any, x?: number, y?: number);
set(x?: number, y?: number): void;
copy(point: Point | ObservablePoint): void;
x: number;
y: number;
destroy(): void;
}
import { HashObject } from "../HashObject";
export declare class Point extends HashObject {
destroy(): void;
constructor(x?: number, y?: number);
x: number;
y: number;
static distance(...args: any[]): number;
set(x: number, y: number): void;
}
import { HashObject } from "../HashObject";
import { Point } from "./Point";
export declare class Rectangle extends HashObject {
type: number;
constructor(x?: number, y?: number, width?: number, height?: number);
clear(): void;
copy(rect: Rectangle): this;
clone(): Rectangle;
x: number;
y: number;
width: number;
height: number;
readonly left: number;
readonly right: number;
readonly top: number;
readonly bottom: number;
isPointIn(point: Point): boolean;
fit(rectangle: Rectangle): void;
static createFromRects(...arg: Rectangle[]): Rectangle;
static createFromPoints(rect: Rectangle, ...arg: Point[]): Rectangle;
static createFromVertexData(rect: Rectangle, vertexData: Float32Array): Rectangle;
static createRectfrom2Point(rect: Rectangle, p1: Point, p2: Point): Rectangle;
static testRectCross(ra: Rectangle, rb: Rectangle): boolean;
destroy(): void;
}
import { ObservablePoint } from './ObservablePoint';
import { Matrix } from "./Matrix";
import { HashObject } from '../HashObject';
export default class Transform extends HashObject {
worldMatrix: Matrix;
localMatrix: Matrix;
_worldID: number;
_parentID: number;
position: ObservablePoint;
scale: ObservablePoint;
anchor: ObservablePoint;
skew: ObservablePoint;
_rotation: number;
_cx: number;
_sx: number;
_cy: number;
_sy: number;
_localID: number;
_currentLocalID: number;
constructor();
onChange(): void;
updateSkew(): void;
updateLocalMatrix(): void;
updateWorldMatrix(parentTransform: Transform): void;
rotation: number;
destroy(): void;
}
export { Matrix } from './Matrix';
export { Point } from './Point';
export { ObservablePoint } from './ObservablePoint';
export { Rectangle } from './Rectangle';
export { default as Transform } from './Transform';
export { default as GroupD8 } from './GroupD8';
import SystemRenderer from './SystemRenderer';
import CanvasMaskManager from './managers/CanvasMaskManager';
import { RendererOptions } from './RendererOptions';
import { Matrix } from '../math';
import { DisplayObject } from '../display/DisplayObject';
import CanvasSpriteRenderer from './plugins/CanvasSpriteRenderer';
import { CanvasGraphicsRenderer } from './plugins/CanvasGraphicsRenderer';
export default class CanvasRenderer extends SystemRenderer {
rootContext: CanvasRenderingContext2D;
context: CanvasRenderingContext2D;
maskManager: CanvasMaskManager;
smoothProperty: string;
plugins: {
sprite: CanvasSpriteRenderer;
graphics: CanvasGraphicsRenderer;
};
renderingToScreen: boolean;
constructor(options: RendererOptions);
render(displayObject: DisplayObject, renderTexture?: any, transform?: Matrix): void;
clear(clearColor: string): void;
destroy(): void;
resize(screenWidth: number, screenHeight: number): void;
destroyPlugins(): void;
}
export interface RendererOptions {
htmlElement?: HTMLCanvasElement;
transparent?: boolean;
antialias?: boolean;
preserveDrawingBuffer?: boolean;
backgroundColor?: number;
roundPixels?: boolean;
}
import Container from '../display/Container';
import { EventDispatcher } from '../events/EventDispatcher';
import { DisplayObject } from "../display/DisplayObject";
import { RendererOptions } from "./RendererOptions";
export default class SystemRenderer extends EventDispatcher {
options: RendererOptions;
type: number;
htmlElement: HTMLCanvasElement;
transparent: boolean;
preserveDrawingBuffer: boolean;
_backgroundColor: number;
_backgroundColorRgba: number[];
_backgroundColorString: string;
_tempDisplayObjectParent: Container;
_lastObjectRendered: DisplayObject;
constructor(options: RendererOptions);
resize(width: number, height: number): void;
render(displayObject: any, renderTexture?: any, transform?: any): void;
destroy(): void;
backgroundColor: number;
}
import SystemRenderer from "./SystemRenderer";
import { RendererOptions } from "./RendererOptions";
import { GLShader, VertexArrayObject } from "../../glCore";
import RenderTarget from "./renderTarget/RenderTarget";
import TextureManager from "./managers/TextureManager";
import TextureGarbageCollector from "./managers/TextureGarbageCollector";
import { Matrix } from "../math";
import WebGLState from "./webgl/WebGLState";
import BatchManager from "./managers/BatchManager";
import MaskManager from "./managers/MaskManager";
import StencilManager from "./managers/StencilManager";
import { DisplayObject } from "../display/DisplayObject";
export declare class WebglRenderer extends SystemRenderer {
plugins: {};
gl: WebGLRenderingContext;
CONTEXT_UID: number;
maskManager: MaskManager;
stencilManager: StencilManager;
batchManager: BatchManager;
textureManager: TextureManager;
textureGC: TextureGarbageCollector;
state: WebGLState;
renderingToScreen: boolean;
_activeShader: GLShader;
_activeVao: VertexArrayObject;
_activeRenderTarget: RenderTarget;
rootRenderTarget: RenderTarget;
constructor(options: RendererOptions);
_initContext(): void;
render(displayObject: DisplayObject, renderTexture?: any, transform?: any): void;
clear(clearColor: number[]): void;
setTransform(matrix: Matrix): void;
clearRenderTexture(renderTexture: any, clearColor: any): this;
bindShader(shader: GLShader, autoProject?: boolean): WebglRenderer;
createVao(): VertexArrayObject;
bindVao(vao: VertexArrayObject): WebglRenderer;
reset(): WebglRenderer;
bindRenderTexture(renderTexture: any, transform?: Matrix): WebglRenderer;
bindRenderTarget(renderTarget: RenderTarget): WebglRenderer;
resize(screenWidth: any, screenHeight: any): void;
destroy(): void;
handleContextRestored(): void;
handleContextLost(event: WebGLContextEvent): void;
initPlugins(staticMap: any): void;
destroyPlugins(): void;
static __plugins: any;
static registerPlugin(pluginName: string, ctor: Function): void;
}
import ObjectRenderer from '../webgl/ObjectRenderer';
import { WebglRenderer } from '../WebglRenderer';
export default class BatchManager {
renderer: WebglRenderer;
emptyRenderer: ObjectRenderer;
currentRenderer: ObjectRenderer;
constructor(renderer: WebglRenderer);
setObjectRenderer(objectRenderer: ObjectRenderer): void;
flush(): void;
reset(): void;
}
import { HashObject } from '../../HashObject';
import CanvasRenderer from '../CanvasRenderer';
import Graphics from '../../graphics/Graphics';
export default class CanvasMaskManager extends HashObject {
renderer: any;
constructor(renderer: CanvasRenderer);
pushMask(maskData: Graphics): void;
renderGraphicsShape(graphics: Graphics): void;
popMask(renderer: CanvasRenderer): void;
destroy(): void;
}
import Graphics from '../../graphics/Graphics';
import { WebglRenderer } from '../WebglRenderer';
import RenderTarget from '../renderTarget/RenderTarget';
export default class MaskManager {
renderer: WebglRenderer;
scissor: boolean;
scissorData: any;
scissorRenderTarget: RenderTarget;
enableScissor: boolean;
alphaMaskPool: any[];
alphaMaskIndex: number;
constructor(renderer: WebglRenderer);
pushMask(target: any, maskData: any): void;
popMask(target: any, maskData: any): void;
pushStencilMask(maskData: Graphics): void;
popStencilMask(): void;
pushScissorMask(target: any, maskData: Graphics): void;
popScissorMask(): void;
destroy(): void;
}
import { WebglRenderer } from '../WebglRenderer';
import Graphics from '../../graphics/Graphics';
export default class StencilManager {
renderer: WebglRenderer;
stencilMaskStack: Graphics[];
constructor(renderer: WebglRenderer);
setMaskStack(stencilMaskStack: Graphics[]): void;
pushStencil(graphics: Graphics): void;
popStencil(): void;
_useCurrent(): void;
_getBitwiseMask(): number;
destroy(): void;
}
import { WebglRenderer } from '../WebglRenderer';
export default class TextureGarbageCollector {
renderer: WebglRenderer;
count: number;
checkCount: number;
maxIdle: number;
checkCountMax: number;
mode: number;
constructor(renderer: WebglRenderer);
update(): void;
run(): void;
unload(displayObject: any): void;
}
import { GLTexture } from '../../../glCore';
import { WebglRenderer } from '../WebglRenderer';
export default class TextureManager {
boundTextures: any;
renderer: WebglRenderer;
emptyTextures: any;
_nextTextureLocation: number;
currentLocation: number;
gl: WebGLRenderingContext;
_managedTextures: Array<any>;
constructor(renderer: WebglRenderer);
onContextChange(): void;
bindTexture(texture: any, location?: number, forceLocation?: boolean): number;
getTexture(): void;
updateTexture(texture: any, location?: number): GLTexture;
unbindTexture(texture: any): void;
destroyTexture(texture: any, skipRemove: any): void;
removeAll(): void;
destroy(): void;
}
import BatchDrawCall from '../webgl/BatchDrawCall';
import ObjectRenderer from '../webgl/ObjectRenderer';
import { WebglRenderer } from '../WebglRenderer';
import { GLBuffer, GLShader, VertexArrayObject } from '../../../glCore';
export default class BatchRenderer extends ObjectRenderer {
vertSize: number;
vertByteSize: number;
size: number;
currentSize: number;
currentIndexSize: number;
aBuffers: {};
iBuffers: {};
shader: GLShader;
currentIndex: number;
groups: BatchDrawCall[];
elements: any[];
vaos: VertexArrayObject[];
vaoMax: number;
vertexCount: number;
MAX_TEXTURES: number;
vertexBuffers: GLBuffer[];
indexBuffers: GLBuffer[];
constructor(renderer: WebglRenderer);
onContextChange(): void;
onPreRender(): void;
render(element: any): void;
getIndexBuffer(size: any): any;
getAttributeBuffer(size: number): any;
flush(): void;
packGeometry(element: any, float32View: any, uint32View: any, indexBuffer: any, index: any, indexCount: any): void;
start(): void;
stop(): void;
destroy(): void;
}
import CanvasRenderer from '../CanvasRenderer';
import Graphics from '../../graphics/Graphics';
import GraphicsData from '../../graphics/GraphicsData';
export declare class CanvasGraphicsRenderer {
renderer: CanvasRenderer;
constructor(renderer: CanvasRenderer);
render(graphics: Graphics): void;
destroy(): void;
}
export declare function holePath(graphicsData: GraphicsData, context: CanvasRenderingContext2D, ccw?: boolean): void;
export declare function judgeCcw(points: number[]): boolean;
import CanvasRenderer from '../CanvasRenderer';
export default class CanvasSpriteRenderer {
renderer: CanvasRenderer;
constructor(renderer: CanvasRenderer);
render(sprite: any): void;
destroy(): void;
}
export default class CanvasRenderTarget {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
constructor(width: number, height: number);
clear(): void;
resize(width: number, height: number): void;
destroy(): void;
width: number;
height: number;
}
import { Matrix, Rectangle } from '../../math';
import { GLBuffer, GLFramebuffer, GLTexture } from '../../../glCore';
import Graphics from '../../graphics/Graphics';
export default class RenderTarget {
gl: WebGLRenderingContext;
frameBuffer: GLFramebuffer;
texture: GLTexture;
clearColor: number[];
size: Rectangle;
projectionMatrix: Matrix;
transform: Matrix;
frame: Rectangle;
defaultFrame: Rectangle;
destinationFrame: any;
sourceFrame: any;
stencilBuffer: GLBuffer;
stencilMaskStack: Graphics[];
scaleMode: number;
root: boolean;
constructor(gl: WebGLRenderingContext, width?: number, height?: number, scaleMode?: number, root?: boolean);
clear(clearColor?: number[]): void;
attachStencilBuffer(): void;
setFrame(destinationFrame?: Rectangle, sourceFrame?: Rectangle): void;
activate(): void;
calculateProjection(destinationFrame: Rectangle, sourceFrame?: Rectangle): void;
resize(width: number, height: number): void;
destroy(): void;
}
export declare class BatchBuffer {
vertices: ArrayBuffer;
float32View: Float32Array;
uint32View: Uint32Array;
positions: any;
uvs: any;
colors: any;
constructor(size: number);
destroy(): void;
}
import BaseTexture from "../../texture/BaseTexture";
export default class BatchDrawCall {
textures: BaseTexture[];
textureCount: number;
start: number;
size: number;
type: number;
constructor();
}
import { DisplayObject } from "../../display/DisplayObject";
import { WebglRenderer } from "../WebglRenderer";
export default class ObjectRenderer {
renderer: WebglRenderer;
constructor(renderer: WebglRenderer);
onContextChange(): void;
start(): void;
stop(): void;
flush(): void;
render(object: DisplayObject): void;
destroy(): void;
}
export default class WebGLState {
blendModes: any;
activeState: Uint8Array;
defaultState: Uint8Array;
gl: any;
maxAttribs: any;
attribState: {
tempAttribState: any[];
attribState: any[];
};
nativeVaoExtension: any;
constructor(gl: WebGLRenderingContext);
setState(state: any): void;
setBlend(value: any): void;
setBlendMode(value: any): void;
setDepthTest(value: any): void;
setCullFace(value: any): void;
setFrontFace(value: any): void;
resetAttributes(): void;
resetToDefault(): void;
resetTo3D(): void;
}
export declare function createIndicesForQuads(size: number): Uint16Array;
import { GLShader } from '../../../glCore';
export declare function generateMultiTextureShader(gl: any, maxTextures: any): GLShader;
import Container from "../display/Container";
import { VideoEntity } from "./VideoEntity";
export declare class MovieClip extends Container {
lockStep: boolean;
readonly currentFrame: number;
private _curFrame;
readonly isPlaying: boolean;
private _isPlaying;
readonly isFront: boolean;
private _isFront;
totalFrames: number;
loops: number;
private textures;
private timeInterval;
private deltaFrame;
private frameCount;
constructor(mv?: VideoEntity);
init(mv: VideoEntity): void;
private initChildren;
private resetTransform;
resetTransformAll(frameIndex: number): void;
setImage(imagekey: any, imageUrl: string): void;
stop(): void;
nextFrame(): void;
prevFrame(): void;
gotoAndStop(frameIndex: number): void;
play(isFront?: boolean): void;
private _lastFrame;
readonly isInTimeFrame: boolean;
gotoAndPlay(frameIndex: number, isFront?: boolean): void;
startAniRange(beginFrame?: number, endFrame?: number, loops?: number, callback?: Function): void;
private startTime;
private startFrame;
private lastDeltaFrame;
private _endMark;
commonDeltaTime: number;
updateFrame(): void;
private getCurFrameWhenLockStep;
update(deltaTime: number): void;
destroy(): void;
}
import { SpriteEntity } from './spriteEntity';
import { HashObject } from '../HashObject';
export declare class VideoEntity extends HashObject {
version: string;
videoSize: {
width: number;
height: number;
};
FPS: number;
frames: number;
images: {};
hasBeenCached: boolean;
sprites: SpriteEntity[];
audios: any[];
constructor(spec: any, images: any);
resetSprites(spec: any): void;
destroy(): void;
}
export declare class BezierPath {
_d: any;
_transform: any;
_styles: any;
_shape: any;
constructor(d?: any, transform?: any, styles?: any);
}
import { BezierPath } from './bezierPath';
export declare class EllipsePath extends BezierPath {
_x: any;
_y: any;
_radiusX: any;
_radiusY: any;
_transform: any;
_styles: any;
constructor(x: any, y: any, radiusX: any, radiusY: any, transform: any, styles: any);
}
export declare class FrameEntity {
alpha: number;
transform: {
a: number;
b: number;
c: number;
d: number;
tx: number;
ty: number;
};
layout: {
x: number;
y: number;
width: number;
height: number;
};
nx: number;
ny: number;
maskPath: any;
shapes: any[];
constructor(spec: any);
static lastShapes: any;
}
export { VideoEntity } from "./VideoEntity";
export { MovieClip } from "./MovieClip";
declare const _default: (data: any, cb: any, failure: any) => void;
export default _default;
declare function inflate(input: any, options: any): any;
declare const _default: {
inflate: typeof inflate;
};
export default _default;
declare function assign(obj: any, objO: any): any;
declare function shrinkBuf(buf: any, size: any): any;
export declare const utils: {
assign: typeof assign;
shrinkBuf: typeof shrinkBuf;
Buf8: any;
Buf16: any;
Buf32: any;
arraySet: any;
flattenChunks: any;
};
export {};
declare function string2buf(str: any): any;
declare function buf2binstring(buf: any, len?: any): any;
declare function binstring2buf(str: any): any;
declare function buf2string(buf: any, max: any): any;
declare function utf8border(buf: any, max: any): any;
export declare const strings: {
utf8border: typeof utf8border;
buf2string: typeof buf2string;
binstring2buf: typeof binstring2buf;
buf2binstring: typeof buf2binstring;
string2buf: typeof string2buf;
};
export {};
declare function adler32(adler: any, buf: any, len: any, pos: any): number;
export default adler32;
declare const _default: {
Z_NO_FLUSH: number;
Z_PARTIAL_FLUSH: number;
Z_SYNC_FLUSH: number;
Z_FULL_FLUSH: number;
Z_FINISH: number;
Z_BLOCK: number;
Z_TREES: number;
Z_OK: number;
Z_STREAM_END: number;
Z_NEED_DICT: number;
Z_ERRNO: number;
Z_STREAM_ERROR: number;
Z_DATA_ERROR: number;
Z_BUF_ERROR: number;
Z_NO_COMPRESSION: number;
Z_BEST_SPEED: number;
Z_BEST_COMPRESSION: number;
Z_DEFAULT_COMPRESSION: number;
Z_FILTERED: number;
Z_HUFFMAN_ONLY: number;
Z_RLE: number;
Z_FIXED: number;
Z_DEFAULT_STRATEGY: number;
Z_BINARY: number;
Z_TEXT: number;
Z_UNKNOWN: number;
Z_DEFLATED: number;
};
export default _default;
declare function crc32(crc: any, buf: any, len: any, pos: any): number;
export default crc32;
declare function deflateResetKeep(strm: any): any;
declare function deflateReset(strm: any): any;
declare function deflateSetHeader(strm: any, head: any): number;
declare function deflateInit2(strm: any, level: any, method: any, windowBits: any, memLevel: any, strategy: any): any;
declare function deflateInit(strm: any, level: any): any;
declare function deflate(strm: any, flush: any): any;
declare function deflateEnd(strm: any): any;
declare function deflateSetDictionary(strm: any, dictionary: any): number;
declare const _default: {
deflateInit: typeof deflateInit;
deflateInit2: typeof deflateInit2;
deflateReset: typeof deflateReset;
deflateResetKeep: typeof deflateResetKeep;
deflateSetHeader: typeof deflateSetHeader;
deflate: typeof deflate;
deflateEnd: typeof deflateEnd;
deflateSetDictionary: typeof deflateSetDictionary;
deflateInfo: string;
};
export default _default;
declare function GZheader(): void;
export default GZheader;
export default function inflate_fast(strm: any, start: any): void;
declare function inflateResetKeep(strm: any): number;
declare function inflateReset(strm: any): number;
declare function inflateReset2(strm: any, windowBits: any): number;
declare function inflateInit2(strm: any, windowBits: any): any;
declare function inflateInit(strm: any): any;
declare function inflate(strm: any, flush: any): any;
declare function inflateEnd(strm: any): number;
declare function inflateGetHeader(strm: any, head: any): number;
declare function inflateSetDictionary(strm: any, dictionary: any): number;
declare const _default: {
inflateReset: typeof inflateReset;
inflateReset2: typeof inflateReset2;
inflateResetKeep: typeof inflateResetKeep;
inflateInit: typeof inflateInit;
inflateInit2: typeof inflateInit2;
inflate: typeof inflate;
inflateEnd: typeof inflateEnd;
inflateGetHeader: typeof inflateGetHeader;
inflateSetDictionary: typeof inflateSetDictionary;
inflateInfo: string;
};
export default _default;
export default function inflate_table(type: any, lens: any, lens_index: any, codes: any, table: any, table_index: any, work: any, opts: any): 1 | 0 | -1;
declare const _default: {
2: string;
1: string;
0: string;
'-1': string;
'-2': string;
'-3': string;
'-4': string;
'-5': string;
'-6': string;
};
export default _default;
declare function _tr_init(s: any): void;
declare function _tr_stored_block(s: any, buf: any, stored_len: any, last: any): void;
declare function _tr_align(s: any): void;
declare function _tr_flush_block(s: any, buf: any, stored_len: any, last: any): void;
declare function _tr_tally(s: any, dist: any, lc: any): boolean;
declare const _default: {
_tr_init: typeof _tr_init;
_tr_stored_block: typeof _tr_stored_block;
_tr_flush_block: typeof _tr_flush_block;
_tr_tally: typeof _tr_tally;
_tr_align: typeof _tr_align;
};
export default _default;
declare function ZStream(): void;
export default ZStream;
export declare class Parser {
load(url: any, success: any, failure: any): void;
loadViaWorker(url: any, success: any, failure: any): void;
}
import * as protobuf from "protobufjs/light";
export declare const proto: protobuf.Root;
export declare const ProtoMovieEntity: protobuf.Type;
import { BezierPath } from './bezierPath';
export declare class RectPath extends BezierPath {
_x: any;
_y: any;
_width: any;
_height: any;
_cornerRadius: any;
_transform: any;
_styles: any;
constructor(x: any, y: any, width: any, height: any, cornerRadius: any, transform: any, styles: any);
}
export declare class SpriteEntity {
matteKey: any;
imageKey: any;
frames: any[];
constructor(spec: any);
}
import { TextField } from "./TextField";
export declare class EditableText extends TextField {
htmlElement: any;
private _prompt;
prompt: string;
private _promptColor;
promptColor: string;
private _textColor;
textColor: string;
constructor();
}
import { FloatDisplay } from "../display/FloatDisplay";
import { TextField } from "./TextField";
export declare class InputText extends FloatDisplay {
private _view;
inputType: number;
isAutoDownKeyBoard: boolean;
private static _inputTypeList;
constructor(inputType?: number);
init(htmlElement: any): void;
initInfo(text: string, color: string, align: string, size: number, font: string, showBorder: boolean, lineSpacing: number, textWidth: number): void;
lineSpacing: number;
bold: boolean;
italic: boolean;
textHeight: number;
textWidth: number;
color: string;
border: boolean;
text: string;
maxCharacters: number;
convertToTextField(textField?: TextField): TextField;
}
import { TEXT_ALIGN, TEXT_lINETYPE, VERTICAL_ALIGN } from "../const";
import Sprite from "../display/Sprite";
export declare class TextField extends Sprite {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
dirty: boolean;
offsetX: number;
offsetY: number;
constructor();
textAlpha: number;
private _textAlpha;
textAlign: TEXT_ALIGN;
private _textAlign;
verticalAlign: VERTICAL_ALIGN;
private _verticalAlign;
width: number;
height: number;
lineSpacing: number;
private _lineSpacing;
lineType: TEXT_lINETYPE;
private _lineType;
text: string;
private _text;
font: string;
private _font;
size: number;
private _size;
fillColor: any;
private _fillColor;
strokeColor: string;
private _strokeColor;
stroke: number;
private _stroke;
italic: boolean;
private _italic;
bold: boolean;
_bold: boolean;
border: boolean;
private _border;
private _prepContext;
getTextWidth(lineIndex?: number): number;
readonly lines: number;
private _getMeasuredWidth;
private realLines;
updateText(): void;
updateTexture(): void;
_renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void;
destroy(): void;
}
export { TextField } from "./TextField";
export { InputText } from "./InputText";
export { EditableText } from "./EditableText";
import BaseTexture from './BaseTexture';
export default class BaseRenderTexture extends BaseTexture {
_glRenderTargets: {};
_canvasRenderTarget: any;
valid: boolean;
constructor(width?: number, height?: number, scaleMode?: number);
resize(width: number, height: number): void;
destroy(): void;
}
import { EventDispatcher } from '../events/EventDispatcher';
export default class BaseTexture extends EventDispatcher {
touched: number;
width: number;
height: number;
scaleMode: number;
hasLoaded: boolean;
isLoading: boolean;
source: HTMLImageElement | HTMLCanvasElement;
imageType: string;
premultipliedAlpha: boolean;
imageUrl: string;
isPowerOfTwo: boolean;
mipmap: boolean;
wrapMode: number;
_glTextures: {};
_enabled: number;
_destroyed: boolean;
textureCacheIds: string[];
constructor(source?: HTMLImageElement | HTMLCanvasElement, scaleMode?: number);
update(): void;
loadSource(source: any): void;
private _updateImageType;
private _sourceLoaded;
destroy(): void;
dispose(): void;
updateSourceImage(newSrc: string): void;
static fromImage(imageUrl: string, crossorigin?: any, scaleMode?: number): BaseTexture;
static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): BaseTexture;
static from(source: any, scaleMode?: number): BaseTexture;
static addToCache(baseTexture: BaseTexture, id: string): void;
static removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null;
}
import BaseRenderTexture from './BaseRenderTexture';
import Texture from './Texture';
import { Rectangle } from '../math';
export default class RenderTexture extends Texture {
constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle);
resize(width: number, height: number, doNotResizeBaseTexture?: boolean): void;
static create(width: number, height: number, scaleMode?: number): RenderTexture;
}
import BaseTexture from './BaseTexture';
import TextureUvs from './TextureUvs';
import { EventDispatcher } from '../events/EventDispatcher';
import { Event } from "../events/Event";
import { Point, Rectangle } from '../math';
export default class Texture extends EventDispatcher {
noFrame: boolean;
baseTexture: BaseTexture;
_frame: Rectangle;
trim: Rectangle;
valid: boolean;
_uvs: TextureUvs;
orig: Rectangle;
_rotate: number;
defaultAnchor: Point;
_updateID: number;
transform: any;
textureCacheIds: string[];
static EMPTY: Texture;
static WHITE: Texture;
constructor(baseTexture: BaseTexture | Texture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number, anchor?: Point);
update(): void;
onBaseTextureLoaded(e: Event): void;
onBaseTextureUpdated(e: Event): void;
destroy(): void;
clone(): Texture;
_updateUvs(): void;
frame: Rectangle;
rotate: number;
readonly width: number;
readonly height: number;
static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number): Texture;
static fromFrame(frameId: string): Texture;
static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number, origin?: string): Texture;
static from(source: any): Texture;
static addToCache(texture: Texture, id: string): void;
static removeFromCache(texture: any): Texture;
}
import BaseTexture from './BaseTexture';
export default class TextureSheet {
baseTexture: BaseTexture;
textures: {};
animations: {};
data: any;
_frames: any;
_frameKeys: string[];
_callback: Function;
constructor(baseTexture: BaseTexture, data: any);
parse(callback: Function): void;
_processFrames(initialFrameIndex: number): void;
_processAnimations(): void;
_parseComplete(): void;
destroy(destroyBase?: boolean): void;
}
import { Rectangle } from "../math";
import BaseTexture from "./BaseTexture";
export default class TextureUvs {
x0: number;
y0: number;
x1: number;
y1: number;
x2: number;
y2: number;
x3: number;
y3: number;
uvsUint32: Uint32Array;
uvsFloat32: Float32Array;
constructor();
set(frame: Rectangle, baseFrame: Rectangle | BaseTexture, rotate: number): void;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment