laymur 0.11.3 → 0.11.4

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.
Files changed (35) hide show
  1. package/README.md +0 -1
  2. package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +1 -1
  3. package/dist/elements/{UIAnchor.d.ts → UIAnchor/UIAnchor.d.ts} +3 -3
  4. package/dist/elements/{UIAnimatedImage.Internal.d.ts → UIAnimatedImage/UIAnimatedImage.Internal.d.ts} +2 -2
  5. package/dist/elements/{UIAnimatedImage.d.ts → UIAnimatedImage/UIAnimatedImage.d.ts} +6 -6
  6. package/dist/elements/UIElement/UIElement.Internal.d.ts +11 -0
  7. package/dist/elements/{UIElement.d.ts → UIElement/UIElement.d.ts} +9 -9
  8. package/dist/elements/UIGraphics/UIGraphics.Internal.d.ts +9 -0
  9. package/dist/elements/{UIGraphics.d.ts → UIGraphics/UIGraphics.d.ts} +4 -4
  10. package/dist/elements/UIImage/UIImage.Internal.d.ts +9 -0
  11. package/dist/elements/{UIImage.d.ts → UIImage/UIImage.d.ts} +7 -7
  12. package/dist/elements/{UIDummy.Internal.d.ts → UIInputDummy/UIInputDummy.Internal.d.ts} +5 -5
  13. package/dist/elements/{UIDummy.d.ts → UIInputDummy/UIInputDummy.d.ts} +11 -11
  14. package/dist/elements/{UINineSlice.Internal.d.ts → UINineSlice/UINineSlice.Internal.d.ts} +5 -5
  15. package/dist/elements/{UINineSlice.d.ts → UINineSlice/UINineSlice.d.ts} +9 -9
  16. package/dist/elements/{UIProgress.Internal.d.ts → UIProgress/UIProgress.Internal.d.ts} +5 -3
  17. package/dist/elements/{UIProgress.d.ts → UIProgress/UIProgress.d.ts} +8 -7
  18. package/dist/elements/{UIScene.Internal.d.ts → UIScene/UIScene.Internal.d.ts} +3 -3
  19. package/dist/elements/{UIScene.d.ts → UIScene/UIScene.d.ts} +3 -3
  20. package/dist/elements/UIText/UIText.Internal.d.ts +3 -3
  21. package/dist/elements/UIText/UIText.d.ts +3 -3
  22. package/dist/index.d.ts +10 -10
  23. package/dist/index.js +290 -179
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.min.js +1 -1
  26. package/dist/index.min.js.map +1 -1
  27. package/dist/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
  28. package/dist/miscellaneous/{padding/UIPadding.d.ts → insets/UIInsets.d.ts} +15 -15
  29. package/dist/miscellaneous/texture/UITextureView.d.ts +13 -9
  30. package/package.json +1 -1
  31. package/dist/elements/UIElement.Internal.d.ts +0 -11
  32. package/dist/elements/UIGraphics.Internal.d.ts +0 -7
  33. package/dist/elements/UIImage.Internal.d.ts +0 -7
  34. package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +0 -11
  35. /package/dist/elements/{UIAnchor.Internal.d.ts → UIAnchor/UIAnchor.Internal.d.ts} +0 -0
@@ -0,0 +1,11 @@
1
+ /** Insets configuration as number, per-side, or per-axis */
2
+ export type UIInsetsConfig = {
3
+ horizontal: number;
4
+ vertical: number;
5
+ } | {
6
+ left: number;
7
+ right: number;
8
+ top: number;
9
+ bottom: number;
10
+ } | number;
11
+ export declare const INSETS_DEFAULT_VALUE = 0;
@@ -1,33 +1,33 @@
1
1
  import { Vector4 } from "three";
