angry-pixel 2.1.8 → 2.1.10

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" */
@@ -3358,15 +3362,14 @@ interface Slice {
3358
3362
  }
3359
3363
 
3360
3364
  /**
3361
- * Direction in which the text will be rendered.
3365
+ * Alignment of the text.
3362
3366
  * @category Components Configuration
3363
3367
  * @public
3364
3368
  */
3365
- declare enum TextOrientation {
3369
+ declare enum TextAlignment {
3366
3370
  Center = 0,
3367
- RightUp = 1,
3368
- RightDown = 2,
3369
- RightCenter = 3
3371
+ Right = 1,
3372
+ Left = 2
3370
3373
  }
3371
3374
  interface TextRenderData extends RenderData {
3372
3375
  color: string;
@@ -3377,7 +3380,6 @@ interface TextRenderData extends RenderData {
3377
3380
  lineHeight: number;
3378
3381
  letterSpacing: number;
3379
3382
  opacity: number;
3380
- orientation: TextOrientation;
3381
3383
  rotation: number;
3382
3384
  shadow?: {
3383
3385
  color: string;
@@ -3391,6 +3393,11 @@ interface TextRenderData extends RenderData {
3391
3393
  fontSize: number;
3392
3394
  spacing: number;
3393
3395
  };
3396
+ boundingBox: {
3397
+ width: number;
3398
+ height: number;
3399
+ };
3400
+ alignment: TextAlignment;
3394
3401
  }
3395
3402
 
3396
3403
  /**
@@ -3883,7 +3890,7 @@ declare const defaultTextureAtlasOptions: {
3883
3890
  * height: 32,
3884
3891
  * opacity: 1,
3885
3892
  * layer: "TextLayer",
3886
- * orientation: TextOrientation.RightCenter,
3893
+ * alignment: TextAlignment.Center,
3887
3894
  * shadow: {
3888
3895
  * color: "#00FF00",
3889
3896
  * offset: new Vector2(3, -3),
@@ -3928,8 +3935,6 @@ interface TextRendererOptions {
3928
3935
  offset: Vector2;
3929
3936
  /** Change the opacity between 1 and 0 */
3930
3937
  opacity: number;
3931
- /** Direction in which the text will be rendered. */
3932
- orientation: TextOrientation;
3933
3938
  /** Text rotation in radians */
3934
3939
  rotation: number;
3935
3940
  /** Smoothing pixels (not recommended for bitmap fonts) */
@@ -3958,6 +3963,8 @@ interface TextRendererOptions {
3958
3963
  };
3959
3964
  /** The width of the invisible box where the text is rendered */
3960
3965
  width: number;
3966
+ /** The alignment of the text */
3967
+ alignment: TextAlignment;
3961
3968
  }
3962
3969
  /**
3963
3970
  * The TextRenderer component renders text to the screen with extensive customization options.\
@@ -3991,7 +3998,7 @@ interface TextRendererOptions {
3991
3998
  * height: 32,
3992
3999
  * opacity: 1,
3993
4000
  * layer: "TextLayer",
3994
- * orientation: TextOrientation.RightCenter,
4001
+ * alignment: TextAlignment.Center,
3995
4002
  * shadow: {
3996
4003
  * color: "#00FF00",
3997
4004
  * offset: new Vector2(3, -3),
@@ -4036,8 +4043,8 @@ declare class TextRenderer {
4036
4043
  offset: Vector2;
4037
4044
  /** Change the opacity between 1 and 0 */
4038
4045
  opacity: number;
4039
- /** Direction in which the text will be rendered. */
4040
- orientation: TextOrientation;
4046
+ /** Alignment of the text. */
4047
+ alignment: TextAlignment;
4041
4048
  /** Text rotation in radians */
4042
4049
  rotation: number;
4043
4050
  /** Shadow text configuration */
@@ -4916,7 +4923,7 @@ declare const stopSfx: (audioSource: HTMLAudioElement) => void;
4916
4923
  * @public
4917
4924
  * @category Decorators
4918
4925
  */
4919
- declare const BuiltInDependencyIdentifiers: {
4926
+ declare const SYMBOLS: {
4920
4927
  AssetManager: symbol;
4921
4928
  CanvasElement: symbol;
4922
4929
  CollisionRepository: symbol;
@@ -4928,4 +4935,4 @@ declare const BuiltInDependencyIdentifiers: {
4928
4935
  TimeManager: symbol;
4929
4936
  };
4930
4937
 
4931
- 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 };