Gui.set_spine_scene is not work while bundle to apk

I had a chance to look more closely at the code you posted;

local combo_node = gui.get_node('combo')
gui.set_enabled(combo_node, true)			
gui.set_spine_scene(combo_node, hash('combo3'))
gui.set_spine_skin(combo_node, hash("default")) -- [1]
gui.set_spine_cursor(combo_node, 1) -- [2]
gui.play_spine_anim(combo_node, 'animation', gui.PLAYBACK_ONCE_FORWARD)

[1]: There is no need to set the default skin it will be set implicitly when setting the spine scene. Just remove that line and it should work as intended. I agree though that it should work to set the default skin explicitly like this, added ticket DEF-3070.

[2]: Setting the spine cursor to 1 will place the cursor at the end of the animation, luckily enough the call to gui.set_spine_cursor only works on the currently playing animation. Since there is no animation playing when it is called it won’t have any effect. This line can also be removed.

Side note: If you want to offset the starting position for the cursor, it can be passed as an argument to gui.play_spine_anim instead, see docs: https://www.defold.com/ref/gui/#gui.play_spine_anim:node-animation_id-playback--play_properties---complete_function-

3 Likes