angry-pixel 2.3.2 → 2.3.3

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/lib/index.d.ts CHANGED
@@ -3170,6 +3170,13 @@ interface RigidBodyOptions {
3170
3170
  * @public
3171
3171
  */
3172
3172
  acceleration: Vector2;
3173
+ /**
3174
+ * Collision layers for which this body behaves as static. When a Dynamic body whose collider layer
3175
+ * is listed here collides with this body, only the other body is repositioned, as if this one were static.
3176
+ * This body still behaves as its own type (e.g. Dynamic) for every other collision.
3177
+ * @public
3178
+ */
3179
+ staticForLayers: string[];
3173
3180
  }
3174
3181
  /**
3175
3182
  * The RigidBody component enables physics simulation for an entity, allowing it to interact with other physics-enabled objects in the game world.\
@@ -3235,6 +3242,13 @@ declare class RigidBody {
3235
3242
  * @public
3236
3243
  */
3237
3244
  acceleration: Vector2;
3245
+ /**
3246
+ * Collision layers for which this body behaves as static. When a Dynamic body whose collider layer
3247
+ * is listed here collides with this body, only the other body is repositioned, as if this one were static.
3248
+ * This body still behaves as its own type (e.g. Dynamic) for every other collision.
3249
+ * @public
3250
+ */
3251
+ staticForLayers: string[];
3238
3252
  /** @internal */
3239
3253
  static componentName: string;
3240
3254
  constructor(options?: Partial<RigidBodyOptions>);
@@ -3476,6 +3490,7 @@ interface TilemapRenderData extends RenderData {
3476
3490
  tiles: number[];
3477
3491
  tilemap: Tilemap;
3478
3492
  tileset: Tileset$1;
3493
+ tileAnimations?: Map<number, number>;
3479
3494
  smooth?: boolean;
3480
3495
  flipHorizontal?: boolean;
3481
3496
  flipVertical?: boolean;
@@ -4323,6 +4338,7 @@ interface TilemapRendererOptions {
4323
4338
  maskColorMix: number;
4324
4339
  opacity: number;
4325
4340
  smooth: boolean;
4341
+ animations: Map<number, TileAnimation>;
4326
4342
  }
4327
4343
  /**
4328
4344
  * The TilemapRenderer component renders 2D tile-based maps to the screen.\
@@ -4385,14 +4401,62 @@ declare class TilemapRenderer {
4385
4401
  maskColorMix: number;
4386
4402
  /** TRUE for smooth pixels (not recommended for pixel art) */
4387
4403
  smooth: boolean;
4404
+ /** Animated tiles, keyed by the tile id to animate. */
4405
+ animations: Map<number, TileAnimation>;
4388
4406
  /** @internal */
4389
4407
  _processed: boolean;
4390
4408
  /** @internal */
4391
4409
  _renderData: TilemapRenderData[];
4410
+ /** Maps each animated tile id to the tile id currently displayed. @internal */
4411
+ _tileAnimationState: Map<number, number>;
4392
4412
  /** @internal */
4393
4413
  static componentName: string;
4394
4414
  constructor(options?: Partial<TilemapRendererOptions>);
4395
4415
  }
