• Runtimes
  • XNA moving UV offset

  • Modificato
Related Discussions
...

Hi,
with xna runtime, is it possible to move the UV code of the texture?
for example if I do a rectangle mesh with water, I wish I could move vertically the texture UV from xna runtime code, for create an animation
is it possibile?
regards
Cristian

You cannot currently key the UVs in the Spine editor but yes, you can manipulate any of the skeletal data at runtime, including the UVs. Eg, use Skeleton getAttachment to get a MeshAttachment, which has RegionU/V/U2/V2:
spine-runtimes/MeshAttachment.cs at 3.8
You'll likely need to use a texture that can be wrapped (ie not a region in a texture atlas).

Hi Nate,
thanks, it would be enough for me to be able to do it at runtime.
I do test, if I'm in trouble I'll ask you a little help ;-)


ok I need I little help
take for example spineboy-pro, (ok the texture of head it is not suitable for wrap),

sorry I use vbnet instead c#

Dim mesh As MeshAttachment
        Dim test As String
        test = headSlot.Attachment.Name
        mesh = skeleton.GetAttachment(test, "head")
        Debug.Write(mesh.RegionU)
        mesh.RegionU += 0.1
        mesh.RegionU2 += 0.1
        mesh.RegionV += 0.1

'I must update?

    state.Apply(skeleton)
    skeleton.UpdateWorldTransform()

is this right? I miss to update something? if I move vertices it's work but not uv
regards

Cristian


UPDATE:
i miss

mesh.UpdateUVs() 

good olso RegionOffsetX, it's solved very well 😃

solved

PS: it is not possible to change the thread title, otherwise I would add the suffix [SOLVED]

Glad you got it worked out! 🙂