Scmorr
January 24, 2025, 1:22pm
1
I have two animations: one is started on track 1, while on track 2 I have another animation with go.PLAYBACK_NONE to manually set cursor.
However, “set” interface has no option to point track number:
– Set the cursor to position 0
go.set("#spinemodel ", “cursor”, 0)
So, looks like “set cursor” is possible to use only in case of one animation and one track.
Scmorr
January 24, 2025, 2:31pm
2
Digging in extension cpp code found solution
* -- Get the cursor value for the second animation track
* cursor = go.get("#spine", "cursor", { index = 2 })
Why API reference and other documentation has no this info?
Here are some links for cursor property and an example.
Scmorr
January 24, 2025, 3:04pm
4
All your links have no clue about solution:
cursor = go.set("#spine ", “cursor”, 0.0, { index = 2 })
Actually, first your links are not related to Spine. Third one tells only go.set("#sprite ", “cursor”, 0.0)
I checked as well - no info about additiona param {index = 2} for specifying track index
1 Like
You are right, maybe this information can be added to the properties / cursor section for the spine animation manual.
I don’t know much about spine or the track index
, Maybe someone else can create a PR or an issue on the extension github . The doc is located here:
---
title: Spine animation in Defold
brief: This manual explains how to bring Spine animations from _Spine_ into Defold.
---
# Spine animation
_Spine_ is a third party animation tool by Esoteric Software. Spine animation provides 2D _skeletal animation_ support (see http://en.wikipedia.org/wiki/Skeletal_animation). This is a fundamentally different technique from [flipbook animations](/manuals/flipbook-animation) that is closer to cutout animation. In cutout animation separate pieces of the animated object (e.g body parts, eyes, mouth etc) are moved individually between each frame. Spine animation let you build an invisible, virtual skeleton consisting of a hierarchy of interconnected _bones_. This skeleton, or _rig_, is then animated and individual images are attached to the bones. Defold supports animations created or exported in the [Spine JSON format](http://esotericsoftware.com/spine-json-format). Skeletal animation is very smooth since the engine can interpolate the location of each bone for each frame. It is particularly useful to animate characters and animals, but works very well for other types of objects, like ropes, vehicles or foliage.
{.inline}
{.inline}
## Requirements
### Installation
To use this library in your Defold project, add the needed version URL to your game.project dependencies from [Releases](https://github.com/defold/extension-spine/releases):
{.inline}
This file has been truncated. show original