modern-canvas 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1308,10 +1308,10 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
1308
1308
  pixelRatio: number;
1309
1309
  protected _isPowerOfTwo: boolean;
1310
1310
  protected _needsUpload: boolean;
1311
- get valid(): boolean;
1312
1311
  get realWidth(): number;
1313
1312
  get realHeight(): number;
1314
1313
  constructor(source: T);
1314
+ isValid(): boolean;
1315
1315
  /** @internal */
1316
1316
  _glTextureOptions(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): WebGLTextureOptions;
1317
1317
  /** @internal */
@@ -1707,7 +1707,6 @@ declare class Node extends CoreObject {
1707
1707
  getWindow(): Window | undefined;
1708
1708
  isInsideTree(): boolean;
1709
1709
  setTree(tree: SceneTree | undefined): this;
1710
- log(...args: any[]): void;
1711
1710
  /** Parent */
1712
1711
  protected _parent?: Node;
1713
1712
  get parent(): Node | undefined;
@@ -1756,9 +1755,9 @@ declare class Node extends CoreObject {
1756
1755
  removeChild<T extends Node>(child: T): T;
1757
1756
  removeChildren(): void;
1758
1757
  remove(): void;
1759
- forEachChild(callbackfn: (value: Node, index: number, array: Node[]) => void): this;
1760
- forEachDescendant(callbackfn: (descendant: Node) => void): this;
1761
- forEachAncestor(callbackfn: (ancestor: Node) => void): this;
1758
+ findOne<T extends Node = Node>(callbackfn: (value: Node) => boolean): T | undefined;
1759
+ findAll<T extends Node = Node>(callbackfn: (value: Node) => boolean): T[];
1760
+ findAncestor<T extends Node = Node>(callbackfn: (value: Node) => Node | undefined): T | undefined;
1762
1761
  /** override */
1763
1762
  protected _ready(): void;
1764
1763
  protected _treeEnter(tree: SceneTree): void;
@@ -1775,6 +1774,7 @@ declare class Node extends CoreObject {
1775
1774
  }
1776
1775
 
1777
1776
  interface TimelineNodeProperties extends NodeProperties {
1777
+ loop: boolean;
1778
1778
  delay: number;
1779
1779
  duration: number;
1780
1780
  paused: boolean;
@@ -1789,6 +1789,7 @@ interface TimelineNode {
1789
1789
  emit: <K extends keyof TimelineNodeEvents & string>(event: K, ...args: TimelineNodeEvents[K]) => this;
1790
1790
  }
1791
1791
  declare class TimelineNode extends Node {
1792
+ loop: boolean;
1792
1793
  delay: number;
1793
1794
  duration: number;
1794
1795
  paused: boolean;
@@ -2021,7 +2022,7 @@ declare class BaseElement2DFill extends CoreObject {
2021
2022
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2022
2023
  loadTexture(): Promise<void>;
2023
2024
  protected _updateTexture(): Promise<void>;
2024
- canDraw(): boolean;
2025
+ isValid(): boolean;
2025
2026
  draw(): void;
2026
2027
  protected _getFrameCurrentTime(): number;
2027
2028
  updateFrameIndex(): this;
@@ -2047,7 +2048,7 @@ declare class BaseElement2DOutline extends BaseElement2DFill {
2047
2048
  lineJoin: NormalizedOutline['lineJoin'];
2048
2049
  setProperties(properties?: Outline): this;
2049
2050
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2050
- canDraw(): boolean;
2051
+ isValid(): boolean;
2051
2052
  draw(): void;
2052
2053
  }
2053
2054
 
@@ -2076,8 +2077,8 @@ declare class BaseElement2DShape extends CoreObject {
2076
2077
  setProperties(properties?: Shape): this;
2077
2078
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2078
2079
  protected _updatePath2DSet(): void;
2079
- draw(): void;
2080
- drawRect(): void;
2080
+ draw(rect?: boolean): void;
2081
+ protected _drawRect(): void;
2081
2082
  }
2082
2083
 
2083
2084
  interface BaseElement2DStyleProperties extends Omit<FullStyle, 'left' | 'top' | 'width' | 'height'> {
@@ -2104,6 +2105,7 @@ declare class BaseElement2DText extends CoreObject {
2104
2105
  fonts: Text['fonts'];
2105
2106
  readonly base: Text;
2106
2107
  measureResult?: MeasureResult;
2108
+ protected _texture: CanvasTexture;
2107
2109
  protected _textureMap: Map<string, {
2108
2110
  texture: Texture2D | undefined;
2109
2111
  box: any;
@@ -2111,15 +2113,18 @@ declare class BaseElement2DText extends CoreObject {
2111
2113
  constructor(parent: BaseElement2D);
2112
2114
  setProperties(properties?: Text$1): this;
2113
2115
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2114
- protected _updateBase(): void;
2116
+ update(): void;
2115
2117
  protected _updateTextureMap(): void;
2116
2118
  protected _updateTexture(key: string, fill: NormalizedFill | undefined, box: any): Promise<void>;
2117
2119
  protected _loadTexture(fill: NormalizedFill, box: any): Promise<Texture2D | undefined>;
2118
2120
  setContent(content: TextContent): void;
2119
2121
  measure(): MeasureResult;
2120
2122
  updateMeasure(): this;
2121
- canDraw(): boolean;
2122
- protected _getVertTransform(): Transform2D | undefined;
2123
+ isValid(): boolean;
2124
+ protected _createVertTransform(): Transform2D | undefined;
2125
+ protected _useDrawByTexture(): boolean;
2126
+ protected _drawByVertices(ctx: CanvasContext): void;
2127
+ protected _drawByTexture(ctx: CanvasContext): void;
2123
2128
  draw(): void;
2124
2129
  }
2125
2130
 
@@ -2475,7 +2480,6 @@ interface AnimationProperties extends Omit<TimelineNodeProperties, 'renderMode'
2475
2480
  }
2476
2481
  declare class Animation extends TimelineNode {
2477
2482
  effectMode: AnimationEffectMode;
2478
- loop: boolean;
2479
2483
  keyframes: Keyframe[];
2480
2484
  easing: Easing | undefined;
2481
2485
  protected _keyframes: NormalizedKeyframe[];
@@ -2892,8 +2896,8 @@ declare class ColorReplaceEffect extends Effect {
2892
2896
 
2893
2897
  interface DrawboardEffectProperties extends EffectProperties {
2894
2898
  checkerboard?: boolean;
2899
+ checkerboardScale?: number;
2895
2900
  pixelGrid?: boolean;
2896
- pixelGridData?: [number, number];
2897
2901
  }
2898
2902
  declare class DrawboardEffect extends Effect {
2899
2903
  static material: Material;
@@ -3086,34 +3090,6 @@ declare class ZoomBlurEffect extends Effect {
3086
3090
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3087
3091
  }
3088
3092
 
3089
- interface ScalerEvents extends NodeEvents {
3090
- updateScale: (scale: number) => void;
3091
- }
3092
- interface ScalerProperties extends NodeProperties {
3093
- scale: number;
3094
- minScale: number;
3095
- maxScale: number;
3096
- }
3097
- interface Scaler {
3098
- on: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3099
- once: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3100
- off: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3101
- emit: <K extends keyof ScalerEvents & string>(event: K, ...args: Parameters<ScalerEvents[K]>) => this;
3102
- }
3103
- declare class Scaler extends Node {
3104
- translateX: number;
3105
- translateY: number;
3106
- scale: number;
3107
- minScale: number;
3108
- maxScale: number;
3109
- get target(): Element2D | undefined;
3110
- constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
3111
- protected _updateProperty(key: string, value: any, oldValue: any): void;
3112
- protected _updateTarget(): void;
3113
- protected _onWheel(e: WheelInputEvent): void;
3114
- protected _input(event: InputEvent, key: InputEventKey): void;
3115
- }
3116
-
3117
3093
  declare class KawaseTransition extends Transition {
3118
3094
  blur: number;
3119
3095
  quality: number;
@@ -3280,5 +3256,5 @@ interface RenderOptions {
3280
3256
  }
3281
3257
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3282
3258
 
3283
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3284
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, ScalerEvents, ScalerProperties, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };
3259
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3260
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };
package/dist/index.d.mts CHANGED
@@ -1308,10 +1308,10 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
1308
1308
  pixelRatio: number;
1309
1309
  protected _isPowerOfTwo: boolean;
1310
1310
  protected _needsUpload: boolean;
1311
- get valid(): boolean;
1312
1311
  get realWidth(): number;
1313
1312
  get realHeight(): number;
1314
1313
  constructor(source: T);
1314
+ isValid(): boolean;
1315
1315
  /** @internal */
1316
1316
  _glTextureOptions(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): WebGLTextureOptions;
1317
1317
  /** @internal */
@@ -1707,7 +1707,6 @@ declare class Node extends CoreObject {
1707
1707
  getWindow(): Window | undefined;
1708
1708
  isInsideTree(): boolean;
1709
1709
  setTree(tree: SceneTree | undefined): this;
1710
- log(...args: any[]): void;
1711
1710
  /** Parent */
1712
1711
  protected _parent?: Node;
1713
1712
  get parent(): Node | undefined;
@@ -1756,9 +1755,9 @@ declare class Node extends CoreObject {
1756
1755
  removeChild<T extends Node>(child: T): T;
1757
1756
  removeChildren(): void;
1758
1757
  remove(): void;
1759
- forEachChild(callbackfn: (value: Node, index: number, array: Node[]) => void): this;
1760
- forEachDescendant(callbackfn: (descendant: Node) => void): this;
1761
- forEachAncestor(callbackfn: (ancestor: Node) => void): this;
1758
+ findOne<T extends Node = Node>(callbackfn: (value: Node) => boolean): T | undefined;
1759
+ findAll<T extends Node = Node>(callbackfn: (value: Node) => boolean): T[];
1760
+ findAncestor<T extends Node = Node>(callbackfn: (value: Node) => Node | undefined): T | undefined;
1762
1761
  /** override */
1763
1762
  protected _ready(): void;
1764
1763
  protected _treeEnter(tree: SceneTree): void;
@@ -1775,6 +1774,7 @@ declare class Node extends CoreObject {
1775
1774
  }
1776
1775
 
1777
1776
  interface TimelineNodeProperties extends NodeProperties {
1777
+ loop: boolean;
1778
1778
  delay: number;
1779
1779
  duration: number;
1780
1780
  paused: boolean;
@@ -1789,6 +1789,7 @@ interface TimelineNode {
1789
1789
  emit: <K extends keyof TimelineNodeEvents & string>(event: K, ...args: TimelineNodeEvents[K]) => this;
1790
1790
  }
1791
1791
  declare class TimelineNode extends Node {
1792
+ loop: boolean;
1792
1793
  delay: number;
1793
1794
  duration: number;
1794
1795
  paused: boolean;
@@ -2021,7 +2022,7 @@ declare class BaseElement2DFill extends CoreObject {
2021
2022
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2022
2023
  loadTexture(): Promise<void>;
2023
2024
  protected _updateTexture(): Promise<void>;
2024
- canDraw(): boolean;
2025
+ isValid(): boolean;
2025
2026
  draw(): void;
2026
2027
  protected _getFrameCurrentTime(): number;
2027
2028
  updateFrameIndex(): this;
@@ -2047,7 +2048,7 @@ declare class BaseElement2DOutline extends BaseElement2DFill {
2047
2048
  lineJoin: NormalizedOutline['lineJoin'];
2048
2049
  setProperties(properties?: Outline): this;
2049
2050
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2050
- canDraw(): boolean;
2051
+ isValid(): boolean;
2051
2052
  draw(): void;
2052
2053
  }
2053
2054
 
@@ -2076,8 +2077,8 @@ declare class BaseElement2DShape extends CoreObject {
2076
2077
  setProperties(properties?: Shape): this;
2077
2078
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2078
2079
  protected _updatePath2DSet(): void;
2079
- draw(): void;
2080
- drawRect(): void;
2080
+ draw(rect?: boolean): void;
2081
+ protected _drawRect(): void;
2081
2082
  }
2082
2083
 
2083
2084
  interface BaseElement2DStyleProperties extends Omit<FullStyle, 'left' | 'top' | 'width' | 'height'> {
@@ -2104,6 +2105,7 @@ declare class BaseElement2DText extends CoreObject {
2104
2105
  fonts: Text['fonts'];
2105
2106
  readonly base: Text;
2106
2107
  measureResult?: MeasureResult;
2108
+ protected _texture: CanvasTexture;
2107
2109
  protected _textureMap: Map<string, {
2108
2110
  texture: Texture2D | undefined;
2109
2111
  box: any;
@@ -2111,15 +2113,18 @@ declare class BaseElement2DText extends CoreObject {
2111
2113
  constructor(parent: BaseElement2D);
2112
2114
  setProperties(properties?: Text$1): this;
2113
2115
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2114
- protected _updateBase(): void;
2116
+ update(): void;
2115
2117
  protected _updateTextureMap(): void;
2116
2118
  protected _updateTexture(key: string, fill: NormalizedFill | undefined, box: any): Promise<void>;
2117
2119
  protected _loadTexture(fill: NormalizedFill, box: any): Promise<Texture2D | undefined>;
2118
2120
  setContent(content: TextContent): void;
2119
2121
  measure(): MeasureResult;
2120
2122
  updateMeasure(): this;
2121
- canDraw(): boolean;
2122
- protected _getVertTransform(): Transform2D | undefined;
2123
+ isValid(): boolean;
2124
+ protected _createVertTransform(): Transform2D | undefined;
2125
+ protected _useDrawByTexture(): boolean;
2126
+ protected _drawByVertices(ctx: CanvasContext): void;
2127
+ protected _drawByTexture(ctx: CanvasContext): void;
2123
2128
  draw(): void;
2124
2129
  }
2125
2130
 
@@ -2475,7 +2480,6 @@ interface AnimationProperties extends Omit<TimelineNodeProperties, 'renderMode'
2475
2480
  }
2476
2481
  declare class Animation extends TimelineNode {
2477
2482
  effectMode: AnimationEffectMode;
2478
- loop: boolean;
2479
2483
  keyframes: Keyframe[];
2480
2484
  easing: Easing | undefined;
2481
2485
  protected _keyframes: NormalizedKeyframe[];
@@ -2892,8 +2896,8 @@ declare class ColorReplaceEffect extends Effect {
2892
2896
 
2893
2897
  interface DrawboardEffectProperties extends EffectProperties {
2894
2898
  checkerboard?: boolean;
2899
+ checkerboardScale?: number;
2895
2900
  pixelGrid?: boolean;
2896
- pixelGridData?: [number, number];
2897
2901
  }
2898
2902
  declare class DrawboardEffect extends Effect {
2899
2903
  static material: Material;
@@ -3086,34 +3090,6 @@ declare class ZoomBlurEffect extends Effect {
3086
3090
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3087
3091
  }
3088
3092
 
3089
- interface ScalerEvents extends NodeEvents {
3090
- updateScale: (scale: number) => void;
3091
- }
3092
- interface ScalerProperties extends NodeProperties {
3093
- scale: number;
3094
- minScale: number;
3095
- maxScale: number;
3096
- }
3097
- interface Scaler {
3098
- on: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3099
- once: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3100
- off: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3101
- emit: <K extends keyof ScalerEvents & string>(event: K, ...args: Parameters<ScalerEvents[K]>) => this;
3102
- }
3103
- declare class Scaler extends Node {
3104
- translateX: number;
3105
- translateY: number;
3106
- scale: number;
3107
- minScale: number;
3108
- maxScale: number;
3109
- get target(): Element2D | undefined;
3110
- constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
3111
- protected _updateProperty(key: string, value: any, oldValue: any): void;
3112
- protected _updateTarget(): void;
3113
- protected _onWheel(e: WheelInputEvent): void;
3114
- protected _input(event: InputEvent, key: InputEventKey): void;
3115
- }
3116
-
3117
3093
  declare class KawaseTransition extends Transition {
3118
3094
  blur: number;
3119
3095
  quality: number;
@@ -3280,5 +3256,5 @@ interface RenderOptions {
3280
3256
  }
3281
3257
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3282
3258
 
3283
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3284
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, ScalerEvents, ScalerProperties, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };
3259
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3260
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };
package/dist/index.d.ts CHANGED
@@ -1308,10 +1308,10 @@ declare class Texture2D<T extends Texture2DSource = Texture2DSource> extends Res
1308
1308
  pixelRatio: number;
1309
1309
  protected _isPowerOfTwo: boolean;
1310
1310
  protected _needsUpload: boolean;
1311
- get valid(): boolean;
1312
1311
  get realWidth(): number;
1313
1312
  get realHeight(): number;
1314
1313
  constructor(source: T);
1314
+ isValid(): boolean;
1315
1315
  /** @internal */
1316
1316
  _glTextureOptions(renderer: WebGLRenderer, options?: Partial<WebGLTextureOptions>): WebGLTextureOptions;
1317
1317
  /** @internal */
@@ -1707,7 +1707,6 @@ declare class Node extends CoreObject {
1707
1707
  getWindow(): Window | undefined;
1708
1708
  isInsideTree(): boolean;
1709
1709
  setTree(tree: SceneTree | undefined): this;
1710
- log(...args: any[]): void;
1711
1710
  /** Parent */
1712
1711
  protected _parent?: Node;
1713
1712
  get parent(): Node | undefined;
@@ -1756,9 +1755,9 @@ declare class Node extends CoreObject {
1756
1755
  removeChild<T extends Node>(child: T): T;
1757
1756
  removeChildren(): void;
1758
1757
  remove(): void;
1759
- forEachChild(callbackfn: (value: Node, index: number, array: Node[]) => void): this;
1760
- forEachDescendant(callbackfn: (descendant: Node) => void): this;
1761
- forEachAncestor(callbackfn: (ancestor: Node) => void): this;
1758
+ findOne<T extends Node = Node>(callbackfn: (value: Node) => boolean): T | undefined;
1759
+ findAll<T extends Node = Node>(callbackfn: (value: Node) => boolean): T[];
1760
+ findAncestor<T extends Node = Node>(callbackfn: (value: Node) => Node | undefined): T | undefined;
1762
1761
  /** override */
1763
1762
  protected _ready(): void;
1764
1763
  protected _treeEnter(tree: SceneTree): void;
@@ -1775,6 +1774,7 @@ declare class Node extends CoreObject {
1775
1774
  }
1776
1775
 
1777
1776
  interface TimelineNodeProperties extends NodeProperties {
1777
+ loop: boolean;
1778
1778
  delay: number;
1779
1779
  duration: number;
1780
1780
  paused: boolean;
@@ -1789,6 +1789,7 @@ interface TimelineNode {
1789
1789
  emit: <K extends keyof TimelineNodeEvents & string>(event: K, ...args: TimelineNodeEvents[K]) => this;
1790
1790
  }
1791
1791
  declare class TimelineNode extends Node {
1792
+ loop: boolean;
1792
1793
  delay: number;
1793
1794
  duration: number;
1794
1795
  paused: boolean;
@@ -2021,7 +2022,7 @@ declare class BaseElement2DFill extends CoreObject {
2021
2022
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2022
2023
  loadTexture(): Promise<void>;
2023
2024
  protected _updateTexture(): Promise<void>;
2024
- canDraw(): boolean;
2025
+ isValid(): boolean;
2025
2026
  draw(): void;
2026
2027
  protected _getFrameCurrentTime(): number;
2027
2028
  updateFrameIndex(): this;
@@ -2047,7 +2048,7 @@ declare class BaseElement2DOutline extends BaseElement2DFill {
2047
2048
  lineJoin: NormalizedOutline['lineJoin'];
2048
2049
  setProperties(properties?: Outline): this;
2049
2050
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2050
- canDraw(): boolean;
2051
+ isValid(): boolean;
2051
2052
  draw(): void;
2052
2053
  }
2053
2054
 
@@ -2076,8 +2077,8 @@ declare class BaseElement2DShape extends CoreObject {
2076
2077
  setProperties(properties?: Shape): this;
2077
2078
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2078
2079
  protected _updatePath2DSet(): void;
2079
- draw(): void;
2080
- drawRect(): void;
2080
+ draw(rect?: boolean): void;
2081
+ protected _drawRect(): void;
2081
2082
  }
2082
2083
 
2083
2084
  interface BaseElement2DStyleProperties extends Omit<FullStyle, 'left' | 'top' | 'width' | 'height'> {
@@ -2104,6 +2105,7 @@ declare class BaseElement2DText extends CoreObject {
2104
2105
  fonts: Text['fonts'];
2105
2106
  readonly base: Text;
2106
2107
  measureResult?: MeasureResult;
2108
+ protected _texture: CanvasTexture;
2107
2109
  protected _textureMap: Map<string, {
2108
2110
  texture: Texture2D | undefined;
2109
2111
  box: any;
@@ -2111,15 +2113,18 @@ declare class BaseElement2DText extends CoreObject {
2111
2113
  constructor(parent: BaseElement2D);
2112
2114
  setProperties(properties?: Text$1): this;
2113
2115
  protected _updateProperty(key: string, value: any, oldValue: any): void;
2114
- protected _updateBase(): void;
2116
+ update(): void;
2115
2117
  protected _updateTextureMap(): void;
2116
2118
  protected _updateTexture(key: string, fill: NormalizedFill | undefined, box: any): Promise<void>;
2117
2119
  protected _loadTexture(fill: NormalizedFill, box: any): Promise<Texture2D | undefined>;
2118
2120
  setContent(content: TextContent): void;
2119
2121
  measure(): MeasureResult;
2120
2122
  updateMeasure(): this;
2121
- canDraw(): boolean;
2122
- protected _getVertTransform(): Transform2D | undefined;
2123
+ isValid(): boolean;
2124
+ protected _createVertTransform(): Transform2D | undefined;
2125
+ protected _useDrawByTexture(): boolean;
2126
+ protected _drawByVertices(ctx: CanvasContext): void;
2127
+ protected _drawByTexture(ctx: CanvasContext): void;
2123
2128
  draw(): void;
2124
2129
  }
2125
2130
 
@@ -2475,7 +2480,6 @@ interface AnimationProperties extends Omit<TimelineNodeProperties, 'renderMode'
2475
2480
  }
2476
2481
  declare class Animation extends TimelineNode {
2477
2482
  effectMode: AnimationEffectMode;
2478
- loop: boolean;
2479
2483
  keyframes: Keyframe[];
2480
2484
  easing: Easing | undefined;
2481
2485
  protected _keyframes: NormalizedKeyframe[];
@@ -2892,8 +2896,8 @@ declare class ColorReplaceEffect extends Effect {
2892
2896
 
2893
2897
  interface DrawboardEffectProperties extends EffectProperties {
2894
2898
  checkerboard?: boolean;
2899
+ checkerboardScale?: number;
2895
2900
  pixelGrid?: boolean;
2896
- pixelGridData?: [number, number];
2897
2901
  }
2898
2902
  declare class DrawboardEffect extends Effect {
2899
2903
  static material: Material;
@@ -3086,34 +3090,6 @@ declare class ZoomBlurEffect extends Effect {
3086
3090
  apply(renderer: WebGLRenderer, source: Viewport, context: EffectContext): void;
3087
3091
  }
3088
3092
 
3089
- interface ScalerEvents extends NodeEvents {
3090
- updateScale: (scale: number) => void;
3091
- }
3092
- interface ScalerProperties extends NodeProperties {
3093
- scale: number;
3094
- minScale: number;
3095
- maxScale: number;
3096
- }
3097
- interface Scaler {
3098
- on: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3099
- once: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3100
- off: <K extends keyof ScalerEvents & string>(event: K, listener: ScalerEvents[K]) => this;
3101
- emit: <K extends keyof ScalerEvents & string>(event: K, ...args: Parameters<ScalerEvents[K]>) => this;
3102
- }
3103
- declare class Scaler extends Node {
3104
- translateX: number;
3105
- translateY: number;
3106
- scale: number;
3107
- minScale: number;
3108
- maxScale: number;
3109
- get target(): Element2D | undefined;
3110
- constructor(properties?: Partial<ScalerProperties>, children?: Node[]);
3111
- protected _updateProperty(key: string, value: any, oldValue: any): void;
3112
- protected _updateTarget(): void;
3113
- protected _onWheel(e: WheelInputEvent): void;
3114
- protected _input(event: InputEvent, key: InputEventKey): void;
3115
- }
3116
-
3117
3093
  declare class KawaseTransition extends Transition {
3118
3094
  blur: number;
3119
3095
  quality: number;
@@ -3280,5 +3256,5 @@ interface RenderOptions {
3280
3256
  }
3281
3257
  declare function render(options: RenderOptions): Promise<HTMLCanvasElement>;
3282
3258
 
3283
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3284
- export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, ScalerEvents, ScalerProperties, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };
3259
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
3260
+ export type { AnimationEffectMode, AnimationProperties, AssetHandler, AudioWaveformProperties, BaseElement2DEvents, BaseElement2DProperties, BaseElement2DStyleProperties, Batchable2D, CSSFilterKey, CSSFilters, Camera2DEvents, Camera2DProperties, CanvasBatchable, CanvasItemEvents, CanvasItemProperties, ColorAdjustEffectProperties, ColorFilterEffectProperties, ColorOverlayEffectProperties, ColorRemoveEffectProperties, ColorReplaceEffectProperties, ComputedLayout, CoreObjectEvents, CssFunction, CssFunctionArg, Cursor, DrawboardEffectProperties, DropShadowEffectProperties, Easing, EffectContext, EffectMode, EffectProperties, Element2DEvents, Element2DProperties, Element2DStyleProperties, EmbossEffectProperties, EngineProperties, FillDraw, FlexBaseElement2DEvents, FlexElement2DProperties, FlexElement2DStyleProperties, GaussianBlurEffectProperties, GeometryOptions, GlitchEffectProperties, GodrayEffectProperties, IAudioContext, IAudioNode, IPlayOptions, Image2DProperties, ImageFrame, ImageTextureOptions, IndexBufferOptions, InputEventKey, InputEvents, InputMode, InternalMode, KawaseBlurEffectProperties, Keyframe, Lottie2DProperties, MainLoopEvents, MainLoopProperties, MaskColor, MaskData, MaskEffectProperties, MaskObject, MaskRect, Maskable, MaterialOptions, MatrixLike, MatrixOperateOutput, Node2DEvents, Node2DProperties, NodeEvents, NodeProperties, NormalizedKeyframe, OutlineEffectProperties, PixelateEffectProperties, PlatformAudio, PlatformSound, ProcessMode, ProcessSortMode, Rectangulable, RectangulableEvents, RefCountedEvents, RenderMode, RenderOptions, Renderable, ResourceEvents, SceneTreeEvents, SceneTreeProperties, StrokeDraw, Texture2DFilterMode, Texture2DPixelsSource, Texture2DSource, Texture2DWrapMode, TextureRect2DProperties, TimelineEvents, TimelineNodeEvents, TimelineNodeProperties, TimelineProperties, TimingFunctions, TransformObject, TransformRect2DProperties, TransformableObject, TransitionProperties, Vector2Data, VectorLike, VectorOperateOutput, VertexAttributeOptions, VertexBufferOptions, Video2DProperties, VideoTextureOptions, VideoTextureSource, ViewportEvents, ViewportFramebuffer, WebGLBufferMeta, WebGLBufferOptions, WebGLBufferTarget, WebGLBufferUsage, WebGLDrawMode, WebGLDrawOptions, WebGLExtensions, WebGLFramebufferMeta, WebGLFramebufferOptions, WebGLProgramMeta, WebGLProgramOptions, WebGLTarget, WebGLTextureFilterMode, WebGLTextureLocation, WebGLTextureMeta, WebGLTextureOptions, WebGLTextureSource, WebGLTextureTarget, WebGLTextureWrapMode, WebGLVertexArrayObjectMeta, WebGLVertexArrayObjectOptions, WebGLVertexAttrib, WebGLVertexAttribType, WebGLViewport, ZoomBlurEffectProperties };