



> yorigin: The y origin for the image being used. > xorigin: The x origin for the image being used. > ind: The image_index to get the attachment image from. > sprite: The sprite_index to get the attachment image from. > name: The name (as a string) of the attachment to create. When you pass a sprite index in as an argument, it will create an attachment slot using the name of the sprite as the string to name the slot (so using spr_sword, for example, will create an attachment slot "spr_sword"), and the slot will use the first image index (0) of the sprite, as well as its x and y origin offset, with a scale of (1,1) and a rotation of 0. Note that you can also pass a sprite_index in as the attachment, and that sprite will be used, or you can use -1 to remove the attachment from the slot. These names are defined by the animation program used, or (in the case of the attachment) when you call skeleton_attachment_create. With this function, you can set an attachment to a given slot, where you are required to give the names (as strings) of the slot and the attachment. > attachment: The name (as a string or a sprite_index ) of the attachment image.Ī skeletal animation sprite may have other images added as attachments, with these images being added to a named slot (the name is given when you create the attachment slot in your animation program) and they will be drawn along with the animation of the current sprite. > slot: The slot name (a string) to get the attachment of. You should also make sure to have a key frame at the beginning of every animation to prevent data from being held-over from previous animations, unless you plan on using separate animation tracks. If this is not the desired behavior, then you can set a "mix" value using skeleton_animation_mix and when you set a new animation, it'll be smoothly interpolated with the previous set. Note that setting a new animation in this way will reset the image_index to 0, starting the new animation set from the beginning of it animation loop. For example, if your sprite is for a platform game, then you may have a "jump" set, a "run" set and an "idle" set all contained within the one sprite and you can switch between them in the game using this function. These names are what you'll use to tell GMS2 which animation set to use at any time in the game. When you created your sprite (in Spine), you'll have defined multiple animations sets for different states and named each of them appropriately. Once you have assigned a skeletal animation sprite to your instance, you can then define which animation set it should use at any given time with this function. animname: The name (a string) of the animation set to use.
