Commit 58a746b7 authored by Master Q's avatar Master Q

游戏流程

parent bfbf8b85
declare namespace FYGE{export const VERSION = "2.0.28"; declare namespace FYGE{export const VERSION = "2.0.28";
export const osType: "ios" | "android" | "pc"; export const osType: "ios" | "android" | "pc";
export function cos(angle: number): number; export function cos(angle: number): number;
export function sin(angle: number): number; export function sin(angle: number): number;
export const PI_2: number; export const PI_2: number;
export const RAD_TO_DEG: number; export const RAD_TO_DEG: number;
export const DEG_TO_RAD: number; export const DEG_TO_RAD: number;
export enum RENDERER_TYPE { export enum RENDERER_TYPE {
UNKNOWN = 0, UNKNOWN = 0,
WEBGL = 1, WEBGL = 1,
CANVAS = 2 CANVAS = 2
} }
export enum SHAPES { export enum SHAPES {
POLY = 0, POLY = 0,
RECT = 1, RECT = 1,
CIRC = 2, CIRC = 2,
ELIP = 3, ELIP = 3,
RREC = 4 RREC = 4
} }
export enum PRECISION { export enum PRECISION {
LOW = "lowp", LOW = "lowp",
MEDIUM = "mediump", MEDIUM = "mediump",
HIGH = "highp" HIGH = "highp"
} }
export enum TEXT_GRADIENT { export enum TEXT_GRADIENT {
LINEAR_VERTICAL = 0, LINEAR_VERTICAL = 0,
LINEAR_HORIZONTAL = 1 LINEAR_HORIZONTAL = 1
} }
export enum TEXT_ALIGN { export enum TEXT_ALIGN {
CENTER = "center", CENTER = "center",
LEFT = "left", LEFT = "left",
RIGHT = "right" RIGHT = "right"
} }
export enum VERTICAL_ALIGN { export enum VERTICAL_ALIGN {
MIDDLE = "middle", MIDDLE = "middle",
UP = "up", UP = "up",
DOWN = "down" DOWN = "down"
} }
export enum TEXT_lINETYPE { export enum TEXT_lINETYPE {
SINGLE = "single", SINGLE = "single",
MULTI = "multi" MULTI = "multi"
} }
export enum LINE_ALIGNMENT { export enum LINE_ALIGNMENT {
middle = 0.5, middle = 0.5,
outter = 1, outter = 1,
inner = 0 inner = 0
} }
export enum LINE_CAP { export enum LINE_CAP {
BUTT = "butt", BUTT = "butt",
ROUND = "round", ROUND = "round",
SQUARE = "square" SQUARE = "square"
} }
export enum LINE_JOIN { export enum LINE_JOIN {
MITER = "miter", MITER = "miter",
ROUND = "round", ROUND = "round",
BEVEL = "bevel" BEVEL = "bevel"
} }
export enum BLEND_MODES { export enum BLEND_MODES {
NORMAL = 0, NORMAL = 0,
ADD = 1, ADD = 1,
...@@ -104,8 +104,8 @@ export enum BLEND_MODES { ...@@ -104,8 +104,8 @@ export enum BLEND_MODES {
DST_ATOP = 28, DST_ATOP = 28,
ERASE = 29, ERASE = 29,
SUBTRACT = 30 SUBTRACT = 30
} }
export enum DRAW_MODES { export enum DRAW_MODES {
POINTS = 0, POINTS = 0,
LINES = 1, LINES = 1,
...@@ -114,24 +114,24 @@ export enum DRAW_MODES { ...@@ -114,24 +114,24 @@ export enum DRAW_MODES {
TRIANGLES = 4, TRIANGLES = 4,
TRIANGLE_STRIP = 5, TRIANGLE_STRIP = 5,
TRIANGLE_FAN = 6 TRIANGLE_FAN = 6
} }
export enum SCALE_MODES { export enum SCALE_MODES {
LINEAR = 0, LINEAR = 0,
NEAREST = 1 NEAREST = 1
} }
export enum WRAP_MODES { export enum WRAP_MODES {
CLAMP = 33071, CLAMP = 33071,
REPEAT = 10497, REPEAT = 10497,
MIRRORED_REPEAT = 33648 MIRRORED_REPEAT = 33648
} }
export enum GC_MODES { export enum GC_MODES {
AUTO = 0, AUTO = 0,
MANUAL = 1 MANUAL = 1
} }
export abstract class HashObject { export abstract class HashObject {
protected _instanceId: number; protected _instanceId: number;
protected _instanceType: string; protected _instanceType: string;
...@@ -166,8 +166,8 @@ export abstract class HashObject { ...@@ -166,8 +166,8 @@ export abstract class HashObject {
* @return {void} * @return {void}
*/ */
abstract destroy(): void; abstract destroy(): void;
} }
export class Event extends HashObject { export class Event extends HashObject {
/** /**
* 舞台尺寸发生变化时触发 * 舞台尺寸发生变化时触发
...@@ -380,8 +380,8 @@ export class Event extends HashObject { ...@@ -380,8 +380,8 @@ export class Event extends HashObject {
* @public * @public
*/ */
reset(type: string, target: any): void; reset(type: string, target: any): void;
} }
export class EventDispatcher extends HashObject { export class EventDispatcher extends HashObject {
/** /**
* 捕获阶段事件名 * 捕获阶段事件名
...@@ -499,8 +499,8 @@ export class EventDispatcher extends HashObject { ...@@ -499,8 +499,8 @@ export class EventDispatcher extends HashObject {
*/ */
removeAllEventListener(): void; removeAllEventListener(): void;
destroy(): void; destroy(): void;
} }
export class Point extends HashObject { export class Point extends HashObject {
destroy(): void; destroy(): void;
/** /**
...@@ -537,8 +537,8 @@ export class Point extends HashObject { ...@@ -537,8 +537,8 @@ export class Point extends HashObject {
*/ */
static distance(...args: any[]): number; static distance(...args: any[]): number;
set(x: number, y: number): void; set(x: number, y: number): void;
} }
export class ObservablePoint extends HashObject { export class ObservablePoint extends HashObject {
_x: number; _x: number;
_y: number; _y: number;
...@@ -568,8 +568,8 @@ export class ObservablePoint extends HashObject { ...@@ -568,8 +568,8 @@ export class ObservablePoint extends HashObject {
get y(): number; get y(): number;
set y(value: number); set y(value: number);
destroy(): void; destroy(): void;
} }
export class Transform extends HashObject { export class Transform extends HashObject {
/** /**
* 世界矩阵 * 世界矩阵
...@@ -648,8 +648,8 @@ export class Transform extends HashObject { ...@@ -648,8 +648,8 @@ export class Transform extends HashObject {
get rotation(): number; get rotation(): number;
set rotation(value: number); set rotation(value: number);
destroy(): void; destroy(): void;
} }
export class Matrix extends HashObject { export class Matrix extends HashObject {
/** /**
* @property a * @property a
...@@ -868,8 +868,8 @@ export class Matrix extends HashObject { ...@@ -868,8 +868,8 @@ export class Matrix extends HashObject {
*/ */
static get TEMP_MATRIX(): Matrix; static get TEMP_MATRIX(): Matrix;
destroy(): void; destroy(): void;
} }
export class Rectangle extends HashObject { export class Rectangle extends HashObject {
/** /**
* 类型 * 类型
...@@ -1013,8 +1013,8 @@ export class Rectangle extends HashObject { ...@@ -1013,8 +1013,8 @@ export class Rectangle extends HashObject {
*/ */
static testRectCross(ra: Rectangle, rb: Rectangle): boolean; static testRectCross(ra: Rectangle, rb: Rectangle): boolean;
destroy(): void; destroy(): void;
} }
export const GroupD8: { export const GroupD8: {
E: number; E: number;
SE: number; SE: number;
...@@ -1068,8 +1068,8 @@ export const GroupD8: { ...@@ -1068,8 +1068,8 @@ export const GroupD8: {
* @param {number} ty - sprite anchoring * @param {number} ty - sprite anchoring
*/ */
matrixAppendRotationInv: (matrix: any, rotation: any, tx?: number, ty?: number) => void; matrixAppendRotationInv: (matrix: any, rotation: any, tx?: number, ty?: number) => void;
} }
export class Circle { export class Circle {
/** /**
* @member {number} * @member {number}
...@@ -1117,8 +1117,8 @@ export class Circle { ...@@ -1117,8 +1117,8 @@ export class Circle {
* @return {Rectangle} the framing rectangle * @return {Rectangle} the framing rectangle
*/ */
getBounds(): Rectangle; getBounds(): Rectangle;
} }
export class Ellipse { export class Ellipse {
/** /**
* @member {number} * @member {number}
...@@ -1175,8 +1175,8 @@ export class Ellipse { ...@@ -1175,8 +1175,8 @@ export class Ellipse {
* @return {Rectangle} the framing rectangle * @return {Rectangle} the framing rectangle
*/ */
getBounds(): Rectangle; getBounds(): Rectangle;
} }
export class Polygon { export class Polygon {
/** /**
* 是否闭合 * 是否闭合
...@@ -1227,8 +1227,8 @@ export class Polygon { ...@@ -1227,8 +1227,8 @@ export class Polygon {
* @return {boolean} Whether the x/y coordinates are within this polygon * @return {boolean} Whether the x/y coordinates are within this polygon
*/ */
isPointIn(point: Point): boolean; isPointIn(point: Point): boolean;
} }
export class RoundedRectangle { export class RoundedRectangle {
x: number; x: number;
y: number; y: number;
...@@ -1261,70 +1261,70 @@ export class RoundedRectangle { ...@@ -1261,70 +1261,70 @@ export class RoundedRectangle {
* @return {boolean} Whether the x/y coords are within this ellipse * @return {boolean} Whether the x/y coords are within this ellipse
*/ */
isPointIn(point: Point): boolean; isPointIn(point: Point): boolean;
} }
export function getEnv(): "tb" | "web"; export function getEnv(): "tb" | "web";
export function setEnv(e: "tb" | "web"): void; export function setEnv(e: "tb" | "web"): void;
export function createCanvas(): HTMLCanvasElement; export function createCanvas(): HTMLCanvasElement;
export function initedByTbCanvas(canvas: any): void; export function initedByTbCanvas(canvas: any): void;
export function initedByCanvas(canvas: any): void; export function initedByCanvas(canvas: any): void;
export function destroyTbCanvas(): void; export function destroyTbCanvas(): void;
export function destroyCanvasContent(): void; export function destroyCanvasContent(): void;
export function createImage(): HTMLImageElement; export function createImage(): HTMLImageElement;
export function requestAnimationFrame(callback: any): any; export function requestAnimationFrame(callback: any): any;
export function cancelAnimationFrame(id: number): void; export function cancelAnimationFrame(id: number): void;
export function getRequestAnimationFrame(): void; export function getRequestAnimationFrame(): void;
export const INT_BITS1 = 32; export const INT_BITS1 = 32;
export const INT_MAX = 2147483647; export const INT_MAX = 2147483647;
export const INT_MIN: number; export const INT_MIN: number;
export function abs(v: any): number; export function abs(v: any): number;
export function min(x: any, y: any): number; export function min(x: any, y: any): number;
export function max(x: any, y: any): number; export function max(x: any, y: any): number;
export function isPow2(v: any): boolean; export function isPow2(v: any): boolean;
export function log2(v: any): number; export function log2(v: any): number;
export function log10(v: any): 1 | 0 | 2 | 4 | 3 | 9 | 5 | 6 | 7 | 8; export function log10(v: any): 1 | 0 | 2 | 4 | 3 | 9 | 5 | 6 | 7 | 8;
export function popCount(v: any): number; export function popCount(v: any): number;
export function countTrailingZeros(v: any): number; export function countTrailingZeros(v: any): number;
export function nextPow2(v: any): any; export function nextPow2(v: any): any;
export function prevPow2(v: any): number; export function prevPow2(v: any): number;
export function parity(v: any): number; export function parity(v: any): number;
export function reverse(v: any): number; export function reverse(v: any): number;
export function interleave2(x: any, y: any): number; export function interleave2(x: any, y: any): number;
export function deinterleave2(v: any, n: any): number; export function deinterleave2(v: any, n: any): number;
export function interleave3(x: any, y: any, z: any): number; export function interleave3(x: any, y: any, z: any): number;
export function deinterleave3(v: any, n: any): number; export function deinterleave3(v: any, n: any): number;
export function nextCombination(v: any): number; export function nextCombination(v: any): number;
export class CanvasGraphicsRenderer { export class CanvasGraphicsRenderer {
renderer: CanvasRenderer; renderer: CanvasRenderer;
/** /**
...@@ -1342,12 +1342,12 @@ export class CanvasGraphicsRenderer { ...@@ -1342,12 +1342,12 @@ export class CanvasGraphicsRenderer {
* *
*/ */
destroy(): void; destroy(): void;
} }
export function holePath(graphicsData: GraphicsData, context: CanvasRenderingContext2D, ccw?: boolean): void; export function holePath(graphicsData: GraphicsData, context: CanvasRenderingContext2D, ccw?: boolean): void;
export function judgeCcw(points: number[]): boolean; export function judgeCcw(points: number[]): boolean;
export class CanvasMaskManager extends HashObject { export class CanvasMaskManager extends HashObject {
renderer: any; renderer: any;
/** /**
...@@ -1377,8 +1377,8 @@ export class CanvasMaskManager extends HashObject { ...@@ -1377,8 +1377,8 @@ export class CanvasMaskManager extends HashObject {
* *
*/ */
destroy(): void; destroy(): void;
} }
export class BatchDrawCall { export class BatchDrawCall {
/** /**
* 存储基础图片 * 存储基础图片
...@@ -1405,8 +1405,8 @@ export class BatchDrawCall { ...@@ -1405,8 +1405,8 @@ export class BatchDrawCall {
*/ */
type: number; type: number;
constructor(); constructor();
} }
export class ObjectRenderer { export class ObjectRenderer {
/** /**
* The renderer this manager works for. * The renderer this manager works for.
...@@ -1445,12 +1445,12 @@ export class ObjectRenderer { ...@@ -1445,12 +1445,12 @@ export class ObjectRenderer {
* Generic destroy methods to be overridden by the subclass * Generic destroy methods to be overridden by the subclass
*/ */
destroy(): void; destroy(): void;
} }
export function createContext(canvas: HTMLCanvasElement, options?: any): WebGLRenderingContext; export function createContext(canvas: HTMLCanvasElement, options?: any): WebGLRenderingContext;
export function checkMaxIfStatementsInShader(maxIfs: number, gl: WebGLRenderingContext): number; export function checkMaxIfStatementsInShader(maxIfs: number, gl: WebGLRenderingContext): number;
export class BatchBuffer { export class BatchBuffer {
/** /**
* 顶点数据,类型化数组 * 顶点数据,类型化数组
...@@ -1482,8 +1482,8 @@ export class BatchBuffer { ...@@ -1482,8 +1482,8 @@ export class BatchBuffer {
* *
*/ */
destroy(): void; destroy(): void;
} }
export class GLTexture { export class GLTexture {
/** /**
* 当前上下文 * 当前上下文
...@@ -1604,8 +1604,8 @@ export class GLTexture { ...@@ -1604,8 +1604,8 @@ export class GLTexture {
* @param height {number} the new height of the texture * @param height {number} the new height of the texture
*/ */
static fromData(gl: any, data: any, width: any, height: any): GLTexture; static fromData(gl: any, data: any, width: any, height: any): GLTexture;
} }
export class GLBuffer { export class GLBuffer {
/** /**
* 当前上下文 * 当前上下文
...@@ -1679,10 +1679,10 @@ export class GLBuffer { ...@@ -1679,10 +1679,10 @@ export class GLBuffer {
*/ */
static createIndexBuffer(gl: any, data?: any, drawType?: any): GLBuffer; static createIndexBuffer(gl: any, data?: any, drawType?: any): GLBuffer;
static create(gl: any, type: any, data: any, drawType: any): GLBuffer; static create(gl: any, type: any, data: any, drawType: any): GLBuffer;
} }
export function setVertexAttribArrays(gl: any, attribs: any, state?: any): void; export function setVertexAttribArrays(gl: any, attribs: any, state?: any): void;
export class VertexArrayObject { export class VertexArrayObject {
nativeVaoExtension: any; nativeVaoExtension: any;
nativeState: any; nativeState: any;
...@@ -1772,8 +1772,8 @@ export class VertexArrayObject { ...@@ -1772,8 +1772,8 @@ export class VertexArrayObject {
* @property {Boolean} FORCE_NATIVE * @property {Boolean} FORCE_NATIVE
*/ */
static FORCE_NATIVE: boolean; static FORCE_NATIVE: boolean;
} }
export class GLFramebuffer { export class GLFramebuffer {
/** /**
* 当前渲染上下文 * 当前渲染上下文
...@@ -1844,26 +1844,26 @@ export class GLFramebuffer { ...@@ -1844,26 +1844,26 @@ export class GLFramebuffer {
* @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data
*/ */
static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: any): GLFramebuffer; static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: any): GLFramebuffer;
} }
export function compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string, attributeLocations?: any): WebGLProgram; export function compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string, attributeLocations?: any): WebGLProgram;
export function mapType(gl: any, type: any): any; export function mapType(gl: any, type: any): any;
export function mapSize(type: string): number; export function mapSize(type: string): number;
export function extractAttributes(gl: WebGLRenderingContext, program: WebGLProgram): {}; export function extractAttributes(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function defaultValue(type: string, size: number): false | any[] | Int32Array | 0; export function defaultValue(type: string, size: number): false | any[] | Int32Array | 0;
export function extractUniforms(gl: WebGLRenderingContext, program: WebGLProgram): {}; export function extractUniforms(gl: WebGLRenderingContext, program: WebGLProgram): {};
export function setPrecision(src: string, precision: string): string; export function setPrecision(src: string, precision: string): string;
export function generateUniformAccessObject(gl: WebGLRenderingContext, uniformData: any): { export function generateUniformAccessObject(gl: WebGLRenderingContext, uniformData: any): {
data: {}; data: {};
} }
export class GLShader { export class GLShader {
/** /**
* The current WebGL rendering context * The current WebGL rendering context
...@@ -1908,12 +1908,12 @@ export class GLShader { ...@@ -1908,12 +1908,12 @@ export class GLShader {
* TODO * TODO
*/ */
destroy(): void; destroy(): void;
} }
export function generateMultiTextureShader(gl: any, maxTextures: any): GLShader; export function generateMultiTextureShader(gl: any, maxTextures: any): GLShader;
export const premultiplyBlendMode: any[]; export const premultiplyBlendMode: any[];
export class BatchRenderer extends ObjectRenderer { export class BatchRenderer extends ObjectRenderer {
vertSize: number; vertSize: number;
vertByteSize: number; vertByteSize: number;
...@@ -2010,10 +2010,10 @@ export class BatchRenderer extends ObjectRenderer { ...@@ -2010,10 +2010,10 @@ export class BatchRenderer extends ObjectRenderer {
* *
*/ */
destroy(): void; destroy(): void;
} }
export {}; export {};
export class SystemRenderer extends EventDispatcher { export class SystemRenderer extends EventDispatcher {
/** /**
* 渲染类型 * 渲染类型
...@@ -2075,8 +2075,8 @@ export class SystemRenderer extends EventDispatcher { ...@@ -2075,8 +2075,8 @@ export class SystemRenderer extends EventDispatcher {
* 背景色,十六进制颜色 * 背景色,十六进制颜色
*/ */
set backgroundColor(value: number); set backgroundColor(value: number);
} }
export class RenderTarget { export class RenderTarget {
/** /**
* The current WebGL drawing context. * The current WebGL drawing context.
...@@ -2195,8 +2195,8 @@ export class RenderTarget { ...@@ -2195,8 +2195,8 @@ export class RenderTarget {
* 销毁方法 * 销毁方法
*/ */
destroy(): void; destroy(): void;
} }
export class TextureManager { export class TextureManager {
boundTextures: any; boundTextures: any;
renderer: WebglRenderer; renderer: WebglRenderer;
...@@ -2259,8 +2259,8 @@ export class TextureManager { ...@@ -2259,8 +2259,8 @@ export class TextureManager {
* Destroys this manager and removes all its textures * Destroys this manager and removes all its textures
*/ */
destroy(): void; destroy(): void;
} }
export class TextureGarbageCollector { export class TextureGarbageCollector {
renderer: WebglRenderer; renderer: WebglRenderer;
count: number; count: number;
...@@ -2288,10 +2288,10 @@ export class TextureGarbageCollector { ...@@ -2288,10 +2288,10 @@ export class TextureGarbageCollector {
* @param {DisplayObject} displayObject - the displayObject to remove the textures from. * @param {DisplayObject} displayObject - the displayObject to remove the textures from.
*/ */
unload(displayObject: any): void; unload(displayObject: any): void;
} }
export function mapWebGLBlendModes(gl: WebGLRenderingContext, array?: any[]): any[]; export function mapWebGLBlendModes(gl: WebGLRenderingContext, array?: any[]): any[];
export class WebGLState { export class WebGLState {
blendModes: any; blendModes: any;
/** /**
...@@ -2368,8 +2368,8 @@ export class WebGLState { ...@@ -2368,8 +2368,8 @@ export class WebGLState {
* *
*/ */
resetTo3D(): void; resetTo3D(): void;
} }
export class BatchManager { export class BatchManager {
/** /**
* *
...@@ -2400,8 +2400,8 @@ export class BatchManager { ...@@ -2400,8 +2400,8 @@ export class BatchManager {
* Reset the system to an empty renderer * Reset the system to an empty renderer
*/ */
reset(): void; reset(): void;
} }
export class Filter { export class Filter {
vertexSrc: string; vertexSrc: string;
fragmentSrc: string; fragmentSrc: string;
...@@ -2482,16 +2482,16 @@ export class Filter { ...@@ -2482,16 +2482,16 @@ export class Filter {
* @constant * @constant
*/ */
private static get defaultFragmentSrc(); private static get defaultFragmentSrc();
} }
export class FXAAFilter extends Filter { export class FXAAFilter extends Filter {
constructor(); constructor();
} }
export const defaultVert: string; export const defaultVert: string;
export const defaultFilterMatrix: string; export const defaultFilterMatrix: string;
export class NoiseFilter extends Filter { export class NoiseFilter extends Filter {
/** /**
* @param {number} noise - The noise intensity, should be a normalized value in the range [0, 1]. * @param {number} noise - The noise intensity, should be a normalized value in the range [0, 1].
...@@ -2513,8 +2513,8 @@ export class NoiseFilter extends Filter { ...@@ -2513,8 +2513,8 @@ export class NoiseFilter extends Filter {
*/ */
get seed(): any; get seed(): any;
set seed(value: any); set seed(value: any);
} }
export class DisplacementFilter extends Filter { export class DisplacementFilter extends Filter {
maskSprite: Sprite; maskSprite: Sprite;
maskMatrix: Matrix; maskMatrix: Matrix;
...@@ -2539,8 +2539,8 @@ export class DisplacementFilter extends Filter { ...@@ -2539,8 +2539,8 @@ export class DisplacementFilter extends Filter {
*/ */
get map(): any; get map(): any;
set map(value: any); set map(value: any);
} }
export class BlurXFilter extends Filter { export class BlurXFilter extends Filter {
strength: number; strength: number;
/** /**
...@@ -2579,10 +2579,10 @@ export class BlurXFilter extends Filter { ...@@ -2579,10 +2579,10 @@ export class BlurXFilter extends Filter {
* @param {boolean} clear - Should the output be cleared before rendering? * @param {boolean} clear - Should the output be cleared before rendering?
*/ */
apply(filterManager: any, input: any, output: any, clear: any): void; apply(filterManager: any, input: any, output: any, clear: any): void;
} }
export function createIndicesForQuads(size: number): Uint16Array; export function createIndicesForQuads(size: number): Uint16Array;
export class Quad { export class Quad {
/** /**
* 当前gl上下文 * 当前gl上下文
...@@ -2629,14 +2629,14 @@ export class Quad { ...@@ -2629,14 +2629,14 @@ export class Quad {
*/ */
upload(): Quad; upload(): Quad;
destroy(): void; destroy(): void;
} }
export function calculateScreenSpaceMatrix(outputMatrix: any, filterArea: any, textureSize: any): any; export function calculateScreenSpaceMatrix(outputMatrix: any, filterArea: any, textureSize: any): any;
export function calculateNormalizedScreenSpaceMatrix(outputMatrix: any, filterArea: any, textureSize: any): any; export function calculateNormalizedScreenSpaceMatrix(outputMatrix: any, filterArea: any, textureSize: any): any;
export function calculateSpriteMatrix(outputMatrix: any, filterArea: any, textureSize: any, sprite: Sprite): Matrix; export function calculateSpriteMatrix(outputMatrix: any, filterArea: any, textureSize: any, sprite: Sprite): Matrix;
export class FilterManager { export class FilterManager {
gl: WebGLRenderingContext; gl: WebGLRenderingContext;
renderer: WebglRenderer; renderer: WebglRenderer;
...@@ -2755,8 +2755,8 @@ export class FilterManager { ...@@ -2755,8 +2755,8 @@ export class FilterManager {
* *
*/ */
onPreRender(): void; onPreRender(): void;
} }
export class BlurYFilter extends Filter { export class BlurYFilter extends Filter {
strength: number; strength: number;
/** /**
...@@ -2795,8 +2795,8 @@ export class BlurYFilter extends Filter { ...@@ -2795,8 +2795,8 @@ export class BlurYFilter extends Filter {
* @param {boolean} clear - Should the output be cleared before rendering? * @param {boolean} clear - Should the output be cleared before rendering?
*/ */
apply(filterManager: FilterManager, input: any, output: any, clear: any): void; apply(filterManager: FilterManager, input: any, output: any, clear: any): void;
} }
export class BlurFilter extends Filter { export class BlurFilter extends Filter {
private blurXFilter; private blurXFilter;
private blurYFilter; private blurYFilter;
...@@ -2855,8 +2855,8 @@ export class BlurFilter extends Filter { ...@@ -2855,8 +2855,8 @@ export class BlurFilter extends Filter {
*/ */
get blendMode(): BLEND_MODES; get blendMode(): BLEND_MODES;
set blendMode(value: BLEND_MODES); set blendMode(value: BLEND_MODES);
} }
export class ColorMatrixFilter extends Filter { export class ColorMatrixFilter extends Filter {
grayscale: (scale: any, multiply: any) => void; grayscale: (scale: any, multiply: any) => void;
/** /**
...@@ -3065,8 +3065,8 @@ export class ColorMatrixFilter extends Filter { ...@@ -3065,8 +3065,8 @@ export class ColorMatrixFilter extends Filter {
*/ */
get alpha(): any; get alpha(): any;
set alpha(value: any); set alpha(value: any);
} }
export class AlphaFilter extends Filter { export class AlphaFilter extends Filter {
/** /**
* @param {number} [alpha=1] Amount of alpha from 0 to 1, where 0 is transparent * @param {number} [alpha=1] Amount of alpha from 0 to 1, where 0 is transparent
...@@ -3080,8 +3080,8 @@ export class AlphaFilter extends Filter { ...@@ -3080,8 +3080,8 @@ export class AlphaFilter extends Filter {
*/ */
get alpha(): number; get alpha(): number;
set alpha(value: number); set alpha(value: number);
} }
export class TextureMatrix { export class TextureMatrix {
_texture: Texture; _texture: Texture;
mapCoord: Matrix; mapCoord: Matrix;
...@@ -3132,8 +3132,8 @@ export class TextureMatrix { ...@@ -3132,8 +3132,8 @@ export class TextureMatrix {
* @returns {boolean} whether or not it was updated * @returns {boolean} whether or not it was updated
*/ */
update(forceUpdate?: boolean): boolean; update(forceUpdate?: boolean): boolean;
} }
export class SpriteMaskFilter extends Filter { export class SpriteMaskFilter extends Filter {
maskSprite: Sprite; maskSprite: Sprite;
maskMatrix: Matrix; maskMatrix: Matrix;
...@@ -3149,8 +3149,8 @@ export class SpriteMaskFilter extends Filter { ...@@ -3149,8 +3149,8 @@ export class SpriteMaskFilter extends Filter {
* @param {RenderTarget} output - The target to output to. * @param {RenderTarget} output - The target to output to.
*/ */
apply(filterManager: FilterManager, input: any, output: any): void; apply(filterManager: FilterManager, input: any, output: any): void;
} }
export class BlurFilterNew extends Filter { export class BlurFilterNew extends Filter {
private _blur; private _blur;
get blur(): number; get blur(): number;
...@@ -3163,8 +3163,8 @@ export class BlurFilterNew extends Filter { ...@@ -3163,8 +3163,8 @@ export class BlurFilterNew extends Filter {
* @param blur 模糊系数 0到1 * @param blur 模糊系数 0到1
*/ */
constructor(blur?: number); constructor(blur?: number);
} }
export class ExtractBrightnessFilter extends Filter { export class ExtractBrightnessFilter extends Filter {
constructor(threshold?: number); constructor(threshold?: number);
/** /**
...@@ -3175,8 +3175,8 @@ export class ExtractBrightnessFilter extends Filter { ...@@ -3175,8 +3175,8 @@ export class ExtractBrightnessFilter extends Filter {
*/ */
get threshold(): any; get threshold(): any;
set threshold(value: any); set threshold(value: any);
} }
export class KawaseBlurFilter extends Filter { export class KawaseBlurFilter extends Filter {
private _pixelSize; private _pixelSize;
private _clamp; private _clamp;
...@@ -3234,8 +3234,8 @@ export class KawaseBlurFilter extends Filter { ...@@ -3234,8 +3234,8 @@ export class KawaseBlurFilter extends Filter {
*/ */
get blur(): number; get blur(): number;
set blur(value: number); set blur(value: number);
} }
export class AdvancedBloomFilter extends Filter { export class AdvancedBloomFilter extends Filter {
private _extractFilter; private _extractFilter;
private _blurFilter; private _blurFilter;
...@@ -3295,10 +3295,10 @@ export class AdvancedBloomFilter extends Filter { ...@@ -3295,10 +3295,10 @@ export class AdvancedBloomFilter extends Filter {
*/ */
get pixelSize(): any; get pixelSize(): any;
set pixelSize(value: any); set pixelSize(value: any);
} }
export {}; export {};
export class MaskManager { export class MaskManager {
renderer: WebglRenderer; renderer: WebglRenderer;
scissor: boolean; scissor: boolean;
...@@ -3360,8 +3360,8 @@ export class MaskManager { ...@@ -3360,8 +3360,8 @@ export class MaskManager {
*/ */
private popScissorMask; private popScissorMask;
destroy(): void; destroy(): void;
} }
export class StencilManager { export class StencilManager {
renderer: WebglRenderer; renderer: WebglRenderer;
stencilMaskStack: Graphics[]; stencilMaskStack: Graphics[];
...@@ -3400,8 +3400,8 @@ export class StencilManager { ...@@ -3400,8 +3400,8 @@ export class StencilManager {
* *
*/ */
destroy(): void; destroy(): void;
} }
export class BaseRenderTexture extends BaseTexture { export class BaseRenderTexture extends BaseTexture {
/** /**
* webgl帧缓存列表,键值为渲染器的id * webgl帧缓存列表,键值为渲染器的id
...@@ -3436,8 +3436,8 @@ export class BaseRenderTexture extends BaseTexture { ...@@ -3436,8 +3436,8 @@ export class BaseRenderTexture extends BaseTexture {
* 销毁 * 销毁
*/ */
destroy(): void; destroy(): void;
} }
export class RenderTexture extends Texture { export class RenderTexture extends Texture {
/** /**
* 它的基础纹理变成了BaseRenderTexture * 它的基础纹理变成了BaseRenderTexture
...@@ -3463,8 +3463,8 @@ export class RenderTexture extends Texture { ...@@ -3463,8 +3463,8 @@ export class RenderTexture extends Texture {
* @return {RenderTexture} * @return {RenderTexture}
*/ */
static create(width: number, height: number, scaleMode?: number): RenderTexture; static create(width: number, height: number, scaleMode?: number): RenderTexture;
} }
export class WebglRenderer extends SystemRenderer { export class WebglRenderer extends SystemRenderer {
/** /**
* 所有插件列表,目前只有batch * 所有插件列表,目前只有batch
...@@ -3643,8 +3643,8 @@ export class WebglRenderer extends SystemRenderer { ...@@ -3643,8 +3643,8 @@ export class WebglRenderer extends SystemRenderer {
* @param {Function} ctor - 插件类 * @param {Function} ctor - 插件类
*/ */
static registerPlugin(pluginName: any, ctor: any): void; static registerPlugin(pluginName: any, ctor: any): void;
} }
export class Sprite extends Container { export class Sprite extends Container {
/** /**
* 混色模式 * 混色模式
...@@ -3837,12 +3837,12 @@ export class Sprite extends Container { ...@@ -3837,12 +3837,12 @@ export class Sprite extends Container {
* @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
*/ */
static fromFrame(frameId: string): Sprite; static fromFrame(frameId: string): Sprite;
} }
export function canUseNewCanvasBlendModes(): boolean; export function canUseNewCanvasBlendModes(): boolean;
export function getTintedTexture(texture: Texture, color: number): HTMLCanvasElement; export function getTintedTexture(texture: Texture, color: number): HTMLCanvasElement;
export class CanvasSpriteRenderer { export class CanvasSpriteRenderer {
renderer: CanvasRenderer; renderer: CanvasRenderer;
/** /**
...@@ -3860,8 +3860,8 @@ export class CanvasSpriteRenderer { ...@@ -3860,8 +3860,8 @@ export class CanvasSpriteRenderer {
* *
*/ */
destroy(): void; destroy(): void;
} }
export class CanvasRenderTarget { export class CanvasRenderTarget {
/** /**
* The Canvas object that belongs to this CanvasRenderTarget. * The Canvas object that belongs to this CanvasRenderTarget.
...@@ -3908,8 +3908,8 @@ export class CanvasRenderTarget { ...@@ -3908,8 +3908,8 @@ export class CanvasRenderTarget {
*/ */
get height(): number; get height(): number;
set height(val: number); set height(val: number);
} }
export class Mesh extends Container { export class Mesh extends Container {
/** /**
* 混色模式 * 混色模式
...@@ -4052,12 +4052,12 @@ export class Mesh extends Container { ...@@ -4052,12 +4052,12 @@ export class Mesh extends Container {
* 销毁 * 销毁
*/ */
destroy(): void; destroy(): void;
} }
export function createTextureSheet(baseTexture: BaseTexture, altaData: any): { export function createTextureSheet(baseTexture: BaseTexture, altaData: any): {
[key: string]: Texture; [key: string]: Texture;
} }
export class Plane extends Mesh { export class Plane extends Mesh {
verticesX: number; verticesX: number;
verticesY: number; verticesY: number;
...@@ -4072,10 +4072,10 @@ export class Plane extends Mesh { ...@@ -4072,10 +4072,10 @@ export class Plane extends Mesh {
* *
*/ */
_refresh(): void; _refresh(): void;
} }
export function calculatePlaneIndices(verticesX: number, verticesY: number): Uint16Array; export function calculatePlaneIndices(verticesX: number, verticesY: number): Uint16Array;
export class NineSlicePlane extends Mesh { export class NineSlicePlane extends Mesh {
/** /**
* 原始宽度 * 原始宽度
...@@ -4188,8 +4188,8 @@ export class NineSlicePlane extends Mesh { ...@@ -4188,8 +4188,8 @@ export class NineSlicePlane extends Mesh {
* 刷新所有坐标 * 刷新所有坐标
*/ */
_refresh(): void; _refresh(): void;
} }
export class Rope extends Mesh { export class Rope extends Mesh {
/** /**
* 一组点 * 一组点
...@@ -4217,8 +4217,8 @@ export class Rope extends Mesh { ...@@ -4217,8 +4217,8 @@ export class Rope extends Mesh {
*/ */
refreshVertices(): void; refreshVertices(): void;
update(): void; update(): void;
} }
export class CanvasMeshRenderer { export class CanvasMeshRenderer {
renderer: CanvasRenderer; renderer: CanvasRenderer;
constructor(renderer: CanvasRenderer); constructor(renderer: CanvasRenderer);
...@@ -4226,10 +4226,10 @@ export class CanvasMeshRenderer { ...@@ -4226,10 +4226,10 @@ export class CanvasMeshRenderer {
private _renderTriangles; private _renderTriangles;
private _renderDrawTriangle; private _renderDrawTriangle;
destroy(): void; destroy(): void;
} }
export function mapCanvasBlendModes(array?: any[]): any[]; export function mapCanvasBlendModes(array?: any[]): any[];
export class CanvasRenderer extends SystemRenderer { export class CanvasRenderer extends SystemRenderer {
/** /**
* 主屏幕渲染上下文 * 主屏幕渲染上下文
...@@ -4282,40 +4282,40 @@ export class CanvasRenderer extends SystemRenderer { ...@@ -4282,40 +4282,40 @@ export class CanvasRenderer extends SystemRenderer {
*/ */
destroy(): void; destroy(): void;
destroyPlugins(): void; destroyPlugins(): void;
} }
export function uid(): number; export function uid(): number;
export function getBackupCanvasCtx(): CanvasRenderingContext2D; export function getBackupCanvasCtx(): CanvasRenderingContext2D;
export function getGradientColor(points: number[], colors: [number, string, number][]): any; export function getGradientColor(points: number[], colors: [number, string, number][]): any;
export function getCanvasBitmapStyle(image: any): any; export function getCanvasBitmapStyle(image: any): any;
export function hex2rgb(hex: number, out?: number[] | Float32Array): number[] | Float32Array; export function hex2rgb(hex: number, out?: number[] | Float32Array): number[] | Float32Array;
export function hex2string(hex: any): string; export function hex2string(hex: any): string;
export function string2hex(string: string): number; export function string2hex(string: string): number;
export function rgb2hex(rgb: number[]): number; export function rgb2hex(rgb: number[]): number;
export function getRGBA(color: string, alpha: number): string; export function getRGBA(color: string, alpha: number): string;
export function sign(n: number): number; export function sign(n: number): number;
export function premultiplyTint(tint: number, alpha: number): number; export function premultiplyTint(tint: number, alpha: number): number;
export const TextureCache: any; export const TextureCache: any;
export const BaseTextureCache: any; export const BaseTextureCache: any;
export const TextureSheetCache: any; export const TextureSheetCache: any;
export function destroyTextureCache(): void; export function destroyTextureCache(): void;
export function clearTextureCache(): void; export function clearTextureCache(): void;
export const GlobalPro: { export const GlobalPro: {
/** /**
* 舞台渲染类型, * 舞台渲染类型,
...@@ -4329,18 +4329,18 @@ export const GlobalPro: { ...@@ -4329,18 +4329,18 @@ export const GlobalPro: {
* 图集间隙 * 图集间隙
*/ */
padding: number; padding: number;
} }
export function isWebGLSupported(): boolean; export function isWebGLSupported(): boolean;
export function removeItems(arr: Array<any>, startIdx: number, removeCount: number): void; export function removeItems(arr: Array<any>, startIdx: number, removeCount: number): void;
export function clamp(value: number, min: number, max: number): number; export function clamp(value: number, min: number, max: number): number;
export function ArrayBufferToBase64(buff: ArrayBuffer): string; export function ArrayBufferToBase64(buff: ArrayBuffer): string;
export function decodeText(array: Uint8Array): string; export function decodeText(array: Uint8Array): string;
export class Loader extends EventDispatcher { export class Loader extends EventDispatcher {
/** /**
* 记录原始数据,json和image,贴图在建立时会被缓存 * 记录原始数据,json和image,贴图在建立时会被缓存
...@@ -4405,10 +4405,10 @@ export class Loader extends EventDispatcher { ...@@ -4405,10 +4405,10 @@ export class Loader extends EventDispatcher {
*/ */
private downloadReadFile; private downloadReadFile;
private cache; private cache;
} }
export const GlobalLoader: Loader; export const GlobalLoader: Loader;
export class BaseTexture extends EventDispatcher { export class BaseTexture extends EventDispatcher {
/** /**
* 贴图回收时用到, * 贴图回收时用到,
...@@ -4561,8 +4561,8 @@ export class BaseTexture extends EventDispatcher { ...@@ -4561,8 +4561,8 @@ export class BaseTexture extends EventDispatcher {
* @return {BaseTexture|null} 移除的BaseTexture或null * @return {BaseTexture|null} 移除的BaseTexture或null
*/ */
static removeFromCache(baseTexture: string | BaseTexture): BaseTexture; static removeFromCache(baseTexture: string | BaseTexture): BaseTexture;
} }
export class TextureUvs { export class TextureUvs {
x0: number; x0: number;
y0: number; y0: number;
...@@ -4591,8 +4591,8 @@ export class TextureUvs { ...@@ -4591,8 +4591,8 @@ export class TextureUvs {
* @param {number} rotate - Rotation of frame, see {@link GroupD8} * @param {number} rotate - Rotation of frame, see {@link GroupD8}
*/ */
set(frame: Rectangle, baseFrame: Rectangle | BaseTexture, rotate: number): void; set(frame: Rectangle, baseFrame: Rectangle | BaseTexture, rotate: number): void;
} }
export class Texture extends EventDispatcher { export class Texture extends EventDispatcher {
/** /**
* 标记texture没有frame * 标记texture没有frame
...@@ -4762,8 +4762,8 @@ export class Texture extends EventDispatcher { ...@@ -4762,8 +4762,8 @@ export class Texture extends EventDispatcher {
* @return {Texture} 返回移除的纹理 * @return {Texture} 返回移除的纹理
*/ */
static removeFromCache(texture: any): Texture; static removeFromCache(texture: any): Texture;
} }
export class FillStyle { export class FillStyle {
/** /**
* 十六进制颜色 * 十六进制颜色
...@@ -4804,8 +4804,8 @@ export class FillStyle { ...@@ -4804,8 +4804,8 @@ export class FillStyle {
* 销毁 * 销毁
*/ */
destroy(): void; destroy(): void;
} }
export class LineStyle extends FillStyle { export class LineStyle extends FillStyle {
/** /**
* webgl的画线模式 * webgl的画线模式
...@@ -4832,8 +4832,8 @@ export class LineStyle extends FillStyle { ...@@ -4832,8 +4832,8 @@ export class LineStyle extends FillStyle {
* 重置 * 重置
*/ */
reset(): void; reset(): void;
} }
export class GraphicsData extends HashObject { export class GraphicsData extends HashObject {
fillStyle: FillStyle; fillStyle: FillStyle;
lineStyle: LineStyle; lineStyle: LineStyle;
...@@ -4868,43 +4868,43 @@ export class GraphicsData extends HashObject { ...@@ -4868,43 +4868,43 @@ export class GraphicsData extends HashObject {
* Destroys the Graphics data. * Destroys the Graphics data.
*/ */
destroy(): void; destroy(): void;
} }
export function earcut(data: any, holeIndices: any, dim: any): any[]; export function earcut(data: any, holeIndices: any, dim: any): any[];
export const _default: { export const _default: {
build(graphicsData: GraphicsData): void; build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void; triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
} }
export const _default: { export const _default: {
build(graphicsData: GraphicsData): void; build(graphicsData: GraphicsData): void;
triangulate(graphicsData: any, graphicsGeometry: Graphics): void; triangulate(graphicsData: any, graphicsGeometry: Graphics): void;
} }
export const _default: { export const _default: {
build(graphicsData: GraphicsData): void; build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphics: Graphics): void; triangulate(graphicsData: GraphicsData, graphics: Graphics): void;
} }
export const _default: { export const _default: {
build(graphicsData: GraphicsData): void; build(graphicsData: GraphicsData): void;
triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void; triangulate(graphicsData: GraphicsData, graphicsGeometry: Graphics): void;
} }
export function bezierCurveControlPoint(points: any): { export function bezierCurveControlPoint(points: any): {
A: any[]; A: any[];
B: any[]; B: any[];
} }
export const GRAPHICS_CURVES: { export const GRAPHICS_CURVES: {
adaptive: boolean; adaptive: boolean;
maxLength: number; maxLength: number;
minSegments: number; minSegments: number;
maxSegments: number; maxSegments: number;
segmentsCount: Function; segmentsCount: Function;
} }
export class Graphics extends Container { export class Graphics extends Container {
/** /**
* 混色模式 * 混色模式
...@@ -5294,8 +5294,8 @@ export class Graphics extends Container { ...@@ -5294,8 +5294,8 @@ export class Graphics extends Container {
* @param {number} size * @param {number} size
*/ */
private adjustUvs; private adjustUvs;
} }
export class MouseEvent extends Event { export class MouseEvent extends Event {
/** /**
* 鼠标或者手指按下事件 * 鼠标或者手指按下事件
...@@ -5427,8 +5427,8 @@ export class MouseEvent extends Event { ...@@ -5427,8 +5427,8 @@ export class MouseEvent extends Event {
* 销毁 * 销毁
*/ */
destroy(): void; destroy(): void;
} }
export class Stage extends Container { export class Stage extends Container {
/** /**
* 当前stage所使用的渲染器 * 当前stage所使用的渲染器
...@@ -5647,8 +5647,8 @@ export class Stage extends Container { ...@@ -5647,8 +5647,8 @@ export class Stage extends Container {
*/ */
getBounds(): Rectangle; getBounds(): Rectangle;
destroy(): void; destroy(): void;
} }
export class DisplayObject extends EventDispatcher { export class DisplayObject extends EventDispatcher {
/** /**
* 基础信息 * 基础信息
...@@ -6011,8 +6011,8 @@ export class DisplayObject extends EventDispatcher { ...@@ -6011,8 +6011,8 @@ export class DisplayObject extends EventDispatcher {
* 更新方法,帧循环的监听事件是放在这派发的 * 更新方法,帧循环的监听事件是放在这派发的
*/ */
update(): void; update(): void;
} }
export class Container extends DisplayObject { export class Container extends DisplayObject {
/** /**
* 为false鼠标事件不再向下传递 * 为false鼠标事件不再向下传递
...@@ -6206,8 +6206,8 @@ export class Container extends DisplayObject { ...@@ -6206,8 +6206,8 @@ export class Container extends DisplayObject {
* @static * @static
*/ */
private static _getElementsByName; private static _getElementsByName;
} }
export class FloatDisplay extends DisplayObject { export class FloatDisplay extends DisplayObject {
/** /**
* 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式 * 需要封装起来的html元素的引用。你可以通过这个引用来调用或设置此元素自身的属性方法和事件,甚至是样式
...@@ -6292,8 +6292,8 @@ export class FloatDisplay extends DisplayObject { ...@@ -6292,8 +6292,8 @@ export class FloatDisplay extends DisplayObject {
renderCanvas(): void; renderCanvas(): void;
renderWebGL(): void; renderWebGL(): void;
destroy(): void; destroy(): void;
} }
export class Shape extends Sprite { export class Shape extends Sprite {
canvas: HTMLCanvasElement; canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D; context: CanvasRenderingContext2D;
...@@ -6601,8 +6601,8 @@ export class Shape extends Sprite { ...@@ -6601,8 +6601,8 @@ export class Shape extends Sprite {
_renderCanvas(renderer: any): void; _renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void; _renderWebGL(renderer: any): void;
destroy(): void; destroy(): void;
} }
export class TextField extends Sprite { export class TextField extends Sprite {
private static shareCanvas; private static shareCanvas;
private static shareContext; private static shareContext;
...@@ -6834,8 +6834,8 @@ export class TextField extends Sprite { ...@@ -6834,8 +6834,8 @@ export class TextField extends Sprite {
_renderCanvas(renderer: any): void; _renderCanvas(renderer: any): void;
_renderWebGL(renderer: any): void; _renderWebGL(renderer: any): void;
destroy(): void; destroy(): void;
} }
export class EditableText extends TextField { export class EditableText extends TextField {
htmlElement: any; htmlElement: any;
private _prompt; private _prompt;
...@@ -6863,8 +6863,8 @@ export class EditableText extends TextField { ...@@ -6863,8 +6863,8 @@ export class EditableText extends TextField {
set inputValue(v: string); set inputValue(v: string);
constructor(); constructor();
private initElement; private initElement;
} }
export class InputText extends FloatDisplay { export class InputText extends FloatDisplay {
/** /**
* 输入文本的类型. * 输入文本的类型.
...@@ -7014,10 +7014,10 @@ export class InputText extends FloatDisplay { ...@@ -7014,10 +7014,10 @@ export class InputText extends FloatDisplay {
* @param textField * @param textField
*/ */
convertToTextField(textField?: TextField): TextField; convertToTextField(textField?: TextField): TextField;
} }
export class BitmapText extends Container { export class BitmapText extends Container {
private textures; textures;
/** /**
* 水平对齐方式,默认居中 * 水平对齐方式,默认居中
* 改变x坐标原点 * 改变x坐标原点
...@@ -7058,8 +7058,8 @@ export class BitmapText extends Container { ...@@ -7058,8 +7058,8 @@ export class BitmapText extends Container {
* 适配, * 适配,
*/ */
private adaptate; private adaptate;
} }
export class Tween { export class Tween {
/** /**
* 不做特殊处理 * 不做特殊处理
...@@ -7499,8 +7499,8 @@ export class Tween { ...@@ -7499,8 +7499,8 @@ export class Tween {
* @platform Web,Native * @platform Web,Native
*/ */
$tick(delta: number): void; $tick(delta: number): void;
} }
export class Button extends Sprite { export class Button extends Sprite {
private textureUp; private textureUp;
private textureDown; private textureDown;
...@@ -7534,8 +7534,8 @@ export class Button extends Sprite { ...@@ -7534,8 +7534,8 @@ export class Button extends Sprite {
set textureStatusEnable(value: boolean); set textureStatusEnable(value: boolean);
set enabled(value: boolean); set enabled(value: boolean);
destroy(): void; destroy(): void;
} }
export class FrameAni extends Container { export class FrameAni extends Container {
private showImage; private showImage;
/** /**
...@@ -7603,8 +7603,8 @@ export class FrameAni extends Container { ...@@ -7603,8 +7603,8 @@ export class FrameAni extends Container {
* @param texturesAll * @param texturesAll
*/ */
resetTexturesAll(texturesAll: Texture[]): void; resetTexturesAll(texturesAll: Texture[]): void;
} }
export class Ease { export class Ease {
/** /**
* @version * @version
...@@ -8092,8 +8092,8 @@ export class Ease { ...@@ -8092,8 +8092,8 @@ export class Ease {
* @language zh_CN * @language zh_CN
*/ */
static elasticInOut: (t: number) => number; static elasticInOut: (t: number) => number;
} }
export class ScrollPage extends Container { export class ScrollPage extends Container {
/** /**
* 横向还是纵向 默认为纵向 * 横向还是纵向 默认为纵向
...@@ -8262,14 +8262,14 @@ export class ScrollPage extends Container { ...@@ -8262,14 +8262,14 @@ export class ScrollPage extends Container {
*/ */
scrollTo(dis: number, time?: number): void; scrollTo(dis: number, time?: number): void;
destroy(): void; destroy(): void;
} }
export interface IScrollListItem extends DisplayObject { export interface IScrollListItem extends DisplayObject {
initData(id: number, data: any): void; initData(id: number, data: any): void;
id: number; id: number;
data: number; data: number;
} }
export class ScrollList extends ScrollPage { export class ScrollList extends ScrollPage {
private _items; private _items;
private _itemW; private _itemW;
...@@ -8333,8 +8333,8 @@ export class ScrollList extends ScrollPage { ...@@ -8333,8 +8333,8 @@ export class ScrollList extends ScrollPage {
*/ */
setLoading(downLoading: DisplayObject): void; setLoading(downLoading: DisplayObject): void;
destroy(): void; destroy(): void;
} }
export class MovieClip extends Container { export class MovieClip extends Container {
/** /**
* 原始数据,接口在解析类上,不搞先 * 原始数据,接口在解析类上,不搞先
...@@ -8563,13 +8563,13 @@ export class MovieClip extends Container { ...@@ -8563,13 +8563,13 @@ export class MovieClip extends Container {
_styles: any; _styles: any;
_transform: any; _transform: any;
}, useStyle?: boolean): Shape; }, useStyle?: boolean): Shape;
} }
export interface IAnimationTrack { export interface IAnimationTrack {
setValue: (time: number) => void; setValue: (time: number) => void;
resetValue: () => void; resetValue: () => void;
} }
export class AnimationClip extends EventDispatcher { export class AnimationClip extends EventDispatcher {
name: string; name: string;
/** /**
...@@ -8663,8 +8663,8 @@ export class AnimationClip extends EventDispatcher { ...@@ -8663,8 +8663,8 @@ export class AnimationClip extends EventDispatcher {
* 所以各自track自行处理 * 所以各自track自行处理
*/ */
resetState(): void; resetState(): void;
} }
export abstract class AnimationNode extends Container { export abstract class AnimationNode extends Container {
/** /**
* 原始数据,尽量只获取,不修改 * 原始数据,尽量只获取,不修改
...@@ -8782,8 +8782,8 @@ export abstract class AnimationNode extends Container { ...@@ -8782,8 +8782,8 @@ export abstract class AnimationNode extends Container {
* @param callback 参数loop表示还剩几次 * @param callback 参数loop表示还剩几次
*/ */
startAniRange: (beginTime: number, endTime: number, loops: number, callback?: (loop: number) => void) => void; startAniRange: (beginTime: number, endTime: number, loops: number, callback?: (loop: number) => void) => void;
} }
export class SvgaAni extends AnimationNode { export class SvgaAni extends AnimationNode {
/** /**
* 原始数据,接口在解析类上,不搞先,尽量只获取,不修改 * 原始数据,接口在解析类上,不搞先,尽量只获取,不修改
...@@ -8866,14 +8866,14 @@ export class SvgaAni extends AnimationNode { ...@@ -8866,14 +8866,14 @@ export class SvgaAni extends AnimationNode {
* @param anchorY 相对锚点y,默认0 * @param anchorY 相对锚点y,默认0
*/ */
static deepCopyFrames(frames: FrameEntity[], x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, anchorX?: number, anchorY?: number): any[]; static deepCopyFrames(frames: FrameEntity[], x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, anchorX?: number, anchorY?: number): any[];
} }
export {}; export {};
export const getBezierEasing: (a: any, b: any, c: any, d: any, nm?: any) => any; export const getBezierEasing: (a: any, b: any, c: any, d: any, nm?: any) => any;
export function buildBezierProp(pt1: any, pt2: any, pt3: any, pt4: any, startIndex: any, endIndex: any, time: any, fnc: any): any[]; export function buildBezierProp(pt1: any, pt2: any, pt3: any, pt4: any, startIndex: any, endIndex: any, time: any, fnc: any): any[];
export class Lottie extends AnimationNode { export class Lottie extends AnimationNode {
/** /**
* 原始数据,尽量只获取,不修改 * 原始数据,尽量只获取,不修改
...@@ -8909,10 +8909,10 @@ export class Lottie extends AnimationNode { ...@@ -8909,10 +8909,10 @@ export class Lottie extends AnimationNode {
* @returns * @returns
*/ */
init(data: LottieData): void; init(data: LottieData): void;
} }
export {}; export {};
export class Vector3 { export class Vector3 {
x: number; x: number;
y: number; y: number;
...@@ -8977,8 +8977,8 @@ export class Vector3 { ...@@ -8977,8 +8977,8 @@ export class Vector3 {
equals(v: Vector3): boolean; equals(v: Vector3): boolean;
fromArray(array: number[] | Float32Array, offset?: number): this; fromArray(array: number[] | Float32Array, offset?: number): this;
toArray(array?: any[], offset?: number): any[]; toArray(array?: any[], offset?: number): any[];
} }
export class Quaternion { export class Quaternion {
private _x; private _x;
private _y; private _y;
...@@ -9019,8 +9019,8 @@ export class Quaternion { ...@@ -9019,8 +9019,8 @@ export class Quaternion {
toArray(array?: any[], offset?: number): any[]; toArray(array?: any[], offset?: number): any[];
onChange(callback: any): this; onChange(callback: any): this;
private onChangeCallback; private onChangeCallback;
} }
export class Matrix4 { export class Matrix4 {
elements: Float32Array; elements: Float32Array;
constructor(); constructor();
...@@ -9215,8 +9215,8 @@ export class Matrix4 { ...@@ -9215,8 +9215,8 @@ export class Matrix4 {
decompose(position: any, quaternion: any, scale: any): this; decompose(position: any, quaternion: any, scale: any): this;
determinant(): number; determinant(): number;
extractRotation(m: any): this; extractRotation(m: any): this;
} }
export class Camera extends Object3D { export class Camera extends Object3D {
worldMatrixInverse: Matrix4; worldMatrixInverse: Matrix4;
projectionMatrix: Matrix4; projectionMatrix: Matrix4;
...@@ -9230,8 +9230,8 @@ export class Camera extends Object3D { ...@@ -9230,8 +9230,8 @@ export class Camera extends Object3D {
copy(source: any, recursive?: any): this; copy(source: any, recursive?: any): this;
getWorldDirection(target: Vector3): Vector3; getWorldDirection(target: Vector3): Vector3;
updateWorldMatrix(): void; updateWorldMatrix(): void;
} }
export class PerspectiveCamera extends Camera { export class PerspectiveCamera extends Camera {
fov: number; fov: number;
aspect: number; aspect: number;
...@@ -9254,35 +9254,35 @@ export class PerspectiveCamera extends Camera { ...@@ -9254,35 +9254,35 @@ export class PerspectiveCamera extends Camera {
* 更新 * 更新
*/ */
updateProjectionMatrix(): void; updateProjectionMatrix(): void;
} }
export class BaseShader extends GLShader { export class BaseShader extends GLShader {
/** /**
* 作为该着色器的标识 * 作为该着色器的标识
*/ */
_glShaderKey: string; _glShaderKey: string;
constructor(gl: WebGLRenderingContext); constructor(gl: WebGLRenderingContext);
} }
export enum shaderReplaceStr { export enum shaderReplaceStr {
POINT_LIGHTS_NUM = "POINT_LIGHTS_NUM", POINT_LIGHTS_NUM = "POINT_LIGHTS_NUM",
DIR_LIGHTS_NUM = "DIR_LIGHTS_NUM" DIR_LIGHTS_NUM = "DIR_LIGHTS_NUM"
} }
export class LightShader extends GLShader { export class LightShader extends GLShader {
/** /**
* 作为该着色器的标识 * 作为该着色器的标识
*/ */
_glShaderKey: string; _glShaderKey: string;
constructor(gl: WebGLRenderingContext, pointLightsNum?: number, dirLightsNum?: number); constructor(gl: WebGLRenderingContext, pointLightsNum?: number, dirLightsNum?: number);
} }
export enum EnvBlendType { export enum EnvBlendType {
ENVMAP_BLENDING_MULTIPLY = "ENVMAP_BLENDING_MULTIPLY", ENVMAP_BLENDING_MULTIPLY = "ENVMAP_BLENDING_MULTIPLY",
ENVMAP_BLENDING_MIX = "ENVMAP_BLENDING_MIX", ENVMAP_BLENDING_MIX = "ENVMAP_BLENDING_MIX",
ENVMAP_BLENDING_ADD = "ENVMAP_BLENDING_ADD" ENVMAP_BLENDING_ADD = "ENVMAP_BLENDING_ADD"
} }
export enum RenderSideType { export enum RenderSideType {
/** /**
* 正面才渲染,逆时针顶点 * 正面才渲染,逆时针顶点
...@@ -9296,8 +9296,8 @@ export enum RenderSideType { ...@@ -9296,8 +9296,8 @@ export enum RenderSideType {
* 两面都渲染 * 两面都渲染
*/ */
DoubleSide = 2 DoubleSide = 2
} }
export class BaseMaterial extends HashObject { export class BaseMaterial extends HashObject {
/** /**
* 十六进制 hex2rgb ,转成0到1的数组 * 十六进制 hex2rgb ,转成0到1的数组
...@@ -9348,8 +9348,8 @@ export class BaseMaterial extends HashObject { ...@@ -9348,8 +9348,8 @@ export class BaseMaterial extends HashObject {
copy(material: BaseMaterial): this; copy(material: BaseMaterial): this;
clone(): BaseMaterial; clone(): BaseMaterial;
destroy(): void; destroy(): void;
} }
export interface BaseMaterialParamsInt { export interface BaseMaterialParamsInt {
color?: number; color?: number;
alpha?: number; alpha?: number;
...@@ -9362,10 +9362,10 @@ export interface BaseMaterialParamsInt { ...@@ -9362,10 +9362,10 @@ export interface BaseMaterialParamsInt {
morphTargets?: boolean; morphTargets?: boolean;
morphNormals?: boolean; morphNormals?: boolean;
skinning?: boolean; skinning?: boolean;
} }
export function getCusShader(render: WebglRenderer, material: BaseMaterial, lights: LightsConfig, mesh: Mesh3D, maxBones?: number, useVertexTexture?: boolean, fog?: any, shadow?: any): CusShader; export function getCusShader(render: WebglRenderer, material: BaseMaterial, lights: LightsConfig, mesh: Mesh3D, maxBones?: number, useVertexTexture?: boolean, fog?: any, shadow?: any): CusShader;
export class CusShader extends GLShader { export class CusShader extends GLShader {
/** /**
* 以后回收时用TODO * 以后回收时用TODO
...@@ -9381,18 +9381,18 @@ export class CusShader extends GLShader { ...@@ -9381,18 +9381,18 @@ export class CusShader extends GLShader {
* @param parameters * @param parameters
*/ */
constructor(gl: WebGLRenderingContext, parameters: ShaderParametersInt); constructor(gl: WebGLRenderingContext, parameters: ShaderParametersInt);
} }
export {}; export {};
export class Bone3D extends Object3D { export class Bone3D extends Object3D {
par: number; par: number;
pos: any; pos: any;
rotq: any; rotq: any;
scl: any; scl: any;
constructor(); constructor();
} }
export class Skeleton3D extends HashObject { export class Skeleton3D extends HashObject {
bones: Bone3D[]; bones: Bone3D[];
boneMatrices: Float32Array; boneMatrices: Float32Array;
...@@ -9409,8 +9409,8 @@ export class Skeleton3D extends HashObject { ...@@ -9409,8 +9409,8 @@ export class Skeleton3D extends HashObject {
clone(): Skeleton3D; clone(): Skeleton3D;
getBoneByName(name: string): Bone3D; getBoneByName(name: string): Bone3D;
destroy(): void; destroy(): void;
} }
export class Vector2 { export class Vector2 {
x: number; x: number;
y: number; y: number;
...@@ -9446,8 +9446,8 @@ export class Vector2 { ...@@ -9446,8 +9446,8 @@ export class Vector2 {
equals(v: any): boolean; equals(v: any): boolean;
fromArray(array: any, offset: any): this; fromArray(array: any, offset: any): this;
toArray(array?: any[], offset?: number): any[]; toArray(array?: any[], offset?: number): any[];
} }
export class Sphere { export class Sphere {
center: Vector3; center: Vector3;
radius: number; radius: number;
...@@ -9466,8 +9466,8 @@ export class Sphere { ...@@ -9466,8 +9466,8 @@ export class Sphere {
applyMatrix4(matrix: Matrix4): this; applyMatrix4(matrix: Matrix4): this;
translate(offset: Vector3): this; translate(offset: Vector3): this;
equals(sphere: Sphere): boolean; equals(sphere: Sphere): boolean;
} }
export class Box3 { export class Box3 {
min: Vector3; min: Vector3;
max: Vector3; max: Vector3;
...@@ -9519,8 +9519,8 @@ export class Box3 { ...@@ -9519,8 +9519,8 @@ export class Box3 {
applyMatrix4(matrix: Matrix4): this; applyMatrix4(matrix: Matrix4): this;
translate(offset: Vector3): this; translate(offset: Vector3): this;
equals(box: Box3): boolean; equals(box: Box3): boolean;
} }
export class Geometry extends HashObject { export class Geometry extends HashObject {
/** /**
* 顶点坐标3,颜色3,uv2,法线3,到时还是搞成three的那种方式,多属性对象,统一放到vao上 * 顶点坐标3,颜色3,uv2,法线3,到时还是搞成three的那种方式,多属性对象,统一放到vao上
...@@ -9577,8 +9577,8 @@ export class Geometry extends HashObject { ...@@ -9577,8 +9577,8 @@ export class Geometry extends HashObject {
computeBoundingBox(): void; computeBoundingBox(): void;
computeBoundingSphere(): void; computeBoundingSphere(): void;
destroy(): void; destroy(): void;
} }
export interface VaoBufferInt { export interface VaoBufferInt {
/** /**
* 索引 * 索引
...@@ -9608,17 +9608,17 @@ export interface VaoBufferInt { ...@@ -9608,17 +9608,17 @@ export interface VaoBufferInt {
vaos: { vaos: {
[key: string]: VertexArrayObject; [key: string]: VertexArrayObject;
}; };
} }
export class LightMaterial extends BaseMaterial { export class LightMaterial extends BaseMaterial {
constructor(parameters?: any); constructor(parameters?: any);
clone(): any; clone(): any;
} }
export const defaultVertexShader3d = "attribute vec3 aPosition;\nuniform mat4 uViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat4 uModelMatrix;\nvoid main() {\n gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4( aPosition, 1.0 );\n}"; export const defaultVertexShader3d = "attribute vec3 aPosition;\nuniform mat4 uViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat4 uModelMatrix;\nvoid main() {\n gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4( aPosition, 1.0 );\n}";
export const defaultFragmentShader3d = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; export const defaultFragmentShader3d = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
export class ShaderMaterial extends HashObject { export class ShaderMaterial extends HashObject {
protected vertexShader: string; protected vertexShader: string;
protected fragmentShader: string; protected fragmentShader: string;
...@@ -9652,8 +9652,8 @@ export class ShaderMaterial extends HashObject { ...@@ -9652,8 +9652,8 @@ export class ShaderMaterial extends HashObject {
*/ */
getShader(renderer: WebglRenderer): GLShader; getShader(renderer: WebglRenderer): GLShader;
destroy(): void; destroy(): void;
} }
export enum UniformType { export enum UniformType {
float = "f", float = "f",
/** /**
...@@ -9680,8 +9680,8 @@ export enum UniformType { ...@@ -9680,8 +9680,8 @@ export enum UniformType {
* m4对象 * m4对象
*/ */
matrix4 = "m4" matrix4 = "m4"
} }
export class Sprite3dMaterial extends ShaderMaterial { export class Sprite3dMaterial extends ShaderMaterial {
sizeAttenuation: boolean; sizeAttenuation: boolean;
constructor(); constructor();
...@@ -9696,8 +9696,8 @@ export class Sprite3dMaterial extends ShaderMaterial { ...@@ -9696,8 +9696,8 @@ export class Sprite3dMaterial extends ShaderMaterial {
set alpha(v: number); set alpha(v: number);
get map(): Texture; get map(): Texture;
set map(v: Texture); set map(v: Texture);
} }
export class SkinnedMesh3D extends Mesh3D { export class SkinnedMesh3D extends Mesh3D {
bindMode: "attached" | "detached"; bindMode: "attached" | "detached";
bindMatrix: Matrix4; bindMatrix: Matrix4;
...@@ -9711,16 +9711,16 @@ export class SkinnedMesh3D extends Mesh3D { ...@@ -9711,16 +9711,16 @@ export class SkinnedMesh3D extends Mesh3D {
updateWorldMatrix(): void; updateWorldMatrix(): void;
update(): void; update(): void;
clone(): any; clone(): any;
} }
export class ShadowShader extends GLShader { export class ShadowShader extends GLShader {
/** /**
* TODO,以后用,是否有顶点动画,骨骼动画等还要区分着色器唯一id * TODO,以后用,是否有顶点动画,骨骼动画等还要区分着色器唯一id
*/ */
_glShaderKey: string; _glShaderKey: string;
constructor(gl: WebGLRenderingContext); constructor(gl: WebGLRenderingContext);
} }
export class OrthographicCamera extends Camera { export class OrthographicCamera extends Camera {
private left; private left;
private right; private right;
...@@ -9734,8 +9734,8 @@ export class OrthographicCamera extends Camera { ...@@ -9734,8 +9734,8 @@ export class OrthographicCamera extends Camera {
copy(source: OrthographicCamera, recursive?: boolean): this; copy(source: OrthographicCamera, recursive?: boolean): this;
clone(): OrthographicCamera; clone(): OrthographicCamera;
updateProjectionMatrix(): void; updateProjectionMatrix(): void;
} }
export class D3Renderer extends ObjectRenderer { export class D3Renderer extends ObjectRenderer {
/** /**
* 赋值的相机,需要里面的worldMatrixInverse和projectionMatrix * 赋值的相机,需要里面的worldMatrixInverse和projectionMatrix
...@@ -9780,8 +9780,8 @@ export class D3Renderer extends ObjectRenderer { ...@@ -9780,8 +9780,8 @@ export class D3Renderer extends ObjectRenderer {
render(obj: Mesh3D): void; render(obj: Mesh3D): void;
flush(): void; flush(): void;
private getMaxBones; private getMaxBones;
} }
export class LightShadow extends HashObject { export class LightShadow extends HashObject {
camera?: Camera; camera?: Camera;
bias: number; bias: number;
...@@ -9797,8 +9797,8 @@ export class LightShadow extends HashObject { ...@@ -9797,8 +9797,8 @@ export class LightShadow extends HashObject {
*/ */
clone(): LightShadow; clone(): LightShadow;
destroy(): void; destroy(): void;
} }
export class Light extends Object3D { export class Light extends Object3D {
intensity: number; intensity: number;
private _color; private _color;
...@@ -9819,8 +9819,8 @@ export class Light extends Object3D { ...@@ -9819,8 +9819,8 @@ export class Light extends Object3D {
*/ */
constructor(color: number, intensity?: number); constructor(color: number, intensity?: number);
copy(light: Light): this; copy(light: Light): this;
} }
export class PointLight extends Light { export class PointLight extends Light {
distance: number; distance: number;
decay: number; decay: number;
...@@ -9835,13 +9835,13 @@ export class PointLight extends Light { ...@@ -9835,13 +9835,13 @@ export class PointLight extends Light {
get power(): number; get power(): number;
set power(value: number); set power(value: number);
copy(pointLight: PointLight): this; copy(pointLight: PointLight): this;
} }
export class DirectionalLightShadow extends LightShadow { export class DirectionalLightShadow extends LightShadow {
constructor(); constructor();
clone(): any; clone(): any;
} }
export class DirectionalLight extends Light { export class DirectionalLight extends Light {
/** /**
* 目标对象 * 目标对象
...@@ -9849,8 +9849,8 @@ export class DirectionalLight extends Light { ...@@ -9849,8 +9849,8 @@ export class DirectionalLight extends Light {
target: Object3D; target: Object3D;
constructor(color: number, intensity: number); constructor(color: number, intensity: number);
copy(directionalLight: DirectionalLight): this; copy(directionalLight: DirectionalLight): this;
} }
export class Ray { export class Ray {
origin: Vector3; origin: Vector3;
direction: Vector3; direction: Vector3;
...@@ -9871,8 +9871,8 @@ export class Ray { ...@@ -9871,8 +9871,8 @@ export class Ray {
intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, out: Vector3): Vector3; intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, out: Vector3): Vector3;
applyMatrix4(matrix4: Matrix4): this; applyMatrix4(matrix4: Matrix4): this;
equals(ray: Ray): boolean; equals(ray: Ray): boolean;
} }
export class Raycaster { export class Raycaster {
near: number; near: number;
far: number; far: number;
...@@ -9881,20 +9881,20 @@ export class Raycaster { ...@@ -9881,20 +9881,20 @@ export class Raycaster {
set(origin: Vector3, direction: Vector3): void; set(origin: Vector3, direction: Vector3): void;
setFromCamera(coords: Vector3, camera: Camera): void; setFromCamera(coords: Vector3, camera: Camera): void;
intersectObject(object: Object3D, optionalTarget?: IntersectData[]): IntersectData[]; intersectObject(object: Object3D, optionalTarget?: IntersectData[]): IntersectData[];
} }
export interface IntersectData { export interface IntersectData {
distance: number; distance: number;
point?: Vector3; point?: Vector3;
object: Object3D; object: Object3D;
uv?: Vector2; uv?: Vector2;
} }
export enum ShadowType { export enum ShadowType {
basic = "SHADOWMAP_TYPE_BASIC", basic = "SHADOWMAP_TYPE_BASIC",
pcf = "SHADOWMAP_TYPE_PCF" pcf = "SHADOWMAP_TYPE_PCF"
} }
export class Scene3D extends Object3D { export class Scene3D extends Object3D {
private _viewId; private _viewId;
/** /**
...@@ -9956,8 +9956,8 @@ export class Scene3D extends Object3D { ...@@ -9956,8 +9956,8 @@ export class Scene3D extends Object3D {
private orbitControlConfig; private orbitControlConfig;
setOrbCtrCfg(options: IOrbitControlConfig): void; setOrbCtrCfg(options: IOrbitControlConfig): void;
setOrbitControl(options?: IOrbitControlConfig): void; setOrbitControl(options?: IOrbitControlConfig): void;
} }
export interface IOrbitControlConfig { export interface IOrbitControlConfig {
enabled?: boolean; enabled?: boolean;
enableDamping?: boolean; enableDamping?: boolean;
...@@ -9973,16 +9973,16 @@ export interface IOrbitControlConfig { ...@@ -9973,16 +9973,16 @@ export interface IOrbitControlConfig {
minDistance?: number; minDistance?: number;
maxDistance?: number; maxDistance?: number;
enablePitch?: boolean; enablePitch?: boolean;
} }
export interface LightsConfig { export interface LightsConfig {
pointLights: PointLightConfig[]; pointLights: PointLightConfig[];
directionalLights: DirectionalLightConfig[]; directionalLights: DirectionalLightConfig[];
ambientLightColor: number[]; ambientLightColor: number[];
} }
export {}; export {};
export enum RotationOrders { export enum RotationOrders {
XYZ = "XYZ", XYZ = "XYZ",
YZX = "YZX", YZX = "YZX",
...@@ -9990,8 +9990,8 @@ export enum RotationOrders { ...@@ -9990,8 +9990,8 @@ export enum RotationOrders {
XZY = "XZY", XZY = "XZY",
YXZ = "YXZ", YXZ = "YXZ",
ZYX = "ZYX" ZYX = "ZYX"
} }
export class Euler { export class Euler {
private _x; private _x;
private _y; private _y;
...@@ -10019,8 +10019,8 @@ export class Euler { ...@@ -10019,8 +10019,8 @@ export class Euler {
toVector3(optionalResult: any): any; toVector3(optionalResult: any): any;
onChange(callback: any): this; onChange(callback: any): this;
onChangeCallback(): void; onChangeCallback(): void;
} }
export class Object3D extends EventDispatcher { export class Object3D extends EventDispatcher {
static DefaultUp: Vector3; static DefaultUp: Vector3;
/** /**
...@@ -10174,8 +10174,8 @@ export class Object3D extends EventDispatcher { ...@@ -10174,8 +10174,8 @@ export class Object3D extends EventDispatcher {
* 角度制 * 角度制
*/ */
set rotationZ(value: number); set rotationZ(value: number);
} }
export class Mesh3D extends Object3D { export class Mesh3D extends Object3D {
geometry: Geometry; geometry: Geometry;
material: BaseMaterial; material: BaseMaterial;
...@@ -10194,12 +10194,12 @@ export class Mesh3D extends Object3D { ...@@ -10194,12 +10194,12 @@ export class Mesh3D extends Object3D {
* @param recursive 默认克隆子级 * @param recursive 默认克隆子级
*/ */
clone(recursive?: boolean): Mesh3D; clone(recursive?: boolean): Mesh3D;
} }
export class SphereGeometry extends Geometry { export class SphereGeometry extends Geometry {
constructor(radius?: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); constructor(radius?: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number);
} }
export class BoxGeometry extends Geometry { export class BoxGeometry extends Geometry {
/** /**
* *
...@@ -10211,16 +10211,16 @@ export class BoxGeometry extends Geometry { ...@@ -10211,16 +10211,16 @@ export class BoxGeometry extends Geometry {
* @param depthSegments * @param depthSegments
*/ */
constructor(width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number); constructor(width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number);
} }
export class PlaneGeometry extends Geometry { export class PlaneGeometry extends Geometry {
constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number); constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number);
} }
export class CircleGeometry extends Geometry { export class CircleGeometry extends Geometry {
constructor(radius?: number, segments?: number, thetaStart?: number, thetaLength?: number); constructor(radius?: number, segments?: number, thetaStart?: number, thetaLength?: number);
} }
export class CylinderGeometry extends Geometry { export class CylinderGeometry extends Geometry {
constructor( constructor(
/** /**
...@@ -10255,50 +10255,50 @@ export class CylinderGeometry extends Geometry { ...@@ -10255,50 +10255,50 @@ export class CylinderGeometry extends Geometry {
* 圆柱结束角度,默认Math.PI * 2 * 圆柱结束角度,默认Math.PI * 2
*/ */
thetaLength?: number); thetaLength?: number);
} }
export class RingGeometry extends Geometry { export class RingGeometry extends Geometry {
constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number); constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number);
} }
export class TorusGeometry extends Geometry { export class TorusGeometry extends Geometry {
constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number); constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number);
} }
export class AmbientLight extends Light { export class AmbientLight extends Light {
constructor(color: number, intensity: number); constructor(color: number, intensity: number);
} }
export class AxesHelper extends Mesh3D { export class AxesHelper extends Mesh3D {
constructor(size?: number); constructor(size?: number);
} }
export class GridHelper extends Mesh3D { export class GridHelper extends Mesh3D {
constructor(size?: number, divisions?: number, color1?: number, color2?: number); constructor(size?: number, divisions?: number, color1?: number, color2?: number);
} }
export class Box3Helper extends Mesh3D { export class Box3Helper extends Mesh3D {
box: Box3; box: Box3;
constructor(box: Box3, color?: number); constructor(box: Box3, color?: number);
updateWorldMatrix(updateParents?: boolean, updateChildren?: boolean): void; updateWorldMatrix(updateParents?: boolean, updateChildren?: boolean): void;
} }
export function isTypedArray(object: any): boolean; export function isTypedArray(object: any): boolean;
export function convertArray(array: any, type: any, forceClone?: boolean): any; export function convertArray(array: any, type: any, forceClone?: boolean): any;
export function flattenJSON(jsonKeys: any, times: any, values: any, valuePropertyName: any): void; export function flattenJSON(jsonKeys: any, times: any, values: any, valuePropertyName: any): void;
export function getKeyframeOrder(times: any): any[]; export function getKeyframeOrder(times: any): any[];
export function sortedArray(values: any, stride: any, order: any): any; export function sortedArray(values: any, stride: any, order: any): any;
export var InterpolateDiscrete: number; export var InterpolateDiscrete: number;
export var InterpolateLinear: number; export var InterpolateLinear: number;
export var InterpolateSmooth: number; export var InterpolateSmooth: number;
export enum AnimationType3D { export enum AnimationType3D {
/** /**
* 旋转 * 旋转
...@@ -10316,8 +10316,8 @@ export enum AnimationType3D { ...@@ -10316,8 +10316,8 @@ export enum AnimationType3D {
* 位移 * 位移
*/ */
position = "position" position = "position"
} }
export class AnimationTrack3D extends HashObject implements IAnimationTrack { export class AnimationTrack3D extends HashObject implements IAnimationTrack {
/** /**
* 需要改变属性的节点对象 * 需要改变属性的节点对象
...@@ -10366,8 +10366,8 @@ export class AnimationTrack3D extends HashObject implements IAnimationTrack { ...@@ -10366,8 +10366,8 @@ export class AnimationTrack3D extends HashObject implements IAnimationTrack {
*/ */
private findPreIndex; private findPreIndex;
destroy(): void; destroy(): void;
} }
export class AnimationManager extends HashObject { export class AnimationManager extends HashObject {
private animationClips; private animationClips;
protected currentClip: AnimationClip; protected currentClip: AnimationClip;
...@@ -10402,8 +10402,8 @@ export class AnimationManager extends HashObject { ...@@ -10402,8 +10402,8 @@ export class AnimationManager extends HashObject {
*/ */
update(deltaTime?: number): void; update(deltaTime?: number): void;
destroy(): void; destroy(): void;
} }
export interface GltfData { export interface GltfData {
scene: Scene3D; scene: Scene3D;
scenes: Scene3D[]; scenes: Scene3D[];
...@@ -10415,10 +10415,10 @@ export interface GltfData { ...@@ -10415,10 +10415,10 @@ export interface GltfData {
version: string; version: string;
}; };
parser: GLTFParser; parser: GLTFParser;
} }
export function loadGltf(url: string, onLoad: (gltf: GltfData) => void, onError: (err: any) => void): void; export function loadGltf(url: string, onLoad: (gltf: GltfData) => void, onError: (err: any) => void): void;
export class GLTFParser { export class GLTFParser {
json: any; json: any;
extensions: {}; extensions: {};
...@@ -10537,8 +10537,8 @@ export class GLTFParser { ...@@ -10537,8 +10537,8 @@ export class GLTFParser {
* @return {Promise<THREE.Scene>} * @return {Promise<THREE.Scene>}
*/ */
loadScene: (sceneIndex: any) => any; loadScene: (sceneIndex: any) => any;
} }
export class GLTFRegistry { export class GLTFRegistry {
private objects; private objects;
constructor(); constructor();
...@@ -10546,8 +10546,8 @@ export class GLTFRegistry { ...@@ -10546,8 +10546,8 @@ export class GLTFRegistry {
add(key: string, object: any): void; add(key: string, object: any): void;
remove(key: string): void; remove(key: string): void;
removeAll(): void; removeAll(): void;
} }
export class BufferAttribute { export class BufferAttribute {
array: any; array: any;
itemSize: number; itemSize: number;
...@@ -10589,8 +10589,8 @@ export class BufferAttribute { ...@@ -10589,8 +10589,8 @@ export class BufferAttribute {
setXYZW(index: number, x: number, y: number, z: number, w: number): this; setXYZW(index: number, x: number, y: number, z: number, w: number): this;
copy(source: BufferAttribute): this; copy(source: BufferAttribute): this;
clone(): BufferAttribute; clone(): BufferAttribute;
} }
export class InterleavedBuffer { export class InterleavedBuffer {
array?: any; array?: any;
stride?: number; stride?: number;
...@@ -10600,8 +10600,8 @@ export class InterleavedBuffer { ...@@ -10600,8 +10600,8 @@ export class InterleavedBuffer {
copy(source: InterleavedBuffer): this; copy(source: InterleavedBuffer): this;
set(value: any, offset?: number): this; set(value: any, offset?: number): this;
clone(): InterleavedBuffer; clone(): InterleavedBuffer;
} }
export class InterleavedBufferAttribute { export class InterleavedBufferAttribute {
itemSize: number; itemSize: number;
offset: number; offset: number;
...@@ -10622,14 +10622,14 @@ export class InterleavedBufferAttribute { ...@@ -10622,14 +10622,14 @@ export class InterleavedBufferAttribute {
setXY(index: any, x: any, y: any): this; setXY(index: any, x: any, y: any): this;
setXYZ(index: any, x: any, y: any, z: any): this; setXYZ(index: any, x: any, y: any, z: any): this;
setXYZW(index: any, x: any, y: any, z: any, w: any): this; setXYZW(index: any, x: any, y: any, z: any, w: any): this;
} }
export {}; export {};
export class Sprite3D extends Mesh3D { export class Sprite3D extends Mesh3D {
constructor(material: Sprite3dMaterial); constructor(material: Sprite3dMaterial);
} }
export class Bone extends Container { export class Bone extends Container {
data: IBoneData; data: IBoneData;
root: Container; root: Container;
...@@ -10663,8 +10663,8 @@ export class Bone extends Container { ...@@ -10663,8 +10663,8 @@ export class Bone extends Container {
*/ */
updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void; updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
private appliedSelf; private appliedSelf;
} }
export interface IBoneData { export interface IBoneData {
length: number; length: number;
name: string; name: string;
...@@ -10678,21 +10678,21 @@ export interface IBoneData { ...@@ -10678,21 +10678,21 @@ export interface IBoneData {
shearY: number; shearY: number;
transform: TransformType; transform: TransformType;
skin: boolean; skin: boolean;
} }
export enum TransformType { export enum TransformType {
normal = "normal", normal = "normal",
onlyTranslation = "onlyTranslation", onlyTranslation = "onlyTranslation",
noRotationOrReflection = "noRotationOrReflection", noRotationOrReflection = "noRotationOrReflection",
noScale = "noScale", noScale = "noScale",
noScaleOrReflection = "noScaleOrReflection" noScaleOrReflection = "noScaleOrReflection"
} }
export abstract class Attachment { export abstract class Attachment {
name: string; name: string;
constructor(name: string); constructor(name: string);
} }
export abstract class VertexAttachment extends Attachment { export abstract class VertexAttachment extends Attachment {
private static nextID; private static nextID;
id: number; id: number;
...@@ -10709,8 +10709,8 @@ export abstract class VertexAttachment extends Attachment { ...@@ -10709,8 +10709,8 @@ export abstract class VertexAttachment extends Attachment {
* @param worldVertices The output world vertices. Must have a length >= offset + count. * @param worldVertices The output world vertices. Must have a length >= offset + count.
* @param offset The worldVertices index to begin writing values. */ * @param offset The worldVertices index to begin writing values. */
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number, skeletonBones: Bone[]): void; computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number, skeletonBones: Bone[]): void;
} }
export class SpineColor { export class SpineColor {
r: number; r: number;
g: number; g: number;
...@@ -10728,8 +10728,8 @@ export class SpineColor { ...@@ -10728,8 +10728,8 @@ export class SpineColor {
static BLUE: SpineColor; static BLUE: SpineColor;
static MAGENTA: SpineColor; static MAGENTA: SpineColor;
static fromString(hex: string): SpineColor; static fromString(hex: string): SpineColor;
} }
export class Slot extends Container { export class Slot extends Container {
/** /**
* 绑定的骨骼 * 绑定的骨骼
...@@ -10767,8 +10767,8 @@ export class Slot extends Container { ...@@ -10767,8 +10767,8 @@ export class Slot extends Container {
getAttachment(): Attachment; getAttachment(): Attachment;
setAttachment(attachment: Attachment): void; setAttachment(attachment: Attachment): void;
setToSetupPose(): void; setToSetupPose(): void;
} }
export interface ISlotData { export interface ISlotData {
attachment: string; attachment: string;
bone: string; bone: string;
...@@ -10777,8 +10777,8 @@ export interface ISlotData { ...@@ -10777,8 +10777,8 @@ export interface ISlotData {
color: string; color: string;
dark: string; dark: string;
sColor?: SpineColor; sColor?: SpineColor;
} }
export class Skin { export class Skin {
name: string; name: string;
attachments: any[]; attachments: any[];
...@@ -10786,8 +10786,8 @@ export class Skin { ...@@ -10786,8 +10786,8 @@ export class Skin {
addAttachment(slotIndex: number, name: string, attachment: Attachment): void; addAttachment(slotIndex: number, name: string, attachment: Attachment): void;
getAttachment(slotIndex: number, name: string): any; getAttachment(slotIndex: number, name: string): any;
attachAll(slots: Slot[], oldSkin: Skin): void; attachAll(slots: Slot[], oldSkin: Skin): void;
} }
export class RegionAttachment extends Attachment { export class RegionAttachment extends Attachment {
x: number; x: number;
y: number; y: number;
...@@ -10799,8 +10799,8 @@ export class RegionAttachment extends Attachment { ...@@ -10799,8 +10799,8 @@ export class RegionAttachment extends Attachment {
texture: Texture; texture: Texture;
color: SpineColor; color: SpineColor;
constructor(name: string, x: number, y: number, scaleX: number, scaleY: number, rotation: number, width: number, height: number, texture: Texture); constructor(name: string, x: number, y: number, scaleX: number, scaleY: number, rotation: number, width: number, height: number, texture: Texture);
} }
export class MeshAttachment extends VertexAttachment { export class MeshAttachment extends VertexAttachment {
texture: Texture; texture: Texture;
path: string; path: string;
...@@ -10812,8 +10812,8 @@ export class MeshAttachment extends VertexAttachment { ...@@ -10812,8 +10812,8 @@ export class MeshAttachment extends VertexAttachment {
height: number; height: number;
hullLength: number; hullLength: number;
edges: Array<number>; edges: Array<number>;
} }
export class Curve { export class Curve {
static LINEAR: number; static LINEAR: number;
static STEPPED: number; static STEPPED: number;
...@@ -10836,51 +10836,51 @@ export class Curve { ...@@ -10836,51 +10836,51 @@ export class Curve {
setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void; setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void;
/** Returns the interpolated percentage for the specified key frame and linear percentage. */ /** Returns the interpolated percentage for the specified key frame and linear percentage. */
getCurvePercent(frameIndex: number, percent: number): number; getCurvePercent(frameIndex: number, percent: number): number;
} }
export function readCurve(map: any, curve: Curve, frameIndex: number): void; export function readCurve(map: any, curve: Curve, frameIndex: number): void;
export enum MixBlend { export enum MixBlend {
setup = 0, setup = 0,
first = 1, first = 1,
replace = 2, replace = 2,
add = 3 add = 3
} }
export enum MixDirection { export enum MixDirection {
in = 0, in = 0,
out = 1 out = 1
} }
export function binarySearch(values: Float32Array | number[], target: number, step?: number): number; export function binarySearch(values: Float32Array | number[], target: number, step?: number): number;
export function arrayCopy(source: any, sourceStart: any, dest: any, destStart: any, numElements: any): void; export function arrayCopy(source: any, sourceStart: any, dest: any, destStart: any, numElements: any): void;
export function setArraySize(array: any, size: any, value?: number): any; export function setArraySize(array: any, size: any, value?: number): any;
export function newArray(size: number, defaultValue: any): any[]; export function newArray(size: number, defaultValue: any): any[];
export class BaseTrack extends HashObject implements IAnimationTrack { export class BaseTrack extends HashObject implements IAnimationTrack {
setValue(time: number, alpha?: number, blend?: MixBlend, direction?: MixDirection): void; setValue(time: number, alpha?: number, blend?: MixBlend, direction?: MixDirection): void;
resetValue(): void; resetValue(): void;
destroy(): void; destroy(): void;
} }
export interface IBoneAniData { export interface IBoneAniData {
time: number; time: number;
angle: number; angle: number;
x: number; x: number;
y: number; y: number;
curve: "stepped" | [number, number, number, number]; curve: "stepped" | [number, number, number, number];
} }
export enum SpineBoneAniType { export enum SpineBoneAniType {
rotate = "rotate", rotate = "rotate",
translate = "translate", translate = "translate",
scale = "scale", scale = "scale",
shear = "shear" shear = "shear"
} }
export class SpineBoneAniTrack extends BaseTrack { export class SpineBoneAniTrack extends BaseTrack {
/** /**
* 需要改变属性的节点对象 * 需要改变属性的节点对象
...@@ -10924,14 +10924,14 @@ export class SpineBoneAniTrack extends BaseTrack { ...@@ -10924,14 +10924,14 @@ export class SpineBoneAniTrack extends BaseTrack {
*/ */
private findPreIndex; private findPreIndex;
destroy(): void; destroy(): void;
} }
export interface IColorAniData { export interface IColorAniData {
curve: "stepped" | [number, number, number, number]; curve: "stepped" | [number, number, number, number];
color: string; color: string;
time: number; time: number;
} }
export class SpineColorAniTrack extends BaseTrack { export class SpineColorAniTrack extends BaseTrack {
/** /**
* 需要改变颜色的插槽 * 需要改变颜色的插槽
...@@ -10960,15 +10960,15 @@ export class SpineColorAniTrack extends BaseTrack { ...@@ -10960,15 +10960,15 @@ export class SpineColorAniTrack extends BaseTrack {
static G: number; static G: number;
static B: number; static B: number;
static A: number; static A: number;
} }
export interface IDeformAniData { export interface IDeformAniData {
curve: "stepped" | [number, number, number, number]; curve: "stepped" | [number, number, number, number];
offset: number; offset: number;
time: number; time: number;
vertices: number[]; vertices: number[];
} }
export class SpineDeformAniTrack extends BaseTrack { export class SpineDeformAniTrack extends BaseTrack {
/** /**
* 需要改变属性的节点对象 * 需要改变属性的节点对象
...@@ -10999,13 +10999,13 @@ export class SpineDeformAniTrack extends BaseTrack { ...@@ -10999,13 +10999,13 @@ export class SpineDeformAniTrack extends BaseTrack {
*/ */
times: IDeformAniData[]); times: IDeformAniData[]);
setValue(time: number, alpha?: number, blend?: MixBlend): void; setValue(time: number, alpha?: number, blend?: MixBlend): void;
} }
export interface IAttachmentAniData { export interface IAttachmentAniData {
name?: string; name?: string;
time: number; time: number;
} }
export class AttachmentAniTrack extends BaseTrack { export class AttachmentAniTrack extends BaseTrack {
/** /**
* 需要改变附件的插槽 * 需要改变附件的插槽
...@@ -11034,8 +11034,8 @@ export class AttachmentAniTrack extends BaseTrack { ...@@ -11034,8 +11034,8 @@ export class AttachmentAniTrack extends BaseTrack {
*/ */
spine: Spine); spine: Spine);
setValue(time: number, alpha?: number, blend?: MixBlend, direction?: MixDirection): void; setValue(time: number, alpha?: number, blend?: MixBlend, direction?: MixDirection): void;
} }
export interface IDrawOrderAniData { export interface IDrawOrderAniData {
time: number; time: number;
offsets?: { offsets?: {
...@@ -11043,8 +11043,8 @@ export interface IDrawOrderAniData { ...@@ -11043,8 +11043,8 @@ export interface IDrawOrderAniData {
offset: number; offset: number;
}[]; }[];
drawOrder?: number[]; drawOrder?: number[];
} }
export class DrawOrderAniTrack extends BaseTrack { export class DrawOrderAniTrack extends BaseTrack {
slots: Slot[]; slots: Slot[];
drawOrder: Slot[]; drawOrder: Slot[];
...@@ -11055,8 +11055,8 @@ export class DrawOrderAniTrack extends BaseTrack { ...@@ -11055,8 +11055,8 @@ export class DrawOrderAniTrack extends BaseTrack {
* 层级需要加个重置方法,因为部分动画并没有层级时间轴,会导致当前动画层级根据上一个动画来 * 层级需要加个重置方法,因为部分动画并没有层级时间轴,会导致当前动画层级根据上一个动画来
*/ */
resetValue(): void; resetValue(): void;
} }
export class SpineAniClip extends AnimationClip { export class SpineAniClip extends AnimationClip {
alpha: number; alpha: number;
blend: MixBlend; blend: MixBlend;
...@@ -11072,8 +11072,8 @@ export class SpineAniClip extends AnimationClip { ...@@ -11072,8 +11072,8 @@ export class SpineAniClip extends AnimationClip {
*/ */
mixDuration: number; mixDuration: number;
protected rectify(): void; protected rectify(): void;
} }
export class SpineAniManager extends AnimationManager { export class SpineAniManager extends AnimationManager {
currentClip: SpineAniClip; currentClip: SpineAniClip;
/** /**
...@@ -11089,8 +11089,8 @@ export class SpineAniManager extends AnimationManager { ...@@ -11089,8 +11089,8 @@ export class SpineAniManager extends AnimationManager {
update(deltaTime?: number): void; update(deltaTime?: number): void;
private applyMixingFrom; private applyMixingFrom;
private resetFrom; private resetFrom;
} }
export class IkConstraint extends HashObject { export class IkConstraint extends HashObject {
destroy(): void; destroy(): void;
target: Bone; target: Bone;
...@@ -11118,13 +11118,13 @@ export class IkConstraint extends HashObject { ...@@ -11118,13 +11118,13 @@ export class IkConstraint extends HashObject {
* A direct descendant of the parent bone. * A direct descendant of the parent bone.
*/ */
apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, softness: number, alpha: number): void; apply2(parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, softness: number, alpha: number): void;
} }
export class ClippingAttachment extends VertexAttachment { export class ClippingAttachment extends VertexAttachment {
color: SpineColor; color: SpineColor;
endSlot: ISlotData; endSlot: ISlotData;
} }
export interface ISkeletonData { export interface ISkeletonData {
skeleton: { skeleton: {
images: string; images: string;
...@@ -11199,8 +11199,8 @@ export interface ISkeletonData { ...@@ -11199,8 +11199,8 @@ export interface ISkeletonData {
compress: boolean; compress: boolean;
stretch: boolean; stretch: boolean;
}[]; }[];
} }
export enum SkinType { export enum SkinType {
region = "region", region = "region",
mesh = "mesh", mesh = "mesh",
...@@ -11208,8 +11208,8 @@ export enum SkinType { ...@@ -11208,8 +11208,8 @@ export enum SkinType {
linkedmesh = "linkedmesh", linkedmesh = "linkedmesh",
path = "path", path = "path",
point = "point" point = "point"
} }
export class Spine extends Container { export class Spine extends Container {
private spineData; private spineData;
private boneContainer; private boneContainer;
...@@ -11267,14 +11267,14 @@ export class Spine extends Container { ...@@ -11267,14 +11267,14 @@ export class Spine extends Container {
* 获取所有动画的名字 * 获取所有动画的名字
*/ */
get aniNames(): string[]; get aniNames(): string[];
} }
export {}; export {};
export function loadAtlas(url: string, onLoad: (textures: any) => void, onError?: (err: any) => void, imgUrl?: string): void; export function loadAtlas(url: string, onLoad: (textures: any) => void, onError?: (err: any) => void, imgUrl?: string): void;
export function createTexturesByAtlas(baseTexture: BaseTexture, altaData: string): { export function createTexturesByAtlas(baseTexture: BaseTexture, altaData: string): {
[key: string]: Texture; [key: string]: Texture;
} }
export function loadSpine(url: string, onLoad: (spineData: ISkeletonData) => void, onError?: (err: any) => void): void;} export function loadSpine(url: string, onLoad: (spineData: ISkeletonData) => void, onError?: (err: any) => void): void;}
\ No newline at end of file
{ {
"data": { "data": {
"id": 666666,
"isFirstJoin": true
}, },
"success": true, "success": true,
"code": "111", "code": "111",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"success": true, "success": true,
"data": { "data": {
"id": "123456", "id": "123456",
"type": 5, "type": 3,
"name": "吕秀兰", "name": "吕秀兰",
"image": "https://yun.duiba.com.cn/aurora/assets/8c6cce25b4970d776a4ac89780ffe97b2c69c56c.png" "image": "https://yun.duiba.com.cn/aurora/assets/8c6cce25b4970d776a4ac89780ffe97b2c69c56c.png"
} }
......
{
"data": {
"id": 666666,
"score": 233,
"isNewRecord": false,
"productLink": "http://qnpic.top/yoona2",
"isWinPrize": false
},
"success": true,
"code": "111",
"message": "ok"
}
...@@ -5,17 +5,21 @@ ...@@ -5,17 +5,21 @@
"name": "CountDownComp" "name": "CountDownComp"
}, },
{ {
"keys": "back-home.png,more-btn.png,new-record-icon.png,share-btn.png", "keys": "back-home.png,jump-icon.png,more-btn.png,new-record-icon.png,product-link__icon.png,share-btn.png",
"name": "GameOver" "name": "GameOver"
}, },
{ {
"keys": "back_index.png,gg_back.png,one_more-btn.png", "keys": "over-back.png,over-tipsicon.png,prize-icon1.png",
"name": "GameOverPanel" "name": "GameOverPanel"
}, },
{ {
"keys": "balance_guidance.png,guidance-t1.png,num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,numb0.png,numb1.png,numb2.png,numb3.png,numb4.png,numb5.png,numb6.png,numb7.png,numb8.png,numb9.png,numbp.png,nump.png,p1-b.png,p1.png,p10-b.png,p10.png,p11-b.png,p11.png,p12-b.png,p12.png,p13-b.png,p13.png,p14-b.png,p14.png,p15-b.png,p15.png,p16-b.png,p16.png,p17-b.png,p17.png,p18-b.png,p18.png,p19-b.png,p19.png,p2-b.png,p2.png,p20-b.png,p20.png,p3-b.png,p3.png,p4-b.png,p4.png,p5-b.png,p5.png,p6-b.png,p6.png,p7-b.png,p7.png,p8-b.png,p8.png,p9-b.png,p9.png", "keys": "balance_guidance.png,guidance-t1.png,num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,numb0.png,numb1.png,numb2.png,numb3.png,numb4.png,numb5.png,numb6.png,numb7.png,numb8.png,numb9.png,numbp.png,nump.png,p1-b.png,p1.png,p10-b.png,p10.png,p11-b.png,p11.png,p12-b.png,p12.png,p13-b.png,p13.png,p14-b.png,p14.png,p15-b.png,p15.png,p16-b.png,p16.png,p17-b.png,p17.png,p18-b.png,p18.png,p19-b.png,p19.png,p2-b.png,p2.png,p20-b.png,p20.png,p3-b.png,p3.png,p4-b.png,p4.png,p5-b.png,p5.png,p6-b.png,p6.png,p7-b.png,p7.png,p8-b.png,p8.png,p9-b.png,p9.png",
"name": "GameScene" "name": "GameScene"
}, },
{
"keys": "confirm-btn.png,prize-back.png",
"name": "PrizeShowPanel"
},
{ {
"keys": "back.png,comCloseBtn.png,com_light.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png", "keys": "back.png,comCloseBtn.png,com_light.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png",
"name": "common" "name": "common"
......
import { GameOverPanel } from './panels/GameOverPanel';
import { GameScene } from './scenes/GameScene/GameScene'; import { GameScene } from './scenes/GameScene/GameScene';
import { NewGuyScene } from './scenes/NewGuyScene/NewGuyScene'; import { NewGuyScene } from './scenes/NewGuyScene/NewGuyScene';
import { destroyLayers, layers } from "../module/views/layers"; import { destroyLayers, layers } from "../module/views/layers";
import { RES } from "../module/RES"; import { RES } from "../module/RES";
import { changeScene, destroyAllCtrls, showToast } from "../module/ctrls"; import { changeScene, destroyAllCtrls, showPanel, showToast } from "../module/ctrls";
import MusicBtn from "./common/MusicBtn"; import MusicBtn from "./common/MusicBtn";
import { ResJson } from "./ResJson"; import { ResJson } from "./ResJson";
...@@ -11,6 +12,7 @@ import { SkinJson } from "./SkinJson"; ...@@ -11,6 +12,7 @@ import { SkinJson } from "./SkinJson";
import { G_EVENT } from "./common/G_EVENT"; import { G_EVENT } from "./common/G_EVENT";
import { Tools } from "./Tools"; import { Tools } from "./Tools";
import { GameOverScene } from "./scenes/GameOverScene/GameOverScene"; import { GameOverScene } from "./scenes/GameOverScene/GameOverScene";
import DeviceMotion from './scenes/GameScene/DeviceMotion';
/** /**
* 全局事件,为了和小程序交互 * 全局事件,为了和小程序交互
...@@ -145,6 +147,8 @@ export class Main { ...@@ -145,6 +147,8 @@ export class Main {
destroyTbNetData(); destroyTbNetData();
// web环境其实没必要 // web环境其实没必要
// destroyWebNetData() // destroyWebNetData()
DeviceMotion.instance && DeviceMotion.instance.destory()
} }
private async onAddToStage() { private async onAddToStage() {
...@@ -163,7 +167,7 @@ export class Main { ...@@ -163,7 +167,7 @@ export class Main {
// h5环境时,隐藏加载中 // h5环境时,隐藏加载中
if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none"; if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
console.log('getGlobalData')
await Tools.getGlobalData() await Tools.getGlobalData()
// const baseSuccess = await Tools.getActivityBaseInfo(); // const baseSuccess = await Tools.getActivityBaseInfo();
...@@ -178,18 +182,17 @@ export class Main { ...@@ -178,18 +182,17 @@ export class Main {
// return; // return;
// } // }
// const scene = Tools.globalData.newUser ? StoryScene : IndexScene; const scene = Tools.globalData.completed ? GameScene : NewGuyScene;
// vtodo 是否是新手 // vtodo 是否是新手
changeScene(GameScene, { changeScene(scene);
score: 45,
isNewRecord: true,
productLink: 'http://qnpic.top/yoona2.jpg',
isWinPrize: false
});
// MusicBtn.changeMusicStatus(true); // TODO 进游戏打开音乐先 // MusicBtn.changeMusicStatus(true); // TODO 进游戏打开音乐先
// (function() {
// showPanel(GameOverPanel, {
// score: '1'
// })
// })()
} }
} }
......
...@@ -2,903 +2,28 @@ export const ResJson = { ...@@ -2,903 +2,28 @@ export const ResJson = {
"groups": [ "groups": [
{ {
"keys": "countdown-back.png", "keys": "countdown-back.png",
"name": "CountDownComp", "name": "CountDownComp"
"atlas": {
"countdown-back.png": {
"x": 2,
"y": 2,
"w": 207,
"h": 57,
"ox": 0,
"oy": 0,
"sw": 207,
"sh": 57,
"ro": false
}
}
}, },
{ {
"keys": "back-home.png,more-btn.png,new-record-icon.png,share-btn.png", "keys": "back-home.png,jump-icon.png,more-btn.png,new-record-icon.png,product-link__icon.png,share-btn.png",
"name": "GameOver", "name": "GameOver"
"atlas": {
"more-btn.png": {
"x": 2,
"y": 2,
"w": 655,
"h": 120,
"ox": 0,
"oy": 0,
"sw": 655,
"sh": 120,
"ro": false
},
"share-btn.png": {
"x": 2,
"y": 124,
"w": 655,
"h": 120,
"ox": 0,
"oy": 0,
"sw": 655,
"sh": 120,
"ro": false
},
"back-home.png": {
"x": 2,
"y": 246,
"w": 130,
"h": 43,
"ox": 0,
"oy": 0,
"sw": 130,
"sh": 43,
"ro": false
},
"new-record-icon.png": {
"x": 134,
"y": 246,
"w": 102,
"h": 37,
"ox": 0,
"oy": 0,
"sw": 102,
"sh": 37,
"ro": false
}
}
}, },
{ {
"keys": "back_index.png,gg_back.png,one_more-btn.png", "keys": "over-back.png,over-tipsicon.png,prize-icon1.png",
"name": "GameOverPanel", "name": "GameOverPanel"
"atlas": {
"gg_back.png": {
"x": 2,
"y": 2,
"w": 667,
"h": 578,
"ox": 0,
"oy": 1,
"sw": 666,
"sh": 579,
"ro": false
},
"back_index.png": {
"x": 2,
"y": 582,
"w": 254,
"h": 74,
"ox": 0,
"oy": 0,
"sw": 254,
"sh": 74,
"ro": false
},
"one_more-btn.png": {
"x": 2,
"y": 658,
"w": 254,
"h": 75,
"ox": 0,
"oy": 0,
"sw": 254,
"sh": 75,
"ro": false
}
}
}, },
{ {
"keys": "balance_guidance.png,guidance-t1.png,num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,numb0.png,numb1.png,numb2.png,numb3.png,numb4.png,numb5.png,numb6.png,numb7.png,numb8.png,numb9.png,numbp.png,nump.png,p1-b.png,p1.png,p10-b.png,p10.png,p11-b.png,p11.png,p12-b.png,p12.png,p13-b.png,p13.png,p14-b.png,p14.png,p15-b.png,p15.png,p16-b.png,p16.png,p17-b.png,p17.png,p18-b.png,p18.png,p19-b.png,p19.png,p2-b.png,p2.png,p20-b.png,p20.png,p3-b.png,p3.png,p4-b.png,p4.png,p5-b.png,p5.png,p6-b.png,p6.png,p7-b.png,p7.png,p8-b.png,p8.png,p9-b.png,p9.png", "keys": "balance_guidance.png,guidance-t1.png,num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,numb0.png,numb1.png,numb2.png,numb3.png,numb4.png,numb5.png,numb6.png,numb7.png,numb8.png,numb9.png,numbp.png,nump.png,p1-b.png,p1.png,p10-b.png,p10.png,p11-b.png,p11.png,p12-b.png,p12.png,p13-b.png,p13.png,p14-b.png,p14.png,p15-b.png,p15.png,p16-b.png,p16.png,p17-b.png,p17.png,p18-b.png,p18.png,p19-b.png,p19.png,p2-b.png,p2.png,p20-b.png,p20.png,p3-b.png,p3.png,p4-b.png,p4.png,p5-b.png,p5.png,p6-b.png,p6.png,p7-b.png,p7.png,p8-b.png,p8.png,p9-b.png,p9.png",
"name": "GameScene", "name": "GameScene"
"atlas": { },
"guidance-t1.png": { {
"x": 2, "keys": "confirm-btn.png,prize-back.png",
"y": 2, "name": "PrizeShowPanel"
"w": 574,
"h": 183,
"ox": 0,
"oy": 0,
"sw": 574,
"sh": 183,
"ro": false
},
"p12-b.png": {
"x": 2,
"y": 187,
"w": 335,
"h": 535,
"ox": 0,
"oy": 0,
"sw": 335,
"sh": 535,
"ro": true
},
"p12.png": {
"x": 2,
"y": 524,
"w": 335,
"h": 535,
"ox": 0,
"oy": 0,
"sw": 335,
"sh": 535,
"ro": true
},
"p20-b.png": {
"x": 578,
"y": 2,
"w": 287,
"h": 535,
"ox": 0,
"oy": 0,
"sw": 287,
"sh": 535,
"ro": false
},
"p20.png": {
"x": 2,
"y": 861,
"w": 287,
"h": 535,
"ox": 0,
"oy": 0,
"sw": 287,
"sh": 535,
"ro": true
},
"p11-b.png": {
"x": 867,
"y": 2,
"w": 496,
"h": 533,
"ox": 0,
"oy": 0,
"sw": 496,
"sh": 533,
"ro": false
},
"p11.png": {
"x": 867,
"y": 537,
"w": 496,
"h": 533,
"ox": 0,
"oy": 0,
"sw": 496,
"sh": 533,
"ro": false
},
"p13-b.png": {
"x": 2,
"y": 1150,
"w": 421,
"h": 533,
"ox": 0,
"oy": 0,
"sw": 421,
"sh": 533,
"ro": true
},
"p13.png": {
"x": 537,
"y": 1150,
"w": 421,
"h": 533,
"ox": 0,
"oy": 0,
"sw": 421,
"sh": 533,
"ro": true
},
"balance_guidance.png": {
"x": 539,
"y": 539,
"w": 258,
"h": 532,
"ox": 0,
"oy": 0,
"sw": 258,
"sh": 532,
"ro": false
},
"p3-b.png": {
"x": 1365,
"y": 2,
"w": 532,
"h": 520,
"ox": 0,
"oy": 0,
"sw": 532,
"sh": 520,
"ro": true
},
"p3.png": {
"x": 1365,
"y": 536,
"w": 532,
"h": 520,
"ox": 0,
"oy": 0,
"sw": 532,
"sh": 520,
"ro": true
},
"p9-b.png": {
"x": 1072,
"y": 1072,
"w": 487,
"h": 532,
"ox": 0,
"oy": 0,
"sw": 487,
"sh": 532,
"ro": true
},
"p9.png": {
"x": 2,
"y": 1573,
"w": 487,
"h": 532,
"ox": 0,
"oy": 0,
"sw": 487,
"sh": 532,
"ro": true
},
"p4-b.png": {
"x": 1072,
"y": 1561,
"w": 499,
"h": 531,
"ox": 0,
"oy": 0,
"sw": 499,
"sh": 531,
"ro": true
},
"p4.png": {
"x": 1605,
"y": 1561,
"w": 499,
"h": 531,
"ox": 0,
"oy": 0,
"sw": 499,
"sh": 531,
"ro": true
},
"p6-b.png": {
"x": 536,
"y": 1573,
"w": 526,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 526,
"sh": 368,
"ro": false
},
"p6.png": {
"x": 1606,
"y": 1070,
"w": 526,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 526,
"sh": 368,
"ro": false
},
"p2-b.png": {
"x": 2,
"y": 2062,
"w": 524,
"h": 518,
"ox": 0,
"oy": 0,
"sw": 524,
"sh": 518,
"ro": false
},
"p2.png": {
"x": 528,
"y": 2062,
"w": 524,
"h": 518,
"ox": 0,
"oy": 0,
"sw": 524,
"sh": 518,
"ro": false
},
"p18-b.png": {
"x": 1887,
"y": 2,
"w": 270,
"h": 521,
"ox": 0,
"oy": 0,
"sw": 270,
"sh": 521,
"ro": false
},
"p18.png": {
"x": 1887,
"y": 525,
"w": 270,
"h": 521,
"ox": 0,
"oy": 0,
"sw": 270,
"sh": 521,
"ro": false
},
"p10-b.png": {
"x": 1054,
"y": 2062,
"w": 502,
"h": 513,
"ox": 0,
"oy": 0,
"sw": 502,
"sh": 513,
"ro": false
},
"p10.png": {
"x": 1558,
"y": 2062,
"w": 502,
"h": 513,
"ox": 0,
"oy": 0,
"sw": 502,
"sh": 513,
"ro": false
},
"p5-b.png": {
"x": 2062,
"y": 2062,
"w": 460,
"h": 513,
"ox": 0,
"oy": 0,
"sw": 460,
"sh": 513,
"ro": false
},
"p5.png": {
"x": 2134,
"y": 1048,
"w": 460,
"h": 513,
"ox": 0,
"oy": 0,
"sw": 460,
"sh": 513,
"ro": true
},
"p15-b.png": {
"x": 2138,
"y": 1510,
"w": 499,
"h": 463,
"ox": 0,
"oy": 0,
"sw": 499,
"sh": 463,
"ro": true
},
"p15.png": {
"x": 2159,
"y": 2,
"w": 499,
"h": 463,
"ox": 0,
"oy": 0,
"sw": 499,
"sh": 463,
"ro": false
},
"p14-b.png": {
"x": 2159,
"y": 467,
"w": 438,
"h": 460,
"ox": 0,
"oy": 0,
"sw": 438,
"sh": 460,
"ro": false
},
"p14.png": {
"x": 2,
"y": 2582,
"w": 438,
"h": 460,
"ox": 0,
"oy": 0,
"sw": 438,
"sh": 460,
"ro": true
},
"p8-b.png": {
"x": 2524,
"y": 2011,
"w": 308,
"h": 460,
"ox": 0,
"oy": 0,
"sw": 308,
"sh": 460,
"ro": false
},
"p8.png": {
"x": 2524,
"y": 2473,
"w": 308,
"h": 460,
"ox": 0,
"oy": 0,
"sw": 308,
"sh": 460,
"ro": false
},
"p7-b.png": {
"x": 1054,
"y": 2577,
"w": 426,
"h": 443,
"ox": 0,
"oy": 0,
"sw": 426,
"sh": 443,
"ro": false
},
"p7.png": {
"x": 1482,
"y": 2577,
"w": 426,
"h": 443,
"ox": 0,
"oy": 0,
"sw": 426,
"sh": 443,
"ro": false
},
"p17-b.png": {
"x": 464,
"y": 2582,
"w": 434,
"h": 398,
"ox": 0,
"oy": 0,
"sw": 434,
"sh": 398,
"ro": true
},
"p17.png": {
"x": 1910,
"y": 2577,
"w": 434,
"h": 398,
"ox": 0,
"oy": 0,
"sw": 434,
"sh": 398,
"ro": true
},
"p19-b.png": {
"x": 2834,
"y": 2,
"w": 416,
"h": 364,
"ox": 0,
"oy": 0,
"sw": 416,
"sh": 364,
"ro": true
},
"p19.png": {
"x": 2834,
"y": 420,
"w": 416,
"h": 364,
"ox": 0,
"oy": 0,
"sw": 416,
"sh": 364,
"ro": true
},
"p16-b.png": {
"x": 2834,
"y": 838,
"w": 406,
"h": 360,
"ox": 0,
"oy": 0,
"sw": 406,
"sh": 360,
"ro": true
},
"p16.png": {
"x": 2834,
"y": 1246,
"w": 406,
"h": 360,
"ox": 0,
"oy": 0,
"sw": 406,
"sh": 360,
"ro": true
},
"p1-b.png": {
"x": 2834,
"y": 1654,
"w": 321,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 321,
"sh": 368,
"ro": true
},
"p1.png": {
"x": 2834,
"y": 1977,
"w": 321,
"h": 368,
"ox": 0,
"oy": 0,
"sw": 321,
"sh": 368,
"ro": true
},
"num0.png": {
"x": 2603,
"y": 1510,
"w": 160,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 226,
"ro": true
},
"num3.png": {
"x": 2603,
"y": 1672,
"w": 151,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 151,
"sh": 226,
"ro": true
},
"num8.png": {
"x": 2603,
"y": 1825,
"w": 154,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 154,
"sh": 226,
"ro": true
},
"numb0.png": {
"x": 2599,
"y": 467,
"w": 160,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 226,
"ro": true
},
"numb3.png": {
"x": 2599,
"y": 629,
"w": 151,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 151,
"sh": 226,
"ro": true
},
"numb8.png": {
"x": 2599,
"y": 782,
"w": 154,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 154,
"sh": 226,
"ro": true
},
"num2.png": {
"x": 2660,
"y": 2,
"w": 155,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 155,
"sh": 222,
"ro": false
},
"num5.png": {
"x": 2660,
"y": 226,
"w": 148,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 148,
"sh": 222,
"ro": false
},
"num6.png": {
"x": 2649,
"y": 938,
"w": 153,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 153,
"sh": 222,
"ro": false
},
"num9.png": {
"x": 2649,
"y": 1162,
"w": 153,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 153,
"sh": 222,
"ro": false
},
"numb2.png": {
"x": 864,
"y": 2582,
"w": 155,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 155,
"sh": 222,
"ro": false
},
"numb5.png": {
"x": 2310,
"y": 2577,
"w": 148,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 148,
"sh": 222,
"ro": false
},
"numb6.png": {
"x": 2834,
"y": 2300,
"w": 153,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 153,
"sh": 222,
"ro": true
},
"numb9.png": {
"x": 3058,
"y": 2300,
"w": 153,
"h": 222,
"ox": 0,
"oy": 0,
"sw": 153,
"sh": 222,
"ro": false
},
"num1.png": {
"x": 2310,
"y": 2801,
"w": 94,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 94,
"sh": 218,
"ro": false
},
"num4.png": {
"x": 2834,
"y": 2455,
"w": 162,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 162,
"sh": 218,
"ro": true
},
"num7.png": {
"x": 2834,
"y": 2619,
"w": 163,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 163,
"sh": 218,
"ro": true
},
"numb1.png": {
"x": 2406,
"y": 2801,
"w": 94,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 94,
"sh": 218,
"ro": false
},
"numb4.png": {
"x": 2834,
"y": 2784,
"w": 162,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 162,
"sh": 218,
"ro": false
},
"numb7.png": {
"x": 2998,
"y": 2784,
"w": 163,
"h": 218,
"ox": 0,
"oy": 0,
"sw": 163,
"sh": 218,
"ro": false
},
"numbp.png": {
"x": 1606,
"y": 1440,
"w": 118,
"h": 128,
"ox": 0,
"oy": 0,
"sw": 118,
"sh": 128,
"ro": true
},
"nump.png": {
"x": 1736,
"y": 1440,
"w": 118,
"h": 128,
"ox": 0,
"oy": 0,
"sw": 118,
"sh": 128,
"ro": true
}
}
}, },
{ {
"keys": "back.png,comCloseBtn.png,com_light.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png", "keys": "back.png,comCloseBtn.png,com_light.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png",
"name": "common", "name": "common"
"atlas": {
"back.png": {
"x": 2,
"y": 2,
"w": 750,
"h": 1624,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1624,
"ro": false
},
"com_light.png": {
"x": 754,
"y": 2,
"w": 746,
"h": 756,
"ox": 0,
"oy": 0,
"sw": 746,
"sh": 756,
"ro": false
},
"toastBg.png": {
"x": 754,
"y": 760,
"w": 460,
"h": 130,
"ox": 0,
"oy": 0,
"sw": 460,
"sh": 130,
"ro": false
},
"waitingBg.png": {
"x": 1216,
"y": 760,
"w": 160,
"h": 180,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 180,
"ro": true
},
"跳过按钮.png": {
"x": 1398,
"y": 760,
"w": 123,
"h": 57,
"ox": 0,
"oy": 0,
"sw": 123,
"sh": 57,
"ro": true
},
"comCloseBtn.png": {
"x": 1398,
"y": 885,
"w": 72,
"h": 72,
"ox": 0,
"oy": 0,
"sw": 72,
"sh": 72,
"ro": false
},
"waitingRot.png": {
"x": 754,
"y": 892,
"w": 56,
"h": 56,
"ox": 0,
"oy": 0,
"sw": 56,
"sh": 56,
"ro": false
}
}
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1628512488/resource/" "path": "./resource/"
} }
\ No newline at end of file
...@@ -18,11 +18,11 @@ export enum TbNetName { ...@@ -18,11 +18,11 @@ export enum TbNetName {
receiveInvitePrize = "xunzai.receiveInvitePrize", receiveInvitePrize = "xunzai.receiveInvitePrize",
startGame = "okamoto.startGame", startGame = "yoga.startGame",
submitGame = "okamoto.submitGame", submitGame = "yoga.submitGame",
drawLotteryPrize = "xunzai.drawLotteryPrize", drawLotteryPrize = "yoga.drawLotteryPrize",
doHelp = "xunzai.doHelp", doHelp = "xunzai.doHelp",
...@@ -96,6 +96,8 @@ export enum TbNetName { ...@@ -96,6 +96,8 @@ export enum TbNetName {
* isOn * isOn
*/ */
openMusic = "mine.openMusic", openMusic = "mine.openMusic",
complteGuidance = 'yoga.complateGuide'
} }
//返回数据类型 //返回数据类型
......
...@@ -56,7 +56,8 @@ export class Tools { ...@@ -56,7 +56,8 @@ export class Tools {
newUser1: boolean newUser1: boolean
firstLoginToday: boolean firstLoginToday: boolean
shop: string, shop: string,
startId: string startId: string,
completed: boolean
} }
public static async getGlobalData() { public static async getGlobalData() {
......
...@@ -62,7 +62,13 @@ export default class UI { ...@@ -62,7 +62,13 @@ export default class UI {
imageName: string, imageName: string,
x: number = 0, y: number = 0 x: number = 0, y: number = 0
): Sprite { ): Sprite {
const sprite = new Sprite(RES.getRes(imageName)); var texture = RES.getRes(imageName)
var sprite
if (texture) {
sprite = new Sprite(texture);
} else {
sprite = Sprite.fromUrl(imageName)
}
sprite.position.set(x, y); sprite.position.set(x, y);
parent && parent.addChild(sprite); parent && parent.addChild(sprite);
return sprite; return sprite;
......
...@@ -74,6 +74,7 @@ export default class CountDownComp extends Module { ...@@ -74,6 +74,7 @@ export default class CountDownComp extends Module {
}) })
.to({t: 0}, time.t) .to({t: 0}, time.t)
.call(() => { .call(() => {
this.stop()
this.timeoutFn && this.timeoutFn.forEach(f => f()) this.timeoutFn && this.timeoutFn.forEach(f => f())
}) })
......
import { PrizeShowPanel } from './PrizeShowPanel';
import { changeScene, showPanel } from './../../module/ctrls/index';
import { layers } from './../../module/views/layers'; import { layers } from './../../module/views/layers';
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import UI from "../UI"; import UI from "../UI";
import { Tools } from '../Tools'; import { Tools } from '../Tools';
import { sendTbNet, TbNetName } from '../TaoBaoNet';
import { GameOverScene } from '../scenes/GameOverScene/GameOverScene';
export class GameOverPanel extends Panel { export class GameOverPanel extends Panel {
get groupNames() { get groupNames() {
return ["GameOverPanel"] return ["GameOverPanel"]
} }
bitmapTextCount: FYGE.BitmapText
initUi() { initUi() {
var panelCtn = UI.Ctn(this, (layers.stageWidth - 666) / 2, (1624 - 579)/2) var panelCtn = UI.Ctn(this)
UI.Sp(panelCtn, 'gg_back.png') UI.Sp(panelCtn, 'over-back.png')
panelCtn.position.set(layers.stageCenterX - panelCtn.width / 2, layers.stageCenterY - panelCtn.height / 2)
UI.Btn(panelCtn, 'back_index.png', function() { var bitMapc = Tools.getNumTextures('num')
console.log('返回首页') var bitMapc2 = Tools.getNumTextures('numb')
this.hidePanel() this.bitmapTextCount = panelCtn.addChild(new FYGE.BitmapText(bitMapc))
// 京东淘宝改动点 if (this.data.score < 10) {
if (my) { this.bitmapTextCount.textures = bitMapc2
// @ts-ignore }
my.navigateBack() this.bitmapTextCount.position.set(panelCtn.width / 2, 230)
} else { this.bitmapTextCount.scaleX = 0.5
// @ts-ignore this.bitmapTextCount.scaleY = 0.5
window.jdk._navigateBack() this.bitmapTextCount.text = this.data.score + ''
}
}, this, 60, 440)
UI.Btn(panelCtn, 'one_more-btn.png', function(e) { UI.Txt(panelCtn, '本次得分', 30, '#e95d2a', FYGE.TEXT_ALIGN.CENTER, panelCtn.width, 0, 320)
Tools.btnDelay(e.target)
console.log('再来一局')
// 京东淘宝改动点
if (my) {
// @ts-ignore
this.hidePanel()
this.data.restart()
} else {
// @ts-ignore
window.jdk._startGame && window.jdk._startGame(() => {
this.hidePanel()
this.data.restart()
})
}
}, this, 355, 440)
UI.Txt(panelCtn, this.data.score.toString(), 70, '#e8524b', FYGE.TEXT_ALIGN.CENTER, 300, 180, 320, true) UI.Sp(panelCtn, 'over-tipsicon.png', panelCtn.width / 2, 420).anchorTexture.set(0.5, 0.5)
var icon = UI.Sp(panelCtn, 'prize-icon1.png', panelCtn.width / 2, 580)
icon.anchorTexture.set(0.5, 0.5)
icon.addEventListener(FYGE.MouseEvent.CLICK, async function() {
const {data, success} = await sendTbNet(TbNetName.drawLotteryPrize)
if (success) {
if (data.type != 5) {
// 中奖了
this.hidePanel()
showPanel(PrizeShowPanel, Object.assign({}, data, this.data))
} else {
this.hidePanel()
changeScene(GameOverScene, this.data)
}
}
}, this)
} }
} }
\ No newline at end of file
import { changeScene } from './../../module/ctrls/index';
import { showToast } from '../../module/ctrls';
import { layers } from '../../module/views/layers';
import UI from '../UI';
import { Panel } from './../../module/views/Panel';
import { GameOverScene } from '../scenes/GameOverScene/GameOverScene';
export class PrizeShowPanel extends Panel {
get groupNames(): string[] {
return ['PrizeShowPanel']
}
initUi() {
var panelCtn = UI.Ctn(this)
UI.Sp(panelCtn, 'prize-back.png')
panelCtn.position.set(layers.stageCenterX - panelCtn.width / 2, layers.stageCenterY - panelCtn.height / 2)
UI.Txt(panelCtn, this.data.name, 30, '#757575', FYGE.TEXT_ALIGN.CENTER, panelCtn.width - 60, 30, 170)
var preview = UI.Sp(panelCtn, decodeURI(this.data.image))
preview.width = 300
preview.height = 300
preview.position.set(150, 230)
preview.mask = panelCtn.addChild(new FYGE.Graphics())
.beginFill()
.drawRoundedRect(150, 230, 300, 300, 20)
.endFill()
UI.Btn(panelCtn, 'confirm-btn.png', function() {
if (this.data.type == 3) {
this.hidePanel()
changeScene(GameOverScene, this.data)
//@ts-ignore
my && my.navigateTo({
url: `/pages/rewardinfofill/rewardinfofill?id=${this.data.id}&prizeId=${this.data.prizeId}`
})
} else {
// @ts-ignore
showToast('奖品已为您发放至淘宝卡券~')
this.hidePanel()
changeScene(GameOverScene, this.data)
}
}, this, 40, 580)
}
}
\ No newline at end of file
import { layers } from "../../../module/views/layers"; import { layers } from "../../../module/views/layers";
import { Scene } from "../../../module/views/Scene"; import { Scene } from "../../../module/views/Scene";
import { sendTbNet, TbNetName } from "../../TaoBaoNet";
import { Tools } from "../../Tools"; import { Tools } from "../../Tools";
import UI from "../../UI"; import UI from "../../UI";
...@@ -16,7 +17,11 @@ export class GameOverScene extends Scene { ...@@ -16,7 +17,11 @@ export class GameOverScene extends Scene {
initUi() { initUi() {
UI.Sp(this, 'back.png') UI.Sp(this, 'back.png')
var bitMapc = Tools.getNumTextures('num') var bitMapc = Tools.getNumTextures('num')
var bitMapc2 = Tools.getNumTextures('numb')
this.bitmapTextCount = this.addChild(new FYGE.BitmapText(bitMapc)) this.bitmapTextCount = this.addChild(new FYGE.BitmapText(bitMapc))
if (this.data.score < 10) {
this.bitmapTextCount.textures = bitMapc2
}
this.bitmapTextCount.position.set(layers.stageCenterX, 500) this.bitmapTextCount.position.set(layers.stageCenterX, 500)
this.bitmapTextCount.text = this.data.score + '' this.bitmapTextCount.text = this.data.score + ''
...@@ -26,15 +31,36 @@ export class GameOverScene extends Scene { ...@@ -26,15 +31,36 @@ export class GameOverScene extends Scene {
this.data.isNewRecord && UI.Sp(desc, 'new-record-icon.png', 490, -30) this.data.isNewRecord && UI.Sp(desc, 'new-record-icon.png', 490, -30)
UI.Btn(this, 'share-btn.png', function() { UI.Btn(this, 'share-btn.png', function() {
console.log('点击了分享') // @ts-ignore todo 分享
my && my.showSharePanel()
}, this, 45, 950) }, this, 45, 950)
UI.Btn(this, 'more-btn.png', function() { UI.Btn(this, 'more-btn.png', function() {
console.log('点击了再来一次') // @ts-ignore
my.redirectTo({
url: '/pages/mainscene/mainscene'
})
}, this, 45, 1110) }, this, 45, 1110)
var _s = UI.Sp(this, 'back-home.png', layers.stageCenterX, 1350) var _s = UI.Sp(this, 'back-home.png', layers.stageCenterX, 1350)
_s.addEventListener(FYGE.MouseEvent.CLICK, function() {
// todo
console.log('回到主场')
})
_s.anchorTexture.set(0.5, 0.5) _s.anchorTexture.set(0.5, 0.5)
var bottomCont = UI.Ctn(this)
bottomCont.position.set(0, layers.stageOffsetY + layers.stageHeight - 130)
UI.Rect(bottomCont, layers.stageWidth, 130, 0xffffff)
UI.Sp(bottomCont, 'product-link__icon.png', 50, 25)
UI.Txt(bottomCont, 'Nike 瑜伽商品', 28, '#111111', FYGE.TEXT_ALIGN.LEFT, 500, 160, 35)
UI.Txt(bottomCont, '让你的体态更加健康', 26, '#111111', FYGE.TEXT_ALIGN.LEFT, 500, 160, 75)
UI.Sp(bottomCont, 'jump-icon.png', 600, 40)
.addEventListener(FYGE.MouseEvent.CLICK, function() {
// @ts-ignore
// my.
console.log(this.data.productLink)
})
} }
} }
\ No newline at end of file
...@@ -22,6 +22,11 @@ function getSystemInfo():Promise<SystemInfo> { ...@@ -22,6 +22,11 @@ function getSystemInfo():Promise<SystemInfo> {
class DeviceMotion { class DeviceMotion {
subs: Array<SubType> = [] // 订阅 方法 subs: Array<SubType> = [] // 订阅 方法
private static _instance: DeviceMotion;
static get instance() {
return DeviceMotion._instance || (DeviceMotion._instance = new DeviceMotion())
}
constructor() { constructor() {
this.initEvents() this.initEvents()
} }
...@@ -67,6 +72,12 @@ class DeviceMotion { ...@@ -67,6 +72,12 @@ class DeviceMotion {
} }
} }
destory() {
this._tmdremoveEvents()
this.subs = []
DeviceMotion._instance = null
}
orientationHandler = (event) => { orientationHandler = (event) => {
const res = event const res = event
...@@ -101,6 +112,4 @@ class DeviceMotion { ...@@ -101,6 +112,4 @@ class DeviceMotion {
} }
} }
const deviceMotionSubs = new DeviceMotion() export default DeviceMotion
export default deviceMotionSubs
import { Tools } from './../../Tools';
import { changeScene, showPanel } from './../../../module/ctrls/index';
import { layers } from './../../../module/views/layers'; import { layers } from './../../../module/views/layers';
import UI from "../../UI" import UI from "../../UI"
import { GameCfg } from './GameConfig'; import { GameCfg } from './GameConfig';
import deviceMotionSubs from './DeviceMotion'; import DeviceMotion from './DeviceMotion';
import { GDispatcher } from '../../Main'; import { GDispatcher } from '../../Main';
import { MotionInitFunc, MotionInitScene } from './MotionInit'; import { MotionInitFunc, MotionInitScene } from './MotionInit';
import CountDownComp from '../../components/CountDownComp'; import CountDownComp from '../../components/CountDownComp';
import { RES } from '../../../module/RES'; import { RES } from '../../../module/RES';
import { sendTbNet, TbNetName } from '../../TaoBaoNet';
import { GameOverScene } from '../GameOverScene/GameOverScene';
import { GameOverPanel } from '../../panels/GameOverPanel';
const Container = FYGE.Container const Container = FYGE.Container
const TEXT_ALIGN = FYGE.TEXT_ALIGN const TEXT_ALIGN = FYGE.TEXT_ALIGN
...@@ -95,10 +100,14 @@ export class GameScene extends MotionInitScene { ...@@ -95,10 +100,14 @@ export class GameScene extends MotionInitScene {
var cdp = this.cdp = this.addChild(new CountDownComp(GameCfg.iTime)) var cdp = this.cdp = this.addChild(new CountDownComp(GameCfg.iTime))
this.cdp.addTimeoutFunc(() => { this.cdp.addTimeoutFunc(() => {
// this.cdp.visible = false this.cdp.visible = false
// 销毁 instance
DeviceMotion.instance.destory()
//@ts-ignore //@ts-ignore
my && my.showToast({ this.onSubmit({
content: '游戏结束' id: Tools.globalData.startId,
score: this.score
}) })
}) })
cdp.position.set(layers.stageCenterX - 105, layers.stageOffsetY + 260) cdp.position.set(layers.stageCenterX - 105, layers.stageOffsetY + 260)
...@@ -118,6 +127,28 @@ export class GameScene extends MotionInitScene { ...@@ -118,6 +127,28 @@ export class GameScene extends MotionInitScene {
})) }))
} }
async onSubmit(params) {
const {data, success} = await sendTbNet(TbNetName.submitGame, params)
if (success) {
const {score, isNewRecord, productLink, isWinPrize} = data
if (isWinPrize) {
showPanel(GameOverPanel, {
score,
isNewRecord,
productLink,
isWinPrize
})
} else {
changeScene(GameOverScene, {
score,
isNewRecord,
productLink,
isWinPrize
})
}
}
}
shoot() { shoot() {
this.cdp.stop() this.cdp.stop()
} }
...@@ -216,11 +247,11 @@ export class GameEle extends Container { ...@@ -216,11 +247,11 @@ export class GameEle extends Container {
} }
initEvents() { initEvents() {
deviceMotionSubs.notify(this.orientationChange, this) DeviceMotion.instance.notify(this.orientationChange, this)
} }
removeEvents() { removeEvents() {
deviceMotionSubs.off(this.orientationChange) DeviceMotion.instance.off(this.orientationChange)
} }
destroy() { destroy() {
...@@ -281,7 +312,7 @@ export class GameEle extends Container { ...@@ -281,7 +312,7 @@ export class GameEle extends Container {
// this.vy =0 // this.vy =0
// } // }
var sw = this.sprite.width / 4 var sw = this.sprite.width / 2
if (this.x > layers.stageWidth + layers.stageOffsetX - sw) { if (this.x > layers.stageWidth + layers.stageOffsetX - sw) {
this.x = layers.stageWidth + layers.stageOffsetX - sw this.x = layers.stageWidth + layers.stageOffsetX - sw
this.vx = 0 this.vx = 0
...@@ -290,7 +321,7 @@ export class GameEle extends Container { ...@@ -290,7 +321,7 @@ export class GameEle extends Container {
this.vx = 0 this.vx = 0
} }
var sh = this.sprite.height / 4 var sh = this.sprite.height / 2
if (this.y > layers.stageHeight + layers.stageOffsetY - sh) { if (this.y > layers.stageHeight + layers.stageOffsetY - sh) {
this.y = layers.stageHeight + layers.stageOffsetY - sh this.y = layers.stageHeight + layers.stageOffsetY - sh
this.vy = 0 this.vy = 0
......
...@@ -7,7 +7,7 @@ import { GDispatcher } from "../../Main" ...@@ -7,7 +7,7 @@ import { GDispatcher } from "../../Main"
import { Tools } from "../../Tools" import { Tools } from "../../Tools"
import UI from "../../UI" import UI from "../../UI"
import { setCenterPos } from "../../utils/utils" import { setCenterPos } from "../../utils/utils"
import deviceMotionSubs from "./DeviceMotion" import DeviceMotion from "./DeviceMotion"
import { GameCfg } from "./GameConfig" import { GameCfg } from "./GameConfig"
const Container = FYGE.Container const Container = FYGE.Container
const TEXT_ALIGN = FYGE.TEXT_ALIGN const TEXT_ALIGN = FYGE.TEXT_ALIGN
...@@ -73,12 +73,12 @@ export class MotionInitFunc extends Container { ...@@ -73,12 +73,12 @@ export class MotionInitFunc extends Container {
showGuidance() { showGuidance() {
this.maskCont.visible = true this.maskCont.visible = true
deviceMotionSubs.notify(this.deviceOritationChange, this) DeviceMotion.instance.notify(this.deviceOritationChange, this)
} }
hideGuidance() { hideGuidance() {
this.maskCont.visible = false this.maskCont.visible = false
deviceMotionSubs.off(this.deviceOritationChange) DeviceMotion.instance.off(this.deviceOritationChange)
} }
timer timer
......
...@@ -4,6 +4,7 @@ import { GameEle, GameScene } from "../GameScene/GameScene" ...@@ -4,6 +4,7 @@ import { GameEle, GameScene } from "../GameScene/GameScene"
import { MotionInitScene } from '../GameScene/MotionInit'; import { MotionInitScene } from '../GameScene/MotionInit';
import UI from '../../UI'; import UI from '../../UI';
import { RES } from '../../../module/RES'; import { RES } from '../../../module/RES';
import { sendTbNet, TbNetName } from '../../TaoBaoNet';
export function setCenterPos(cont: FYGE.Sprite) { export function setCenterPos(cont: FYGE.Sprite) {
cont.anchorTexture.set(0.5, 0.5) cont.anchorTexture.set(0.5, 0.5)
...@@ -37,8 +38,9 @@ export class NewGuyScene extends MotionInitScene { ...@@ -37,8 +38,9 @@ export class NewGuyScene extends MotionInitScene {
this.g1 = UI.Sp(this, 'guidance-t1.png', layers.stageCenterX, layers.stageCenterY + 400) this.g1 = UI.Sp(this, 'guidance-t1.png', layers.stageCenterX, layers.stageCenterY + 400)
this.g1.anchorTexture.set(0.5, 0.5) this.g1.anchorTexture.set(0.5, 0.5)
var e = this.addChild(new GameEle('p1.png', this.centerp, () => { var e = this.addChild(new GameEle('p1.png', this.centerp, async () => {
changeScene(GameScene) const {success} = await sendTbNet(TbNetName.complteGuidance)
success && changeScene(GameScene)
})) }))
} }
......
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