defold (official)extension-spine
defold/extension-spine/spine.resource
Functions for creating Spine resources dynamically
- GitHub: defold/extension-spine — pinned to
4.8.0(released while Defold 1.13.1 was current)- Pick a release from defold/extension-spine releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Call it through the global
resource— no import. It adds members to the engineresourcenamespace.
- Pick a release from defold/extension-spine releases and add its Source code (zip) URL (or a packaged
Functions
resource.create_spinescene(path: string, options: table): hash
Creates a spinescene resource (.spinescenec) from runtime data. Creates a Spine scene resource dynamically at runtime. This allows loading Spine animations from data rather than pre-built assets. The atlas path must reference a compiled .texturesetc resource. The created spinescene is tracked for cleanup when the collection unloads; internal intermediate JSON is removed automatically.
Parameters
path:string— The target resource path. Must end with .spinescenecoptions:table— Table with fieldsspine_data:string— JSON bytes of the Spine skeletonatlas_path:string— Path to the compiled atlas resource (.texturesetc)
Returns
path_hash:hash— canonical path hash of the created resource