Change a spine image

Hello,

I’m trying to replace an existing spine image with an arbitrary one at run-time. Anyone have any ideas?

You can change the skin at runtime. See topic #1042

Hey Yannick, thank you for the reply. Unfortunately I cannot use skins as this is an arbitrary image that is generated at run-time.

I’m kind of hoping there is a way I can just set the bitmap data of the previous image… the new image has the same width and height.

Bump in hopes the right person sees this.

does it have duplicates? you can access generated items
through this.scene.scene.children.list
(i think, not sure if there is better solution as im also still new)
try console.log(this.scene.scene.children.list) and maybe you can find the unique data to identify your element/sprite
if the sprite has a unique key

let spritewithkeyname = this.scene.scene.children.list[this.scene.scene.children.list.findIndex(obj => obj.frame.texture.key == "keyname")]

man sorry I don’t know, i misread spine as sprite… time to sleep i guess

Red, thank you for the reply! I do have access to the image as a texture (As well as its’ image data and context.). My main issue is popping that texture into Spine’s display list for rendering.

1 Like