The SpineModel component is used to bring Spine skeletal animations to life in Defold.
Select a game object to hold the new component:
Either create the component in-place (right click the game object and select Add Component ▸ Spine Model)
Or create it on file first (right click a location in the Assets browser, then select New... ▸ Spine Model from the context menu), then add the file to the game object by right clicking the game object and selecting Add Component File).
Apart from the properties Id, Position and Rotation the following component specific properties exist:
Alpha, change this property.
You should now be able to view your Spine model in the editor:
The Blend Mode property defines how the component graphics should be blended with the graphics behind it. These are the available blend modes and how they are calculated:
src.a * src.rgb + (1 - src.a) * dst.rgb
src.rgb + dst.rgb
src.rgb * dst.rgb
src.rgb - dst.rgb * dst.rgb
You can manipulate spine models in runtime through a number of different functions and properties (refer to the API docs for usage).
Defold provides powerful support for controlling animation in runtime. Refer to the spine animation manual to learn more.
A spine model also has a number of different properties that can be manipulated using
hash) (READ ONLY). You change animation using
spine.play_anim()(see the spine animation manual).
hash). You can change this using a material resource property and
go.set(). Refer to the API reference for an example.
go.set("#spine", "tint", vmath.vector4(1,0,0,1)) go.animate("#spine", "tint", go.PLAYBACK_LOOP_PINGPONG, vmath.vector4(1,0,0,1), go.EASING_LINEAR, 2)
vector4). The vector4 is used to represent the tint with x, y, z, and w corresponding to the red, green, blue and alpha tint.
The game.project file has a few project settings related to spine models.