route-graphics 1.24.2 → 1.25.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 CHANGED
@@ -78,6 +78,26 @@ app.render({
78
78
  `createAssetBufferManager()` may keep image and video assets as direct source
79
79
  URLs when possible, while audio and font assets remain buffer-backed.
80
80
 
81
+ Assets loaded by an app instance can be released after no rendered or
82
+ transitioning element still references them:
83
+
84
+ ```javascript
85
+ await app.unloadAssets(["circle-red", "bgm-1"]);
86
+ ```
87
+
88
+ `unloadAssets()` removes renderer cache entries and releases texture, video,
89
+ audio, and font resources owned by that Route Graphics instance. Unknown or
90
+ already-unloaded keys are ignored, shared resources remain alive until their
91
+ last Route Graphics consumer unloads them, and released keys can be loaded
92
+ again.
93
+
94
+ The event handler also receives `rendererContextLost` and
95
+ `rendererContextRestored` lifecycle events. Fallback UI should live outside the
96
+ renderer so it remains available while the graphics context is unavailable.
97
+ WebGPU device loss emits `rendererContextLost`; because a lost WebGPU device is
98
+ not restorable, consumers must recreate the Route Graphics instance rather than
99
+ wait for `rendererContextRestored`.
100
+
81
101
  For complete usage details, go to:
82
102
 
83
103
  - [Getting Started](http://route-graphics.routevn.com/docs/introduction/getting-started/)