• Runtimes
  • Move and Wrap UVS

  • Uređeno
Related Discussions
...

Hi,
with csharp runtime time ago I have solved with this post: XNA moving UV offset: p55419

today the RegionOffsetX do not exits anymore and if I move the Regionuvs the texture don't wrap but move out. Exporting with Wrap option do not solve.
here: MeshAttachment regionOffsetX
the regionOffsetX and updateUVs do not exists in code anymore :-(
Please can you help?
best
Cristian


Update:
I can move the uvs coordinate with
mesh.Region.u
mesh.Region.u2
'mesh.Region.v
'mesh.Region.v2
but I must set
GraphicsDevice.SamplerStates(0) = SamplerState.LinearWrap
or SamplerState.AnisotropicWrap
before begin render.

so I don't quite understand what Wrapx and Wrapy are for, in the export of the editor?
best
Cristian

wrapX and wrapY aren't interpreted by the runtime. Specifically, the XNATextureLoader class, which is called by Atlas when loading atlas pages, does not interpreted the page.uWrap and page.vWrap properties. The reason is that the XNA Texture2D class doesn't allow setting the texture wrap, so XNATextureLoader can't do anything about that.

Instead, this appears to be a global setting on the GraphicsDevice as you've found. The correct place to do this would be in MeshBatcher. For each item it renders, we'd need to set the global sampler state, and also restore it once the rendering is done.

I've opened an issue here:
https://github.com/EsotericSoftware/spine-runtimes/issues/2217

9 dana kasnije