@blorkfield/overlay-core 0.10.0 → 0.10.1
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 +43 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -381,6 +381,26 @@ scene.setEffect({
|
|
|
381
381
|
});
|
|
382
382
|
```
|
|
383
383
|
|
|
384
|
+
### Managing Effects
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
// Pause/resume an effect without removing it
|
|
388
|
+
scene.setEffectEnabled('my-rain', false); // pause
|
|
389
|
+
scene.setEffectEnabled('my-rain', true); // resume
|
|
390
|
+
|
|
391
|
+
// Check if an effect is enabled
|
|
392
|
+
scene.isEffectEnabled('my-rain'); // → true/false
|
|
393
|
+
|
|
394
|
+
// Get effect config
|
|
395
|
+
const effect = scene.getEffect('my-rain'); // → EffectConfig | undefined
|
|
396
|
+
|
|
397
|
+
// List all effect IDs
|
|
398
|
+
const ids = scene.getEffectIds(); // → string[]
|
|
399
|
+
|
|
400
|
+
// Remove an effect entirely
|
|
401
|
+
scene.removeEffect('my-rain');
|
|
402
|
+
```
|
|
403
|
+
|
|
384
404
|
## Managing Objects
|
|
385
405
|
|
|
386
406
|
```typescript
|
|
@@ -820,6 +840,23 @@ scene.setObjectMassOverride(id, 50); // now heavy
|
|
|
820
840
|
scene.setObjectMassOverride(id, null); // restore natural mass
|
|
821
841
|
```
|
|
822
842
|
|
|
843
|
+
### Scale
|
|
844
|
+
|
|
845
|
+
`setObjectScale(id, x, y)` resizes an object at runtime. Both the physics collision shape and sprite rendering are updated together. Scale is absolute — calling `setObjectScale(id, 2, 2)` always doubles the original size regardless of current scale. Scaling also changes body mass proportionally (area scales by x×y); use `setObjectMassOverride` after if you need a fixed mass.
|
|
846
|
+
|
|
847
|
+
```typescript
|
|
848
|
+
// Uniform scale
|
|
849
|
+
scene.setObjectScale(id, 2, 2); // double size
|
|
850
|
+
scene.setObjectScale(id, 0.5, 0.5); // half size
|
|
851
|
+
|
|
852
|
+
// Non-uniform scale (independent x and y)
|
|
853
|
+
scene.setObjectScale(id, 3, 1); // stretch wide, keep height
|
|
854
|
+
scene.setObjectScale(id, 1, 0.5); // squash vertically
|
|
855
|
+
|
|
856
|
+
// Restore original size
|
|
857
|
+
scene.setObjectScale(id, 1, 1);
|
|
858
|
+
```
|
|
859
|
+
|
|
823
860
|
## Examples
|
|
824
861
|
|
|
825
862
|
Working examples are provided in the `/examples` directory:
|
|
@@ -863,6 +900,11 @@ import type {
|
|
|
863
900
|
TTFTextObstacleConfig,
|
|
864
901
|
TextAlign,
|
|
865
902
|
TextBounds,
|
|
903
|
+
LetterDebugInfo,
|
|
904
|
+
|
|
905
|
+
// DOM obstacle types
|
|
906
|
+
DOMObstacleConfig,
|
|
907
|
+
DOMObstacleResult,
|
|
866
908
|
|
|
867
909
|
// Effect types
|
|
868
910
|
EffectConfig,
|
|
@@ -905,5 +947,5 @@ import type {
|
|
|
905
947
|
} from '@blorkfield/overlay-core';
|
|
906
948
|
|
|
907
949
|
// Tag constants (values, not types)
|
|
908
|
-
import { TAGS,
|
|
950
|
+
import { TAGS, TAG_STATIC, TAG_GRABABLE, TAG_FOLLOW_WINDOW, TAG_GRAVITY_OVERRIDE, TAG_SPEED_OVERRIDE, TAG_MASS_OVERRIDE } from '@blorkfield/overlay-core';
|
|
909
951
|
```
|