4416
+ /**
4417
+ * TileAnimation configuration
4418
+ * @public
4419
+ * @category Components Configuration
4420
+ * @example
4421
+ * ```js
4422
+ * const waterAnimation = new TileAnimation({
4423
+ * tiles: [5, 6, 7, 8],
4424
+ * fps: 6
4425
+ * });
4426
+ * ```
4427
+ */
4428
+ interface TileAnimationOptions {
4429
+ tiles: number[];
4430
+ fps?: number;
4431
+ }
4432
+ /**
4433
+ * TileAnimation cycles a tile through a sequence of tile ids from the tileset.\
4434
+ * It is assigned to a {@link TilemapRenderer} keyed by the tile id that should animate.
4435
+ * @public
4436
+ * @category Components Configuration
4437
+ * @example
4438
+ * ```js
4439
+ * const tilemapRenderer = new TilemapRenderer({
4440
+ * tileset: { image: "tileset.png", width: 10, tileWidth: 32, tileHeight: 32 },
4441
+ * data: [1, 2, 3, 4],
4442
+ * width: 2,
4443
+ * animations: new Map([
4444
+ * [3, new TileAnimation({ tiles: [3, 4, 5], fps: 6 })]
4445
+ * ])
4446
+ * });
4447
+ * ```
4448
+ */
4449
+ declare class TileAnimation {
4450
+ /** The sequence of tile ids to cycle through. */
4451
+ tiles: number[];
4452
+ /** The animation speed in frames per second. */
4453
+ fps: number;
4454
+ /** The current frame of the animation. */
4455
+ currentFrame: number;
4456
+ /** The current time of the animation. */
4457
+ currentTime: number;
4458
+ constructor(options?: TileAnimationOptions);
4459
+ }
4396
4460
  /**
4397
4461
  * The Tileset configuration defines the properties of a tileset used by the TilemapRenderer.\
4398
4462
  * It specifies the source image containing the tiles, the dimensions of the tileset and individual tiles,\
@@ -5131,4 +5195,4 @@ declare const SYMBOLS: {
5131
5195
  TimeManager: symbol;
5132
5196
  };
5133
5197
 
5134
- export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerOptions, type AudioSource, BallCollider, type BallColliderOptions, BoxCollider, type BoxColliderOptions, BroadPhaseMethods, Button, type ButtonOptions, ButtonShape, Camera, type CameraOptions, type Chunk, Circumference, type Collider, type Collision, type CollisionMatrix, CollisionMethods, CollisionRepository, type CollisionResolution, type Component, type ComponentType, DarknessRenderer, type DarknessRendererOptions, type DependencyName, type DependencyType, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, GeometricRenderer, type GeometricRendererOptions, GeometricShape, InputManager, type IntervalOptions, Keyboard, LightRenderer, type LightRendererOptions, MaskRenderer, type MaskRendererOptions, MaskShape, Mouse, type PlaySfxOptions, Polygon, PolygonCollider, type PolygonColliderOptions, type PropertyKey, Rectangle, RigidBody, type RigidBodyOptions, RigidBodyType, SYMBOLS, Scene, SceneManager, type SceneType, type SearchResult, type Shape, type Slice, SpriteRenderer, type SpriteRendererOptions, type System, type SystemGroup, SystemManager, type SystemType, TextAlignment, TextRenderer, type TextRendererOptions, type TiledChunk, type TiledLayer, type TiledObject, type TiledObjectLayer, type TiledProperty, type TiledTilemap, TiledWrapper, type TiledWrapperOptions, TilemapCollider, type TilemapColliderOptions, TilemapOrientation, TilemapRenderer, type TilemapRendererOptions, type Tileset, TimeManager, type TouchInteraction, TouchScreen, Transform, type TransformOptions, Vector2, type VibrationInput, VideoRenderer, type VideoRendererOptions, between, clamp, debugRenderLayer, decorate, defaultRenderLayer, defaultTextureAtlasOptions, degreesToRadians, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };
5198
+ export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerOptions, type AudioSource, BallCollider, type BallColliderOptions, BoxCollider, type BoxColliderOptions, BroadPhaseMethods, Button, type ButtonOptions, ButtonShape, Camera, type CameraOptions, type Chunk, Circumference, type Collider, type Collision, type CollisionMatrix, CollisionMethods, CollisionRepository, type CollisionResolution, type Component, type ComponentType, DarknessRenderer, type DarknessRendererOptions, type DependencyName, type DependencyType, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, GeometricRenderer, type GeometricRendererOptions, GeometricShape, InputManager, type IntervalOptions, Keyboard, LightRenderer, type LightRendererOptions, MaskRenderer, type MaskRendererOptions, MaskShape, Mouse, type PlaySfxOptions, Polygon, PolygonCollider, type PolygonColliderOptions, type PropertyKey, Rectangle, RigidBody, type RigidBodyOptions, RigidBodyType, SYMBOLS, Scene, SceneManager, type SceneType, type SearchResult, type Shape, type Slice, SpriteRenderer, type SpriteRendererOptions, type System, type SystemGroup, SystemManager, type SystemType, TextAlignment, TextRenderer, type TextRendererOptions, TileAnimation, type TileAnimationOptions, type TiledChunk, type TiledLayer, type TiledObject, type TiledObjectLayer, type TiledProperty, type TiledTilemap, TiledWrapper, type TiledWrapperOptions, TilemapCollider, type TilemapColliderOptions, TilemapOrientation, TilemapRenderer, type TilemapRendererOptions, type Tileset, TimeManager, type TouchInteraction, TouchScreen, Transform, type TransformOptions, Vector2, type VibrationInput, VideoRenderer, type VideoRendererOptions, between, clamp, debugRenderLayer, decorate, defaultRenderLayer, defaultTextureAtlasOptions, degreesToRadians, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };