laymur 0.27.1 → 0.29.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/README.md +99 -5
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +14 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +40 -6
- package/dist/core/constraints/UICustomConstraint.js +2 -2
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +3 -2
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +3 -2
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +3 -2
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +3 -2
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +6 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +8 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +3 -2
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +3 -2
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +3 -2
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +3 -2
- package/dist/core/constraints/constraintAsserts.d.ts +41 -0
- package/dist/core/constraints/constraintAsserts.js +171 -0
- package/dist/core/elements/UICanvasElement/UICanvasElement.d.ts +54 -0
- package/dist/core/elements/UICanvasElement/UICanvasElement.js +70 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +2 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +8 -5
- package/dist/core/elements/UIDummy/UIDummy.js +24 -11
- package/dist/core/elements/UIElement/UIElement.Internal.d.ts +6 -5
- package/dist/core/elements/UIElement/UIElement.Internal.js +0 -4
- package/dist/core/elements/UIElement/UIElement.d.ts +12 -6
- package/dist/core/elements/UIElement/UIElement.js +14 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +42 -2
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +2 -2
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +48 -34
- package/dist/core/elements/UIGraphics/UIGraphics.js +196 -93
- package/dist/core/elements/UIImage/UIImage.d.ts +11 -1
- package/dist/core/elements/UIImage/UIImage.js +14 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +10 -1
- package/dist/core/elements/UIScene/UIScene.Internal.js +1 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +11 -1
- package/dist/core/elements/UIScene/UIScene.js +29 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Internal.d.ts +14 -1
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +9 -4
- package/dist/core/elements/UIText/UIText.Measuring.js +17 -6
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +7 -16
- package/dist/core/elements/UIText/UIText.Rendering.js +212 -46
- package/dist/core/elements/UIText/UIText.d.ts +64 -29
- package/dist/core/elements/UIText/UIText.js +134 -149
- package/dist/core/index.d.ts +10 -4
- package/dist/core/index.js +5 -1
- package/dist/core/layers/UILayer/UILayer.d.ts +17 -3
- package/dist/core/layers/UILayer/UILayer.js +35 -4
- package/dist/core/layers/UIViewportLayer/UIViewportLayer.d.ts +2 -0
- package/dist/core/layers/UIViewportLayer/UIViewportLayer.js +4 -1
- package/dist/core/miscellaneous/UIBlendMode.d.ts +5 -0
- package/dist/core/miscellaneous/UIBlendMode.js +7 -0
- package/dist/core/miscellaneous/asserts.d.ts +0 -41
- package/dist/core/miscellaneous/asserts.js +0 -170
- package/dist/core/miscellaneous/canvas-surface/UICanvasSurface.d.ts +46 -0
- package/dist/core/miscellaneous/canvas-surface/UICanvasSurface.js +86 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +17 -0
- package/dist/core/miscellaneous/color/UIColor.js +22 -0
- package/dist/core/miscellaneous/color/canvasColor.d.ts +9 -0
- package/dist/core/miscellaneous/color/canvasColor.js +15 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +15 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +10 -7
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +11 -8
- package/dist/core/miscellaneous/paint/UIGradient.Internal.d.ts +37 -0
- package/dist/core/miscellaneous/paint/UIGradient.Internal.js +14 -0
- package/dist/core/miscellaneous/paint/UIGradient.d.ts +18 -0
- package/dist/core/miscellaneous/paint/UIGradient.js +35 -0
- package/dist/core/miscellaneous/paint/UILinearGradient.d.ts +14 -0
- package/dist/core/miscellaneous/paint/UILinearGradient.js +22 -0
- package/dist/core/miscellaneous/paint/UIPaint.Internal.d.ts +21 -0
- package/dist/core/miscellaneous/paint/UIPaint.Internal.js +1 -0
- package/dist/core/miscellaneous/paint/UIPaint.d.ts +17 -0
- package/dist/core/miscellaneous/paint/UIPaint.js +21 -0
- package/dist/core/miscellaneous/paint/UIRadialGradient.d.ts +18 -0
- package/dist/core/miscellaneous/paint/UIRadialGradient.js +33 -0
- package/dist/core/miscellaneous/shared.d.ts +14 -0
- package/dist/core/miscellaneous/shared.js +11 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +91 -30
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +12 -8
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +41 -63
- package/dist/core/miscellaneous/text-style/UITextStyle.js +165 -291
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +2 -1
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +12 -3
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +1 -2
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +7 -3
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +2 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +19 -10
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +6 -2
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +41 -9
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +97 -35
- package/dist/particles/behaviorModules/UIBehaviorAlignToVelocity.d.ts +44 -0
- package/dist/particles/behaviorModules/UIBehaviorAlignToVelocity.js +75 -0
- package/dist/particles/behaviorModules/UIBehaviorBounce.d.ts +51 -0
- package/dist/particles/behaviorModules/UIBehaviorBounce.js +107 -0
- package/dist/particles/behaviorModules/UIBehaviorOrbit.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorOrbit.js +73 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +7 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +9 -5
- package/dist/particles/behaviorModules/UIBehaviorSeek.d.ts +38 -0
- package/dist/particles/behaviorModules/UIBehaviorSeek.js +75 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +48 -1
- package/dist/particles/elements/UIEmitter.Internal.js +26 -1
- package/dist/particles/elements/UIEmitter.Schedule.d.ts +31 -0
- package/dist/particles/elements/UIEmitter.Schedule.js +81 -0
- package/dist/particles/elements/UIEmitter.d.ts +79 -9
- package/dist/particles/elements/UIEmitter.js +241 -83
- package/dist/particles/index.d.ts +13 -1
- package/dist/particles/index.js +11 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +6 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +27 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +7 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +12 -1
- package/dist/particles/miscellaneous/miscellaneous.d.ts +22 -0
- package/dist/particles/miscellaneous/miscellaneous.js +38 -0
- package/dist/particles/renderingModules/UIRenderingFlipbook.d.ts +41 -0
- package/dist/particles/renderingModules/UIRenderingFlipbook.js +70 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +2 -1
- package/dist/particles/renderingModules/UIRenderingModule.js +2 -1
- package/dist/particles/renderingModules/UIRenderingRandomColor.d.ts +19 -0
- package/dist/particles/renderingModules/UIRenderingRandomColor.js +28 -0
- package/dist/particles/renderingModules/UIRenderingShape.d.ts +31 -0
- package/dist/particles/renderingModules/UIRenderingShape.js +54 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +1 -1
- package/dist/particles/renderingModules/UIRenderingTexture.js +4 -28
- package/dist/particles/shaders/UIRenderingFlipbook.d.ts +5 -0
- package/dist/particles/shaders/UIRenderingFlipbook.js +19 -0
- package/dist/particles/shaders/UIRenderingRandomColor.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingRandomColor.js +10 -0
- package/dist/particles/shaders/UIRenderingShape.d.ts +6 -0
- package/dist/particles/shaders/UIRenderingShape.js +15 -0
- package/dist/particles/shaders/UIRenderingTexture.d.ts +4 -2
- package/dist/particles/shaders/UIRenderingTexture.js +27 -2
- package/dist/particles/spawnModules/UISpawnCircle.d.ts +44 -0
- package/dist/particles/spawnModules/UISpawnCircle.js +81 -0
- package/dist/particles/spawnModules/UISpawnRadialVelocity.d.ts +37 -0
- package/dist/particles/spawnModules/UISpawnRadialVelocity.js +75 -0
- package/package.json +1 -1
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { UIPaint, UIPaintConfig } from "../paint/UIPaint.Internal.js";
|
|
2
|
+
import type { UITextAlign, UITextFontStyle, UITextFontWeight, UITextPaintBox, UITextShadow, UITextShadowConfig, UITextStroke, UITextStrokeConfig, UITextStyleConfig } from "./UITextStyle.Internal.js";
|
|
3
|
+
/**
|
|
4
|
+
* Text style of a span or of a whole text. Properties left undefined are taken from the
|
|
5
|
+
* fallback style, the common style of the text for a span, then from the defaults. Lists of
|
|
6
|
+
* strokes and shadows are taken as a whole.
|
|
7
|
+
*/
|
|
3
8
|
export declare class UITextStyle {
|
|
4
|
-
private
|
|
5
|
-
private alignInternal?;
|
|
6
|
-
private fontFamilyInternal?;
|
|
7
|
-
private fontSizeInternal?;
|
|
8
|
-
private fontStyleInternal?;
|
|
9
|
-
private fontWeightInternal?;
|
|
10
|
-
private lineHeightInternal?;
|
|
11
|
-
private enableShadowInternal?;
|
|
12
|
-
private shadowOffsetXInternal?;
|
|
13
|
-
private shadowOffsetYInternal?;
|
|
14
|
-
private shadowBlurInternal?;
|
|
15
|
-
private shadowColorInternal?;
|
|
16
|
-
private enableStrokeInternal?;
|
|
17
|
-
private strokeColorInternal?;
|
|
18
|
-
private strokeThicknessInternal?;
|
|
9
|
+
private readonly values;
|
|
19
10
|
private dirtyInternal;
|
|
20
11
|
/** @param config Partial style configuration. Unspecified properties remain undefined. */
|
|
21
12
|
constructor(config?: Partial<UITextStyleConfig>);
|
|
22
|
-
/**
|
|
23
|
-
get color():
|
|
13
|
+
/** Color or gradient of the glyphs. A color is kept as a CSS string. */
|
|
14
|
+
get color(): UIPaint | undefined;
|
|
15
|
+
/** Box the gradients of the fill and of the strokes are laid over */
|
|
16
|
+
get paintBox(): UITextPaintBox | undefined;
|
|
24
17
|
/** Text alignment */
|
|
25
18
|
get align(): UITextAlign | undefined;
|
|
26
19
|
/** Font family name */
|
|
@@ -28,57 +21,41 @@ export declare class UITextStyle {
|
|
|
28
21
|
/** Font size in pixels */
|
|
29
22
|
get fontSize(): number | undefined;
|
|
30
23
|
/** Font style */
|
|
31
|
-
get fontStyle():
|
|
24
|
+
get fontStyle(): UITextFontStyle | undefined;
|
|
32
25
|
/** Font weight */
|
|
33
|
-
get fontWeight():
|
|
34
|
-
/** Line height in pixels */
|
|
26
|
+
get fontWeight(): UITextFontWeight | undefined;
|
|
27
|
+
/** Line height in pixels, the distance between baselines */
|
|
35
28
|
get lineHeight(): number | undefined;
|
|
36
|
-
/**
|
|
37
|
-
get
|
|
38
|
-
/**
|
|
39
|
-
get
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
get shadowColor(): string | undefined;
|
|
46
|
-
/** Whether stroke is enabled */
|
|
47
|
-
get enableStroke(): boolean | undefined;
|
|
48
|
-
/** Stroke color */
|
|
49
|
-
get strokeColor(): string | undefined;
|
|
50
|
-
/** Stroke thickness in pixels */
|
|
51
|
-
get strokeThickness(): number | undefined;
|
|
52
|
-
set color(value: string | undefined);
|
|
29
|
+
/** Outlines from the innermost to the outermost */
|
|
30
|
+
get strokes(): readonly UITextStroke[] | undefined;
|
|
31
|
+
/** Shadows and glows, the first one on top */
|
|
32
|
+
get shadows(): readonly UITextShadow[] | undefined;
|
|
33
|
+
/** Color or gradient of the glyphs. A string is a `UIColor` name or a CSS color. */
|
|
34
|
+
set color(value: UIPaintConfig | undefined);
|
|
35
|
+
/** Box the gradients of the fill and of the strokes are laid over */
|
|
36
|
+
set paintBox(value: UITextPaintBox | undefined);
|
|
37
|
+
/** Text alignment */
|
|
53
38
|
set align(value: UITextAlign | undefined);
|
|
39
|
+
/** Font family name */
|
|
54
40
|
set fontFamily(value: string | undefined);
|
|
41
|
+
/** Font size in pixels */
|
|
55
42
|
set fontSize(value: number | undefined);
|
|
56
|
-
|
|
57
|
-
set
|
|
43
|
+
/** Font style */
|
|
44
|
+
set fontStyle(value: UITextFontStyle | undefined);
|
|
45
|
+
/** Font weight */
|
|
46
|
+
set fontWeight(value: UITextFontWeight | undefined);
|
|
47
|
+
/** Line height in pixels, the distance between baselines */
|
|
58
48
|
set lineHeight(value: number | undefined);
|
|
59
|
-
set enableShadow(value: boolean | undefined);
|
|
60
|
-
set shadowOffsetX(value: number | undefined);
|
|
61
|
-
set shadowOffsetY(value: number | undefined);
|
|
62
|
-
set shadowBlur(value: number | undefined);
|
|
63
|
-
set shadowColor(value: string | undefined);
|
|
64
|
-
set enableStroke(value: boolean | undefined);
|
|
65
|
-
set strokeColor(value: string | undefined);
|
|
66
|
-
set strokeThickness(value: number | undefined);
|
|
67
49
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @param fallback Second style to check if primary is undefined
|
|
71
|
-
* @returns Complete style configuration with all defaults applied
|
|
50
|
+
* Outlines from the innermost to the outermost. Each one lies outside the previous one. An
|
|
51
|
+
* empty list draws no outline, undefined takes the outlines of the fallback style.
|
|
72
52
|
*/
|
|
73
|
-
|
|
53
|
+
set strokes(value: readonly UITextStrokeConfig[] | undefined);
|
|
74
54
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* The shadow is cast by the stroke as well as by the fill.
|
|
78
|
-
* @param style Resolved style
|
|
79
|
-
* @returns Padding in pixels needed on all sides
|
|
55
|
+
* Shadows and glows, the first one on top. An empty list draws no shadow, undefined takes the
|
|
56
|
+
* shadows of the fallback style.
|
|
80
57
|
*/
|
|
81
|
-
|
|
58
|
+
set shadows(value: readonly UITextShadowConfig[] | undefined);
|
|
82
59
|
/** Sets all properties to default values */
|
|
83
60
|
setDefaults(): void;
|
|
84
61
|
/** Sets all properties to undefined */
|
|
@@ -86,11 +63,12 @@ export declare class UITextStyle {
|
|
|
86
63
|
/** Copies from another style instance */
|
|
87
64
|
copy(value: UITextStyle): void;
|
|
88
65
|
/**
|
|
89
|
-
* Calculates
|
|
66
|
+
* Calculates the padding needed on every side for outlines and shadows.
|
|
90
67
|
* Properties left undefined here are taken from `fallback`, then from defaults,
|
|
91
|
-
* so a span style is measured with the
|
|
68
|
+
* so a span style is measured with the outlines and shadows it is drawn with.
|
|
92
69
|
* @param fallback Style that supplies undefined properties (usually the common style)
|
|
93
|
-
* @returns Padding in pixels
|
|
70
|
+
* @returns Padding in pixels
|
|
94
71
|
*/
|
|
95
72
|
calculatePadding(fallback?: UITextStyle): number;
|
|
73
|
+
private setValue;
|
|
96
74
|
}
|