2
- import type { UIPaddingConfig } from "./UIPadding.Internal";
3
- /** Padding values for four sides */
4
- export declare class UIPadding {
2
+ import type { UIInsetsConfig } from "./UIInsets.Internal";
3
+ /** Insets values for four sides */
4
+ export declare class UIInsets {
5
5
  private lInternal;
6
6
  private rInternal;
7
7
  private tInternal;
8
8
  private bInternal;
9
9
  private dirtyInternal;
10
10
  /**
11
- * Creates UIPadding instance.
11
+ * Creates UIInsets instance.
12
12
  *
13
- * @param config - Padding configuration
13
+ * @param config - Insets configuration
14
14
  */
15
- constructor(config?: UIPaddingConfig);
16
- /** Left padding */
15
+ constructor(config?: UIInsetsConfig);
16
+ /** Left inset */
17
17
  get left(): number;
18
- /** Right padding */
18
+ /** Right inset */
19
19
  get right(): number;
20
- /** Top padding */
20
+ /** Top inset */
21
21
  get top(): number;
22
- /** Bottom padding */
22
+ /** Bottom inset */
23
23
  get bottom(): number;
24
- /** Left padding */
24
+ /** Left inset */
25
25
  set left(value: number);
26
- /** Right padding */
26
+ /** Right inset */
27
27
  set right(value: number);
28
- /** Top padding */
28
+ /** Top inset */
29
29
  set top(value: number);
30
- /** Bottom padding */
30
+ /** Bottom inset */
31
31
  set bottom(value: number);
32
32
  /** Sets left and right to same value */
33
33
  setHorizontal(value: number): void;
@@ -42,5 +42,5 @@ export declare class UIPadding {
42
42
  /** Resets all sides to 0 */
43
43
  reset(): void;
44
44
  /** Copies from another instance */
45
- copy(other: UIPadding): void;
45
+ copy(other: UIInsets): void;
46
46
  }
@@ -4,19 +4,21 @@ import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal";
4
4
  /** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
5
5
  export declare class UITextureView extends Eventail {
6
6
  private textureInternal;
7
- private rotatedInternal;
7
+ private sourceWidth;
8
+ private sourceHeight;
8
9
  private frameX;
9
10
  private frameY;
10
11
  private frameWidth;
11
12
  private frameHeight;
12
- private sourceWidth;
13
- private sourceHeight;
13
+ private rotatedInternal;
14
+ private scaleInternal;
14
15
  private trimLeft;
15
16
  private trimRight;
16
17
  private trimTop;
17
18
  private trimBottom;
18
- private scaleInternal;
19
- private dirtyInternal;
19
+ private textureDirtyInternal;
20
+ private uvTransformDirtyInternal;
21
+ private trimDirtyInternal;
20
22
  /** @param config Texture or atlas configuration */
21
23
  constructor(config?: UITextureConfig);
22
24
  /** Original width before trimming in world units */
@@ -35,8 +37,12 @@ export declare class UITextureView extends Eventail {
35
37
  get scale(): number;
36
38
  /** Transparent padding around visible content */
37
39
  get trim(): Readonly<UITextureTrim>;
38
- /** Whether texture has been modified since last check */
39
- get dirty(): boolean;
40
+ get textureDirty(): boolean;
41
+ /** Whether UV transform inputs changed since last check */
42
+ get uvTransformDirty(): boolean;
43
+ /** Whether trim values changed since last check */
44
+ get trimDirty(): boolean;
45
+ setTextureDirtyFalse(): void;
40
46
  /**
41
47
  * Calculates UV transform matrix for shader sampling.
42
48
  * @param result Matrix to store result in
@@ -54,8 +60,6 @@ export declare class UITextureView extends Eventail {
54
60
  * @param config Texture or atlas configuration
55
61
  */
56
62
  set(config: UITextureConfig): void;
57
- /** Resets to default empty texture */
58
- reset(): void;
59
63
  private setFromTexture;
60
64
  private setFromAtlasConfig;
61
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laymur",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "Constraint-based UI library for Three.js mobile advertisements",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",
@@ -1,11 +0,0 @@
1
- import type { UIMicroConfig } from "../miscellaneous/micro/UIMicro.Internal";
2
- import { UITransparencyMode } from "../miscellaneous/UITransparencyMode";
3
- import type { UIDummyOptions } from "./UIDummy.Internal";
4
- /** Configuration options for UIElement */
5
- export interface UIElementOptions extends UIDummyOptions {
6
- /** Transforms that don't affect constraints */
7
- micro: UIMicroConfig;
8
- /** Alpha blending mode */
9
- transparencyMode: UITransparencyMode;
10
- }
11
- export declare const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
@@ -1,7 +0,0 @@
1
- import type { UIColorConfig } from "../miscellaneous/color/UIColor.Internal";
2
- import type { UIElementOptions } from "./UIElement.Internal";
3
- /** Configuration options for UIGraphics */
4
- export interface UIGraphicsOptions extends UIElementOptions {
5
- /** Multiplicative tint */
6
- color: UIColorConfig;
7
- }
@@ -1,7 +0,0 @@
1
- import type { UIColorConfig } from "../miscellaneous/color/UIColor.Internal";
2
- import type { UIElementOptions } from "./UIElement.Internal";
3
- /** Configuration options for UIImage */
4
- export interface UIImageOptions extends UIElementOptions {
5
- /** Multiplicative tint */
6
- color: UIColorConfig;
7
- }
@@ -1,11 +0,0 @@
1
- /** Padding configuration as number, per-side, or per-axis */
2
- export type UIPaddingConfig = {
3
- horizontal: number;
4
- vertical: number;
5
- } | {
6
- left: number;
7
- right: number;
8
- top: number;
9
- bottom: number;
10
- } | number;
11
- export declare const PADDING_DEFAULT_VALUE = 0;