Mesh and Retina Displays

Hi Codeans,

Am just in the throes of finishing our next game and have created a UI using meshes with a rounded rectangle shader and gradients etc. as panels and buttons

It all works fine on non-retina devices, but on retina devices the mesh rectangles are all half the size and don’t animate in correctly…looks like the coordinates are all off also…

I’m assuming this is to do with WIDTH/HEIGHT being logical resolution, as has been discussed on other posts, but I can’t find anything specific to this problem…

I know that ContentScaleFactor is set to 1.0 or 2.0 depending, but I’m pretty sure that this shouldnt be necessary…

I don’t have a working code snippet yet, hoping for an obvious mistake on my part…

What I am doing is using screen coordinates and dimensions in the shader so it MAY be that the mesh is drawing in the correct position, but the shader values end up out of sync… I guess it’s bad practice to do what I’m doing, passing screen coords into the shader, but it was the only way I could get what I wanted ;))

Regards,
Brookesi

Yes, ignore me, it was exactly that reason, if I scale by ContentScaleFactor what I pass into the shader then it works!!!

Glad we could help.