Sorry for the late reply! While BoneFollower
based solutions might also include following rotation and scale, it would be a rather difficult setup and requires splitting your text at the folds, which would be a very complicated solution.
Likely the best solution would be to render the text to a RenderTexture
as mentioned above, and overlay it on top of your atlas texture. The workflow is basically to create an additional Camera in your scene and assign a RenderTexture
. Then you point this Camera at the desired UI text to be captured. It's recommended to have the Camera's Culling Mask
set to a special layer (e.g. UI Render Texture
) that you assign at your original text UI objects too, to not display this undeformed text in the main Camera. If you need to change the RenderTexture to a normal Texture2D, you can for sure find some code on the Unity forum, like this posting. The background color of the Camera should be set to black with alpha=0
(fully transparent), to make overlaying the text easier in the next step.
Now how to apply this RenderTexture
on top of your existing skeleton or its atlas texture is a separate issue:
You could either write a copy of an existing Spine shader and adjust it so that it has an additional Texture input parameter. Then you would blend the previous result color with the Text texture color based on the ui text RenderTexture's alpha value, like color = lerp(color, textTextureColor.rgb, textTextureColor.a);
. This however requires some shader coding.
Another approach would be to combine both textures, bake the original atlas texture and the ui text RenderTexture to a single new texture, and use this at your skeleton.
Another (perhaps easier) way would be to render the existing UI mesh again on top of it, with the texture changed from the atlas texture to the ui text RenderTexture.