@flare-engine/render 0.3.1 → 0.4.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.mts +99 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +99 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +152 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -441,6 +441,16 @@ declare function updateEffect(effect: AnySpriteEffect, dt: number): AnySpriteEff
|
|
|
441
441
|
declare function flashIntensity(effect: FlashEffect): number;
|
|
442
442
|
//#endregion
|
|
443
443
|
//#region src/sprite-batch.d.ts
|
|
444
|
+
/**
|
|
445
|
+
* Axis-aligned bounds used for viewport culling in the batch.
|
|
446
|
+
* All coordinates are in the same space as the sprite destination rects.
|
|
447
|
+
*/
|
|
448
|
+
interface BatchCullBounds {
|
|
449
|
+
readonly minX: number;
|
|
450
|
+
readonly minY: number;
|
|
451
|
+
readonly maxX: number;
|
|
452
|
+
readonly maxY: number;
|
|
453
|
+
}
|
|
444
454
|
/** A single sprite draw request in the batch. */
|
|
445
455
|
interface SpriteDrawCommand {
|
|
446
456
|
/** Texture (Skia SkImage). */
|
|
@@ -484,6 +494,27 @@ interface SpriteDrawCommand {
|
|
|
484
494
|
* Combine with a zero rotation only.
|
|
485
495
|
*/
|
|
486
496
|
stretch: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Blend mode for this batch run. Participates in the batch key — sprites
|
|
499
|
+
* with different blend modes are placed in separate runs.
|
|
500
|
+
* `'normal'` (default): standard alpha-over (SrcOver).
|
|
501
|
+
* `'additive'`: destination pixel receives `src + dst` (Skia Plus mode) —
|
|
502
|
+
* useful for particle add-ons, glows, and projectile trails.
|
|
503
|
+
*/
|
|
504
|
+
blend: 'normal' | 'additive';
|
|
505
|
+
/**
|
|
506
|
+
* Mirror the sprite horizontally about its center.
|
|
507
|
+
* Participates in the batch key. Flipped sprites are drawn via
|
|
508
|
+
* `drawImageRect` with a canvas scale(-1, 1) transform — one draw call
|
|
509
|
+
* per sprite (per-sprite draw call trade-off, documented).
|
|
510
|
+
* Unsupported in combination with rotation (same constraint as stretch mode).
|
|
511
|
+
*/
|
|
512
|
+
flipX: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* Mirror the sprite vertically about its center.
|
|
515
|
+
* Same trade-offs as flipX; the two may be combined freely.
|
|
516
|
+
*/
|
|
517
|
+
flipY: boolean;
|
|
487
518
|
}
|
|
488
519
|
/**
|
|
489
520
|
* SpriteBatch — collects sprite draw commands and groups them by texture
|
|
@@ -505,11 +536,23 @@ declare class SpriteBatch {
|
|
|
505
536
|
private _pool;
|
|
506
537
|
private _batches;
|
|
507
538
|
private _allocCount;
|
|
539
|
+
private _cull;
|
|
508
540
|
/** Number of queued draw commands. */
|
|
509
541
|
get count(): number;
|
|
510
542
|
/** Cumulative number of SpriteDrawCommand objects allocated because the internal
|
|
511
543
|
* command pool was empty. Steady state should be 0 after warm-up. */
|
|
512
544
|
get allocCount(): number;
|
|
545
|
+
/**
|
|
546
|
+
* Current cull bounds, or `null` when culling is disabled.
|
|
547
|
+
* Read by `drawNineSlice` for coarse AABB precheck.
|
|
548
|
+
* Set via `setCullBounds()` / `clearCullBounds()`.
|
|
549
|
+
*/
|
|
550
|
+
get cullBounds(): BatchCullBounds | null;
|
|
551
|
+
/** Set the viewport cull bounds for this batch.
|
|
552
|
+
* Zero-alloc in steady state — the internal object is allocated once and then mutated. */
|
|
553
|
+
setCullBounds(minX: number, minY: number, maxX: number, maxY: number): void;
|
|
554
|
+
/** Disable viewport culling (e.g. during UI rendering). */
|
|
555
|
+
clearCullBounds(): void;
|
|
513
556
|
/** Queue a sprite draw from a frame.
|
|
514
557
|
*
|
|
515
558
|
* `anchorX` / `anchorY` define the pivot point of the sprite as a
|
|
@@ -518,12 +561,12 @@ declare class SpriteBatch {
|
|
|
518
561
|
* then refer to the anchor point instead of the top-left corner.
|
|
519
562
|
*
|
|
520
563
|
* `alpha` is a per-instance opacity multiplier in [0, 1]. Default 1. */
|
|
521
|
-
draw(image: SkImageLike, frame: SpriteFrame, dstX: number, dstY: number, dstW?: number, dstH?: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean): void;
|
|
564
|
+
draw(image: SkImageLike, frame: SpriteFrame, dstX: number, dstY: number, dstW?: number, dstH?: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean, blend?: 'normal' | 'additive', flipX?: boolean, flipY?: boolean): void;
|
|
522
565
|
/** Queue a raw sprite draw with explicit src/dst rects. `dstX` / `dstY`
|
|
523
566
|
* refer to the anchor point — offset by `anchorX * dstW` / `anchorY * dstH`.
|
|
524
567
|
*
|
|
525
568
|
* `alpha` is a per-instance opacity multiplier in [0, 1]. Default 1. */
|
|
526
|
-
drawRaw(image: SkImageLike, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean): void;
|
|
569
|
+
drawRaw(image: SkImageLike, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean, blend?: 'normal' | 'additive', flipX?: boolean, flipY?: boolean): void;
|
|
527
570
|
/**
|
|
528
571
|
* Flush all queued commands in insertion order, grouping maximal consecutive
|
|
529
572
|
* runs that share the same `(image, effect, alpha, stretch)` key into a
|
|
@@ -543,8 +586,6 @@ declare class SpriteBatch {
|
|
|
543
586
|
}
|
|
544
587
|
//#endregion
|
|
545
588
|
//#region src/frame-renderer.d.ts
|
|
546
|
-
/** A 4-float RGBA color buffer (r, g, b, a in [0, 1]). */
|
|
547
|
-
type ColorLike = Float32Array;
|
|
548
589
|
/**
|
|
549
590
|
* A mutable axis-aligned rect.
|
|
550
591
|
*
|
|
@@ -605,6 +646,12 @@ interface PaintLike {
|
|
|
605
646
|
setColorFilter(filter: unknown): void;
|
|
606
647
|
setShader(shader: unknown): void;
|
|
607
648
|
setImageFilter(filter: unknown): void;
|
|
649
|
+
/**
|
|
650
|
+
* Set the Skia BlendMode on this paint.
|
|
651
|
+
* Optional — absent on mocks and some test stubs; the renderer silently
|
|
652
|
+
* falls back to SrcOver (the Skia default) when the method is missing.
|
|
653
|
+
*/
|
|
654
|
+
setBlendMode?(mode: number): void;
|
|
608
655
|
}
|
|
609
656
|
/** Minimal draw surface the frame-renderer calls into. */
|
|
610
657
|
interface DrawSurfaceLike {
|
|
@@ -730,6 +777,40 @@ declare function getXformCounters(): {
|
|
|
730
777
|
unrotated: number;
|
|
731
778
|
};
|
|
732
779
|
//#endregion
|
|
780
|
+
//#region src/nine-slice.d.ts
|
|
781
|
+
/**
|
|
782
|
+
* Draw a sprite using a 9-slice (scale-9) layout.
|
|
783
|
+
*
|
|
784
|
+
* The source frame is divided into a 3×3 grid by `inset` pixels from each
|
|
785
|
+
* edge. Corners draw at natural size; edges stretch along one axis; the
|
|
786
|
+
* centre stretches in both axes. This preserves crisp borders at any
|
|
787
|
+
* destination size — the canonical use case is UI panels and buttons.
|
|
788
|
+
*
|
|
789
|
+
* All 9 slices use the `drawImageRect` (`stretch=true`) path, so they are
|
|
790
|
+
* NOT batched with regular Atlas sprites; they form their own consecutive run
|
|
791
|
+
* in the batch. The function calls `batch.drawRaw()` for each non-degenerate
|
|
792
|
+
* slice (a slice with zero source or destination area is skipped silently).
|
|
793
|
+
*
|
|
794
|
+
* **Coarse culling:** if `batch.cullBounds` is set, the entire nine-slice is
|
|
795
|
+
* skipped when the destination rectangle `[x, y, x+w, y+h]` does not
|
|
796
|
+
* intersect the bounds. Individual slice culling is not performed — the
|
|
797
|
+
* caller should set tight bounds if per-slice savings matter.
|
|
798
|
+
*
|
|
799
|
+
* @param batch Target SpriteBatch — must outlive this call.
|
|
800
|
+
* @param image Source texture.
|
|
801
|
+
* @param frame Sub-region of the texture to use as the nine-slice source.
|
|
802
|
+
* @param x Destination left edge (screen / world coords).
|
|
803
|
+
* @param y Destination top edge.
|
|
804
|
+
* @param w Destination width.
|
|
805
|
+
* @param h Destination height.
|
|
806
|
+
* @param inset Border size in source-texture pixels, applied uniformly to
|
|
807
|
+
* all four edges. Must be ≥ 0; clamped to half the frame
|
|
808
|
+
* dimension so corners never overlap.
|
|
809
|
+
* @param effect Optional sprite effect applied to every slice identically.
|
|
810
|
+
* @param alpha Per-instance opacity multiplier in [0, 1]. Default 1.
|
|
811
|
+
*/
|
|
812
|
+
declare function drawNineSlice(batch: SpriteBatch, image: SkImageLike, frame: SpriteFrame, x: number, y: number, w: number, h: number, inset: number, effect?: AnySpriteEffect, alpha?: number): void;
|
|
813
|
+
//#endregion
|
|
733
814
|
//#region src/render-system.d.ts
|
|
734
815
|
/** Position component data expected by the render system. */
|
|
735
816
|
interface PositionData {
|
|
@@ -776,6 +857,19 @@ interface SpriteData {
|
|
|
776
857
|
* Rotation is unsupported in stretch mode — combine only with `rotation = 0`.
|
|
777
858
|
*/
|
|
778
859
|
stretch?: boolean;
|
|
860
|
+
/**
|
|
861
|
+
* Blend mode for this sprite.
|
|
862
|
+
* `'normal'` (default): standard alpha-over blending.
|
|
863
|
+
* `'additive'`: src + dst pixel colours — glows, particles, bullet trails.
|
|
864
|
+
* Sprites with different blend modes are placed in separate batch runs.
|
|
865
|
+
*/
|
|
866
|
+
blend?: 'normal' | 'additive';
|
|
867
|
+
/** Mirror the sprite horizontally. Default false.
|
|
868
|
+
* Routes through the `drawImageRect` path — per-sprite draw call trade-off.
|
|
869
|
+
* Unsupported with rotation; combine only with `rotation = 0`. */
|
|
870
|
+
flipX?: boolean;
|
|
871
|
+
/** Mirror the sprite vertically. Default false. Same trade-offs as flipX. */
|
|
872
|
+
flipY?: boolean;
|
|
779
873
|
}
|
|
780
874
|
/**
|
|
781
875
|
* Create a render system function.
|
|
@@ -857,5 +951,5 @@ declare function measureText(font: BitmapFont, text: string): number;
|
|
|
857
951
|
*/
|
|
858
952
|
declare function drawText(batch: SpriteBatch, font: BitmapFont, image: SkImageLike, text: string, x: number, y: number, scale?: number): void;
|
|
859
953
|
//#endregion
|
|
860
|
-
export { type AnySpriteEffect, type BitmapFont, CAVE_INTERIOR_SKSL, Camera2D, type CanvasLike, type CaveInteriorEffect, type ColorFilterFactoryLike, type
|
|
954
|
+
export { type AnySpriteEffect, type BatchCullBounds, type BitmapFont, CAVE_INTERIOR_SKSL, Camera2D, type CanvasLike, type CaveInteriorEffect, type ColorFilterFactoryLike, type CompiledShader, type CustomShaderEffect, type DrawSurfaceLike, type Drawable, type DropShadowEffect, FIRE_SKSL, FOG_SKSL, FOREST_CANOPY_SKSL, type FireEffect, type FlashEffect, type FogEffect, type FollowOptions, type ForestCanopyEffect, type FrameRenderer, type FrameRendererCompiledPass, type FrameRendererModule, type FrameRendererPostFxChain, type FrameRendererPostFxDescriptor, type FrameRendererPostFxRuntime, type Glyph, type GrayscaleEffect, type ImageFilterFactoryLike, type KerningPair, MOON_CRATER_SKSL, MOUNTAIN_HILLS_SKSL, type MoonCraterEffect, type MountainHillsEffect, type OutlineEffect, type PaintLike, type PictureLike, type PictureRecorderLike, type PositionData, RIVER_WAVE_SKSL, ROOFS_CITY_SKSL, type RSXformLike, type RectLike, type RenderStats, Renderer, type RiverWaveEffect, type RoofsCityEffect, type RuntimeEffectFactoryLike, type RuntimeEffectLike, type ShaderUniforms, Sprite, type SpriteAnchor, SpriteBatch, type SpriteColor, type SpriteData, type SpriteDrawCommand, type SpriteEffect, type TintEffect, WATER_SKSL, type WaterEffect, caveInterior, createFrameRenderer, createRenderSystem, custom, drawNineSlice, drawOrderCompare, drawText, dropShadow, fire, flash, flashIntensity, fog, forestCanopy, getKerning, getXformCounters, grayscale, measureText, moonCrater, mountainHills, outline, parseBMFontJSON, resetXformCounters, riverWave, roofsCity, sortByDrawOrder, tint, updateEffect, water };
|
|
861
955
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/camera2d.ts","../src/draw-order.ts","../src/renderer.ts","../src/sprite-effects.ts","../src/sprite-batch.ts","../src/frame-renderer.ts","../src/render-system.ts","../src/shaders.ts","../src/sprite-font.ts"],"mappings":";;;;;UAGiB;;EAEf;;EAEA,SAAS;;EAET,WAAW;;;;;;;cAiGA;;EAEX;EACA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;UAEA;UACA;UACA;UACA;UACA;UACA;;EAGR,YAAY,eAAe;;EAM3B,OAAO,QAAQ,MAAM,UAAU;;EAK/B;;;;;;;;;;;;EAeA,eAAe;;MAKX;;EAKJ,MAAM,mBAAmB;;;;;EAoBzB,YAAY,mBAAmB;;;;;EAoB/B,OAAO;;MAuEH;;MAKA;;EAKJ,cAAc,gBAAgB,iBAAiB;;EAK/C,kBAAkB,gBAAgB,gBAAgB,KAAK,OAAO;;EAW9D,cAAc,iBAAiB,kBAAkB;;EAKjD,kBAAkB,iBAAiB,iBAAiB,KAAK,OAAO;;EAahE,aAAa;;EAKb,cAAc,KAAK,OAAO;UAUlB;;;;;UCnVO;;EAEf;;;;;;;;;;;;;iBAcc,gBAAgB,UAAU,UAAU,OAAO,KAAK,kBAAkB;;;;;iBAmBlE,iBAAiB,GAAG,UAAU,GAAG;;;;UCnChC;EACf;EACA;EACA,UAAU,WAAW;EACrB,MAAM,YAAY;;EAElB,OAAO,iBAAiB,YAAY;EACpC,MAAM;;;UAIS;;;;;;;;;;EAUf;;;;;;;;EAQA;;;;;;cAOW;;WAEF,OAAO;UAER;UACA;;EAGR,UAAU,QAAQ;;MAKd,UAAU;;MAQV;;;;;EAQJ,MAAM;;;;EAcN;;;;;EAYA,YACE,iBACA,iBACA,cACA,kBACA,uB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iBAMa,IAAI,OAAO,aAAa,kBAAe,gBAAa,iBAAc;;;iBAMlE,KAAK;EACnB,OAAO;EACP,UAAU;EACV;EACA;IACE;;;iBAYY,WAAW;EACzB,OAAO;EACP;EACA;EACA;IACE;;iBAWY,UAAU;EACxB,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,aAAa;EAC3B,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,UAAU;EACxB,YAAY;EACZ,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,WAAW;EACzB,WAAW;EACX,aAAa;EACb;EACA;EACA;EACA;IACE;;iBAaY,aAAa;EAC3B,WAAW;EACX,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,cAAc;EAC5B,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;;;;;;;;;;iBAsBY,aAAa,QAAQ,iBAAiB,aAAa;;;;iBAYnD,eAAe,QAAQ
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/camera2d.ts","../src/draw-order.ts","../src/renderer.ts","../src/sprite-effects.ts","../src/sprite-batch.ts","../src/frame-renderer.ts","../src/nine-slice.ts","../src/render-system.ts","../src/shaders.ts","../src/sprite-font.ts"],"mappings":";;;;;UAGiB;;EAEf;;EAEA,SAAS;;EAET,WAAW;;;;;;;cAiGA;;EAEX;EACA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;UAEA;UACA;UACA;UACA;UACA;UACA;;EAGR,YAAY,eAAe;;EAM3B,OAAO,QAAQ,MAAM,UAAU;;EAK/B;;;;;;;;;;;;EAeA,eAAe;;MAKX;;EAKJ,MAAM,mBAAmB;;;;;EAoBzB,YAAY,mBAAmB;;;;;EAoB/B,OAAO;;MAuEH;;MAKA;;EAKJ,cAAc,gBAAgB,iBAAiB;;EAK/C,kBAAkB,gBAAgB,gBAAgB,KAAK,OAAO;;EAW9D,cAAc,iBAAiB,kBAAkB;;EAKjD,kBAAkB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AY;;EAEpB,UAAU;;;;;iBAMI,gBAAgB,gBAAgB;;iBA8ChC,WAAW,MAAM,YAAY,eAAe;;iBAK5C,YAAY,MAAM,YAAY;;;;;iBAoB9B,SACd,OAAO,aACP,MAAM,YACN,OAAO,aACP,cACA,WACA,WACA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -441,6 +441,16 @@ declare function updateEffect(effect: AnySpriteEffect, dt: number): AnySpriteEff
|
|
|
441
441
|
declare function flashIntensity(effect: FlashEffect): number;
|
|
442
442
|
//#endregion
|
|
443
443
|
//#region src/sprite-batch.d.ts
|
|
444
|
+
/**
|
|
445
|
+
* Axis-aligned bounds used for viewport culling in the batch.
|
|
446
|
+
* All coordinates are in the same space as the sprite destination rects.
|
|
447
|
+
*/
|
|
448
|
+
interface BatchCullBounds {
|
|
449
|
+
readonly minX: number;
|
|
450
|
+
readonly minY: number;
|
|
451
|
+
readonly maxX: number;
|
|
452
|
+
readonly maxY: number;
|
|
453
|
+
}
|
|
444
454
|
/** A single sprite draw request in the batch. */
|
|
445
455
|
interface SpriteDrawCommand {
|
|
446
456
|
/** Texture (Skia SkImage). */
|
|
@@ -484,6 +494,27 @@ interface SpriteDrawCommand {
|
|
|
484
494
|
* Combine with a zero rotation only.
|
|
485
495
|
*/
|
|
486
496
|
stretch: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Blend mode for this batch run. Participates in the batch key — sprites
|
|
499
|
+
* with different blend modes are placed in separate runs.
|
|
500
|
+
* `'normal'` (default): standard alpha-over (SrcOver).
|
|
501
|
+
* `'additive'`: destination pixel receives `src + dst` (Skia Plus mode) —
|
|
502
|
+
* useful for particle add-ons, glows, and projectile trails.
|
|
503
|
+
*/
|
|
504
|
+
blend: 'normal' | 'additive';
|
|
505
|
+
/**
|
|
506
|
+
* Mirror the sprite horizontally about its center.
|
|
507
|
+
* Participates in the batch key. Flipped sprites are drawn via
|
|
508
|
+
* `drawImageRect` with a canvas scale(-1, 1) transform — one draw call
|
|
509
|
+
* per sprite (per-sprite draw call trade-off, documented).
|
|
510
|
+
* Unsupported in combination with rotation (same constraint as stretch mode).
|
|
511
|
+
*/
|
|
512
|
+
flipX: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* Mirror the sprite vertically about its center.
|
|
515
|
+
* Same trade-offs as flipX; the two may be combined freely.
|
|
516
|
+
*/
|
|
517
|
+
flipY: boolean;
|
|
487
518
|
}
|
|
488
519
|
/**
|
|
489
520
|
* SpriteBatch — collects sprite draw commands and groups them by texture
|
|
@@ -505,11 +536,23 @@ declare class SpriteBatch {
|
|
|
505
536
|
private _pool;
|
|
506
537
|
private _batches;
|
|
507
538
|
private _allocCount;
|
|
539
|
+
private _cull;
|
|
508
540
|
/** Number of queued draw commands. */
|
|
509
541
|
get count(): number;
|
|
510
542
|
/** Cumulative number of SpriteDrawCommand objects allocated because the internal
|
|
511
543
|
* command pool was empty. Steady state should be 0 after warm-up. */
|
|
512
544
|
get allocCount(): number;
|
|
545
|
+
/**
|
|
546
|
+
* Current cull bounds, or `null` when culling is disabled.
|
|
547
|
+
* Read by `drawNineSlice` for coarse AABB precheck.
|
|
548
|
+
* Set via `setCullBounds()` / `clearCullBounds()`.
|
|
549
|
+
*/
|
|
550
|
+
get cullBounds(): BatchCullBounds | null;
|
|
551
|
+
/** Set the viewport cull bounds for this batch.
|
|
552
|
+
* Zero-alloc in steady state — the internal object is allocated once and then mutated. */
|
|
553
|
+
setCullBounds(minX: number, minY: number, maxX: number, maxY: number): void;
|
|
554
|
+
/** Disable viewport culling (e.g. during UI rendering). */
|
|
555
|
+
clearCullBounds(): void;
|
|
513
556
|
/** Queue a sprite draw from a frame.
|
|
514
557
|
*
|
|
515
558
|
* `anchorX` / `anchorY` define the pivot point of the sprite as a
|
|
@@ -518,12 +561,12 @@ declare class SpriteBatch {
|
|
|
518
561
|
* then refer to the anchor point instead of the top-left corner.
|
|
519
562
|
*
|
|
520
563
|
* `alpha` is a per-instance opacity multiplier in [0, 1]. Default 1. */
|
|
521
|
-
draw(image: SkImageLike, frame: SpriteFrame, dstX: number, dstY: number, dstW?: number, dstH?: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean): void;
|
|
564
|
+
draw(image: SkImageLike, frame: SpriteFrame, dstX: number, dstY: number, dstW?: number, dstH?: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean, blend?: 'normal' | 'additive', flipX?: boolean, flipY?: boolean): void;
|
|
522
565
|
/** Queue a raw sprite draw with explicit src/dst rects. `dstX` / `dstY`
|
|
523
566
|
* refer to the anchor point — offset by `anchorX * dstW` / `anchorY * dstH`.
|
|
524
567
|
*
|
|
525
568
|
* `alpha` is a per-instance opacity multiplier in [0, 1]. Default 1. */
|
|
526
|
-
drawRaw(image: SkImageLike, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean): void;
|
|
569
|
+
drawRaw(image: SkImageLike, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number, effect?: AnySpriteEffect, anchorX?: number, anchorY?: number, alpha?: number, rotation?: number, stretch?: boolean, blend?: 'normal' | 'additive', flipX?: boolean, flipY?: boolean): void;
|
|
527
570
|
/**
|
|
528
571
|
* Flush all queued commands in insertion order, grouping maximal consecutive
|
|
529
572
|
* runs that share the same `(image, effect, alpha, stretch)` key into a
|
|
@@ -543,8 +586,6 @@ declare class SpriteBatch {
|
|
|
543
586
|
}
|
|
544
587
|
//#endregion
|
|
545
588
|
//#region src/frame-renderer.d.ts
|
|
546
|
-
/** A 4-float RGBA color buffer (r, g, b, a in [0, 1]). */
|
|
547
|
-
type ColorLike = Float32Array;
|
|
548
589
|
/**
|
|
549
590
|
* A mutable axis-aligned rect.
|
|
550
591
|
*
|
|
@@ -605,6 +646,12 @@ interface PaintLike {
|
|
|
605
646
|
setColorFilter(filter: unknown): void;
|
|
606
647
|
setShader(shader: unknown): void;
|
|
607
648
|
setImageFilter(filter: unknown): void;
|
|
649
|
+
/**
|
|
650
|
+
* Set the Skia BlendMode on this paint.
|
|
651
|
+
* Optional — absent on mocks and some test stubs; the renderer silently
|
|
652
|
+
* falls back to SrcOver (the Skia default) when the method is missing.
|
|
653
|
+
*/
|
|
654
|
+
setBlendMode?(mode: number): void;
|
|
608
655
|
}
|
|
609
656
|
/** Minimal draw surface the frame-renderer calls into. */
|
|
610
657
|
interface DrawSurfaceLike {
|
|
@@ -730,6 +777,40 @@ declare function getXformCounters(): {
|
|
|
730
777
|
unrotated: number;
|
|
731
778
|
};
|
|
732
779
|
//#endregion
|
|
780
|
+
//#region src/nine-slice.d.ts
|
|
781
|
+
/**
|
|
782
|
+
* Draw a sprite using a 9-slice (scale-9) layout.
|
|
783
|
+
*
|
|
784
|
+
* The source frame is divided into a 3×3 grid by `inset` pixels from each
|
|
785
|
+
* edge. Corners draw at natural size; edges stretch along one axis; the
|
|
786
|
+
* centre stretches in both axes. This preserves crisp borders at any
|
|
787
|
+
* destination size — the canonical use case is UI panels and buttons.
|
|
788
|
+
*
|
|
789
|
+
* All 9 slices use the `drawImageRect` (`stretch=true`) path, so they are
|
|
790
|
+
* NOT batched with regular Atlas sprites; they form their own consecutive run
|
|
791
|
+
* in the batch. The function calls `batch.drawRaw()` for each non-degenerate
|
|
792
|
+
* slice (a slice with zero source or destination area is skipped silently).
|
|
793
|
+
*
|
|
794
|
+
* **Coarse culling:** if `batch.cullBounds` is set, the entire nine-slice is
|
|
795
|
+
* skipped when the destination rectangle `[x, y, x+w, y+h]` does not
|
|
796
|
+
* intersect the bounds. Individual slice culling is not performed — the
|
|
797
|
+
* caller should set tight bounds if per-slice savings matter.
|
|
798
|
+
*
|
|
799
|
+
* @param batch Target SpriteBatch — must outlive this call.
|
|
800
|
+
* @param image Source texture.
|
|
801
|
+
* @param frame Sub-region of the texture to use as the nine-slice source.
|
|
802
|
+
* @param x Destination left edge (screen / world coords).
|
|
803
|
+
* @param y Destination top edge.
|
|
804
|
+
* @param w Destination width.
|
|
805
|
+
* @param h Destination height.
|
|
806
|
+
* @param inset Border size in source-texture pixels, applied uniformly to
|
|
807
|
+
* all four edges. Must be ≥ 0; clamped to half the frame
|
|
808
|
+
* dimension so corners never overlap.
|
|
809
|
+
* @param effect Optional sprite effect applied to every slice identically.
|
|
810
|
+
* @param alpha Per-instance opacity multiplier in [0, 1]. Default 1.
|
|
811
|
+
*/
|
|
812
|
+
declare function drawNineSlice(batch: SpriteBatch, image: SkImageLike, frame: SpriteFrame, x: number, y: number, w: number, h: number, inset: number, effect?: AnySpriteEffect, alpha?: number): void;
|
|
813
|
+
//#endregion
|
|
733
814
|
//#region src/render-system.d.ts
|
|
734
815
|
/** Position component data expected by the render system. */
|
|
735
816
|
interface PositionData {
|
|
@@ -776,6 +857,19 @@ interface SpriteData {
|
|
|
776
857
|
* Rotation is unsupported in stretch mode — combine only with `rotation = 0`.
|
|
777
858
|
*/
|
|
778
859
|
stretch?: boolean;
|
|
860
|
+
/**
|
|
861
|
+
* Blend mode for this sprite.
|
|
862
|
+
* `'normal'` (default): standard alpha-over blending.
|
|
863
|
+
* `'additive'`: src + dst pixel colours — glows, particles, bullet trails.
|
|
864
|
+
* Sprites with different blend modes are placed in separate batch runs.
|
|
865
|
+
*/
|
|
866
|
+
blend?: 'normal' | 'additive';
|
|
867
|
+
/** Mirror the sprite horizontally. Default false.
|
|
868
|
+
* Routes through the `drawImageRect` path — per-sprite draw call trade-off.
|
|
869
|
+
* Unsupported with rotation; combine only with `rotation = 0`. */
|
|
870
|
+
flipX?: boolean;
|
|
871
|
+
/** Mirror the sprite vertically. Default false. Same trade-offs as flipX. */
|
|
872
|
+
flipY?: boolean;
|
|
779
873
|
}
|
|
780
874
|
/**
|
|
781
875
|
* Create a render system function.
|
|
@@ -857,5 +951,5 @@ declare function measureText(font: BitmapFont, text: string): number;
|
|
|
857
951
|
*/
|
|
858
952
|
declare function drawText(batch: SpriteBatch, font: BitmapFont, image: SkImageLike, text: string, x: number, y: number, scale?: number): void;
|
|
859
953
|
//#endregion
|
|
860
|
-
export { type AnySpriteEffect, type BitmapFont, CAVE_INTERIOR_SKSL, Camera2D, type CanvasLike, type CaveInteriorEffect, type ColorFilterFactoryLike, type
|
|
954
|
+
export { type AnySpriteEffect, type BatchCullBounds, type BitmapFont, CAVE_INTERIOR_SKSL, Camera2D, type CanvasLike, type CaveInteriorEffect, type ColorFilterFactoryLike, type CompiledShader, type CustomShaderEffect, type DrawSurfaceLike, type Drawable, type DropShadowEffect, FIRE_SKSL, FOG_SKSL, FOREST_CANOPY_SKSL, type FireEffect, type FlashEffect, type FogEffect, type FollowOptions, type ForestCanopyEffect, type FrameRenderer, type FrameRendererCompiledPass, type FrameRendererModule, type FrameRendererPostFxChain, type FrameRendererPostFxDescriptor, type FrameRendererPostFxRuntime, type Glyph, type GrayscaleEffect, type ImageFilterFactoryLike, type KerningPair, MOON_CRATER_SKSL, MOUNTAIN_HILLS_SKSL, type MoonCraterEffect, type MountainHillsEffect, type OutlineEffect, type PaintLike, type PictureLike, type PictureRecorderLike, type PositionData, RIVER_WAVE_SKSL, ROOFS_CITY_SKSL, type RSXformLike, type RectLike, type RenderStats, Renderer, type RiverWaveEffect, type RoofsCityEffect, type RuntimeEffectFactoryLike, type RuntimeEffectLike, type ShaderUniforms, Sprite, type SpriteAnchor, SpriteBatch, type SpriteColor, type SpriteData, type SpriteDrawCommand, type SpriteEffect, type TintEffect, WATER_SKSL, type WaterEffect, caveInterior, createFrameRenderer, createRenderSystem, custom, drawNineSlice, drawOrderCompare, drawText, dropShadow, fire, flash, flashIntensity, fog, forestCanopy, getKerning, getXformCounters, grayscale, measureText, moonCrater, mountainHills, outline, parseBMFontJSON, resetXformCounters, riverWave, roofsCity, sortByDrawOrder, tint, updateEffect, water };
|
|
861
955
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/camera2d.ts","../src/draw-order.ts","../src/renderer.ts","../src/sprite-effects.ts","../src/sprite-batch.ts","../src/frame-renderer.ts","../src/render-system.ts","../src/shaders.ts","../src/sprite-font.ts"],"mappings":";;;;;UAGiB;;EAEf;;EAEA,SAAS;;EAET,WAAW;;;;;;;cAiGA;;EAEX;EACA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;UAEA;UACA;UACA;UACA;UACA;UACA;;EAGR,YAAY,eAAe;;EAM3B,OAAO,QAAQ,MAAM,UAAU;;EAK/B;;;;;;;;;;;;EAeA,eAAe;;MAKX;;EAKJ,MAAM,mBAAmB;;;;;EAoBzB,YAAY,mBAAmB;;;;;EAoB/B,OAAO;;MAuEH;;MAKA;;EAKJ,cAAc,gBAAgB,iBAAiB;;EAK/C,kBAAkB,gBAAgB,gBAAgB,KAAK,OAAO;;EAW9D,cAAc,iBAAiB,kBAAkB;;EAKjD,kBAAkB,iBAAiB,iBAAiB,KAAK,OAAO;;EAahE,aAAa;;EAKb,cAAc,KAAK,OAAO;UAUlB;;;;;UCnVO;;EAEf;;;;;;;;;;;;;iBAcc,gBAAgB,UAAU,UAAU,OAAO,KAAK,kBAAkB;;;;;iBAmBlE,iBAAiB,GAAG,UAAU,GAAG;;;;UCnChC;EACf;EACA;EACA,UAAU,WAAW;EACrB,MAAM,YAAY;;EAElB,OAAO,iBAAiB,YAAY;EACpC,MAAM;;;UAIS;;;;;;;;;;EAUf;;;;;;;;EAQA;;;;;;cAOW;;WAEF,OAAO;UAER;UACA;;EAGR,UAAU,QAAQ;;MAKd,UAAU;;MAQV;;;;;EAQJ,MAAM;;;;EAcN;;;;;EAYA,YACE,iBACA,iBACA,cACA,kBACA,uBACA;;;EAkBF;;;EAMA;;;;;UCzHe;WACN;WACA;WACA;WACA;;;UAIM;WACN;;;UAIM,mBAAmB;WACzB;WACA,OAAO;WACP;;;UAIM,oBAA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ACzB,OAAO;EACP;EACA;EACA;IACE;;iBAWY,UAAU;EACxB,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,aAAa;EAC3B,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,UAAU;EACxB,YAAY;EACZ,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,WAAW;EACzB,WAAW;EACX,aAAa;EACb;EACA;EACA;EACA;IACE;;iBAaY,aAAa;EAC3B,WAAW;EACX,WAAW;EACX;EACA;EACA;EACA;IACE;;iBAaY,cAAc;EAC5B,UAAU;EACV,WAAW;EACX;EACA;EACA;EACA;IACE;;;;;;;;;;;iBAsBY,aAAa,QAAQ,iBAAiB,aAAa;;;;iBAYnD,eAAe,QAAQ
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/camera2d.ts","../src/draw-order.ts","../src/renderer.ts","../src/sprite-effects.ts","../src/sprite-batch.ts","../src/frame-renderer.ts","../src/nine-slice.ts","../src/render-system.ts","../src/shaders.ts","../src/sprite-font.ts"],"mappings":";;;;;UAGiB;;EAEf;;EAEA,SAAS;;EAET,WAAW;;;;;;;cAiGA;;EAEX;EACA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,QAAQ;UAEA;UACA;UACA;UACA;UACA;UACA;;EAGR,YAAY,eAAe;;EAM3B,OAAO,QAAQ,MAAM,UAAU;;EAK/B;;;;;;;;;;;;EAeA,eAAe;;MAKX;;EAKJ,MAAM,mBAAmB;;;;;EAoBzB,YAAY,mBAAmB;;;;;EAoB/B,OAAO;;MAuEH;;MAKA;;EAKJ,cAAc,gBAAgB,iBAAiB;;EAK/C,kBAAkB,gBAAgB,gBAAgB,KAAK,OAAO;;EAW9D,cAAc,iBAAiB,kBAAkB;;EAKjD,kBAAkB,iBAAiB,iBAAiB,KAAK,OAAO;;EAahE,aAAa;;EAKb,cAAc,KAAK,OAAO;UAUlB;;;;;UCnVO;;EAEf;;;;;;;;;;;;;iBAcc,g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