WoWInterface - View Single Post - using both :SetTexCoord and :SetRotation()
View Single Post
03-26-18, 01:03 PM   #4
A Pyroguard Emberseer
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
You can rotate the coordinates that you're sending to SetTexCoord with a matrix transformation (rotation matrix), which takes your input coordinates and rotates them around a central point (the middle of your coordinate pairs).

If you're rotating in 90 degree increments, you can skip doing any math and just shift the coordinates over (they're x,y pairs representing the corners of your texture). By moving the order of the SetTexCoord arguments by 2 you're changing which corner of the texture coordinates is being attached to which corner of your texture object.

This page has some lua examples if you need to rotate by an arbitrary amount, but if this all seems overwhelmingly confusing I would probably just use an animation to do it.

I think SetRotation essentially applies SetTexCoord in the background so I don't know that they can be used together.
  Reply With Quote