Download

Moving a UV via script at runtime? ...Making a full deck of playing cards from a texture sheet

Hi. I am trying to create a deck of playing cards. The rear face is of course the same for every card and was simple to add the texture in Maya and import to UE4. But for the face I have a texture sheet which contains all the card faces. The UV map I created for this just sits over the Ace card.

My Playing_Card class works great (ie. it knows what card it is, how much value the card is and has some other properties like a string to type the card. But until now I have no experience in actually creating the graphics, which is what led me to UE4 in the first place)

So the UV map covers just the Ace, I need a way at runtime to move that UV to a new location depending on which value card we are looking at.

I hope that makes sense… I have already found some nodes in Material Editor that I found of interest but cannot seem to do what I need. The nodes I’ve tried are TexCoord and UVCropping. The first seems to be purely for tiling a texture, and the UV Cropping I have been unable to even figure out how to work it.

Any help would be amazing. Thanks

TextureSheet that I’m working with , just for reference: