angry-pixel 2.1.7 → 2.1.9

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
@@ -1630,8 +1630,12 @@ interface GameConfig {
1630
1630
  colliders: boolean;
1631
1631
  /** Show mouse position */
1632
1632
  mousePosition: boolean;
1633
+ /** Show text renderer bounding boxes */
1634
+ textRendererBoundingBoxes: boolean;
1633
1635
  /** Color of the colliders, default "#00FF00" (green) */
1634
1636
  collidersColor?: string;
1637
+ /** Color of the text box, default "#0000FF" (blue) */
1638
+ textBoxColor?: string;
1635
1639
  /** Color of the text, default "#00FF00" (green) */
1636
1640
  textColor?: string;
1637
1641
  /** Position of debug text, default "bottom-left" */
@@ -2718,6 +2722,9 @@ interface TiledProperty {
2718
2722
  * position: new Vector2(100, 100),
2719
2723
  * scale: new Vector2(2, 2),
2720
2724
  * rotation: Math.PI / 4
2725
+ * ignoreParentPosition: false,
2726
+ * ignoreParentScale: false,
2727
+ * ignoreParentRotation: false
2721
2728
  * });
2722
2729
  * ```
2723
2730
  */
@@ -2725,6 +2732,9 @@ interface TransformOptions {
2725
2732
  position: Vector2;
2726
2733
  scale: Vector2;
2727
2734
  rotation: number;
2735
+ ignoreParentPosition: boolean;
2736
+ ignoreParentScale: boolean;
2737
+ ignoreParentRotation: boolean;
2728
2738
  }
2729
2739
  /**
2730
2740
  * The Transform component defines an entity's position, scale and rotation in the game world.\
@@ -3352,15 +3362,14 @@ interface Slice {
3352
3362
  }
3353
3363
 
3354
3364
  /**
3355
- * Direction in which the text will be rendered.
3365
+ * Alignment of the text.
3356
3366
  * @category Components Configuration
3357
3367
  * @public
3358
3368
  */
3359
- declare enum TextOrientation {
3369
+ declare enum TextAlignment {
3360
3370
  Center = 0,
3361
- RightUp = 1,
3362
- RightDown = 2,
3363
- RightCenter = 3
3371
+ Right = 1,
3372
+ Left = 2
3364
3373
  }
3365
3374
  interface TextRenderData extends RenderData {
3366
3375
  color: string;
@@ -3371,7 +3380,6 @@ interface TextRenderData extends RenderData {
3371
3380
  lineHeight: number;
3372
3381
  letterSpacing: number;
3373
3382
  opacity: number;
3374
- orientation: TextOrientation;
3375
3383
  rotation: number;
3376
3384
  shadow?: {
3377
3385
  color: string;
@@ -3385,6 +3393,11 @@ interface TextRenderData extends RenderData {
3385
3393
  fontSize: number;
3386
3394
  spacing: number;
3387
3395
  };
3396
+ boundingBox: {
3397
+ width: number;
3398
+ height: number;
3399
+ };
3400
+ alignment: TextAlignment;
3388
3401
  }
3389
3402
 
3390
3403
  /**
@@ -3877,7 +3890,7 @@ declare const defaultTextureAtlasOptions: {
3877
3890
  * height: 32,
3878
3891
  * opacity: 1,
3879
3892
  * layer: "TextLayer",
3880
- * orientation: TextOrientation.RightCenter,
3893
+ * alignment: TextAlignment.Center,
3881
3894
  * shadow: {
3882
3895
  * color: "#00FF00",
3883
3896
  * offset: new Vector2(3, -3),
@@ -3922,8 +3935,6 @@ interface TextRendererOptions {
3922
3935
  offset: Vector2;
3923
3936
  /** Change the opacity between 1 and 0 */
3924
3937
  opacity: number;
3925
- /** Direction in which the text will be rendered. */
3926
- orientation: TextOrientation;
3927
3938
  /** Text rotation in radians */
3928
3939
  rotation: number;
3929
3940
  /** Smoothing pixels (not recommended for bitmap fonts) */
@@ -3952,6 +3963,8 @@ interface TextRendererOptions {
3952
3963
  };
3953
3964
  /** The width of the invisible box where the text is rendered */
3954
3965
  width: number;
3966
+ /** The alignment of the text */
3967
+ alignment: TextAlignment;
3955
3968
  }
3956
3969
  /**
3957
3970
  * The TextRenderer component renders text to the screen with extensive customization options.\
@@ -3985,7 +3998,7 @@ interface TextRendererOptions {
3985
3998
  * height: 32,
3986
3999
  * opacity: 1,
3987
4000
  * layer: "TextLayer",
3988
- * orientation: TextOrientation.RightCenter,
4001
+ * alignment: TextAlignment.Center,
3989
4002
  * shadow: {
3990
4003
  * color: "#00FF00",
3991
4004
  * offset: new Vector2(3, -3),
@@ -4030,8 +4043,8 @@ declare class TextRenderer {
4030
4043
  offset: Vector2;
4031
4044
  /** Change the opacity between 1 and 0 */
4032
4045
  opacity: number;
4033
- /** Direction in which the text will be rendered. */
4034
- orientation: TextOrientation;
4046
+ /** Alignment of the text. */
4047
+ alignment: TextAlignment;
4035
4048
  /** Text rotation in radians */
4036
4049
  rotation: number;
4037
4050
  /** Shadow text configuration */
@@ -4910,7 +4923,7 @@ declare const stopSfx: (audioSource: HTMLAudioElement) => void;
4910
4923
  * @public
4911
4924
  * @category Decorators
4912
4925
  */
4913
- declare const BuiltInDependencyIdentifiers: {
4926
+ declare const SYMBOLS: {
4914
4927
  AssetManager: symbol;
4915
4928
  CanvasElement: symbol;
4916
4929
  CollisionRepository: symbol;
@@ -4922,4 +4935,4 @@ declare const BuiltInDependencyIdentifiers: {
4922
4935
  TimeManager: symbol;
4923
4936
  };
4924
4937
 
4925
- export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerAction, type AudioPlayerOptions, type AudioPlayerState, BallCollider, type BallColliderOptions, BoxCollider, type BoxColliderOptions, BroadPhaseMethods, BuiltInDependencyIdentifiers, 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, type DisabledComponent, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, 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, Scene, SceneManager, type SceneType, type SearchResult, type Shape, type Slice, SpriteRenderer, type SpriteRendererOptions, type System, type SystemGroup, SystemManager, type SystemType, TextOrientation, 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, disableComponent, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };
4938
+ export { Animation, type AnimationOptions, type AnimationSlice, Animator, type AnimatorOptions, type Archetype, AssetManager, AudioPlayer, type AudioPlayerAction, type AudioPlayerOptions, type AudioPlayerState, 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, type DisabledComponent, EdgeCollider, type EdgeColliderOptions, type Entity, EntityManager, Game, type GameConfig, GameSystem, GamepadController, 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, disableComponent, fixedRound, gameLogicSystem, gamePhysicsSystem, gamePreRenderSystem, inject, injectable, playSfx, radiansToDegrees, randomFloat, randomInt, range, rgbToHex, stopSfx };