The spine-cpp runtime is a generic runtime. Are you use a game toolkit or your own framework for rendering?
Here is a section on creating attachments at runtime:
Runtime Skins - Spine Runtimes Guide: Creating attachments
It may help to look at how SkeletonJson or SkeletonBinary creates an attachment:
spine-runtimes/SkeletonJson.cpp at 3.8
You can do the same, probably providing your own AtlasRegion instead of having the AttachmentLoader do it. This is the part the AtlasAttachmentLoader does:
spine-runtimes/AtlasAttachmentLoader.cpp at 3.8
A simpler solution may be to replace the AtlasRegion for attachments that you setup in Spine. You could use Skeleton getAttachment
, then set the renderer object to a different AtlasRegion and also set the RegionAttachment uvs
, as shown in the AtlasAttachmentLoader above.
The above would be how to do it using the Spine Runtimes APIs, which has the benefits that your image is a real Spine attachment, so it can participate in draw order, be affected by weights, etc. If you want an even simpler solution, you can draw your skeleton, then get the world transform (eg the position and rotation) of a bone (or point attachment) and draw images at that location. That drawing would be completely on top of your skeleton, but may be sufficient for your needs.