Quantcast
WoWInterface - View Single Post - using both :SetTexCoord and :SetRotation()
View Single Post
03-26-18, 02:25 AM   #1
saxitoxin
A Wyrmkin Dreamwalker
 
saxitoxin's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 59
using both :SetTexCoord and :SetRotation()

Hi!

I'm trying as the title says to use both :SetTexCoord and :SetRotation() on the same texture


Lua Code:
  1. CREATING FRAMES AND STUFF UP HERE
  2.  
  3. mainFrame.icon = mainFrame:CreateTexture(nil,"OVERLAY",nil,-8)
  4. mainFrame.icon:SetPoint("CENTER")
  5. mainFrame.icon:SetSize(mainFrame:GetWidth()*iconScale, mainFrame:GetWidth()*iconScale)
  6. mainFrame.icon:SetTexture(unpack(cfg.SXwpClassInfo[cfg.classNumber]))
  7.  
  8. mainFrame.icon:SetTexCoord(unpack(cfg.SXwpClassInfoTexCoord[cfg.classNumber]))
  9. mainFrame.icon:SetRotation(math.rad(0))

what I try to do with this code is to first set the coord for the bottom left emblem on THIS image, then I want to rotate it based on a slidervalue (set longer down in the code), but if I use the mainFrame.icon:SetRotation(math.rad(0)) command the image show uncropped

Any way to fix this without using animGroup and rotate
  Reply With Quote