WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   TidyPlates Totem Widget (https://www.wowinterface.com/forums/showthread.php?t=55401)

Baggyman 05-16-17 07:50 PM

TidyPlates Totem Widget
 
Hey, I am trying to move the "artwork" icon for the TidyPlates Totem Widget. I've tried editing pretty much everything in the below block of code from the lua file, but have not been able to figure it out. I am able to move the overlay just fine, but anytime I try to move the icon either the icon just doesn't move or doesn't show up after the edit.

Specifically I've tried changing the line
frame.Icon:SetPoint("CENTER",frame) to
frame.Icon:SetPoint("CENTER",frame, 1, 20) but that doesn't move the icon, and to frame.Icon:SetPoint("TOP",frame) but that just makes the icon disappear

Any ideas? Really appreciate any help!


Lua Code:
  1. local function CreateTotemIconWidget(parent)
  2.     local frame = CreateFrame("Frame", nil, parent)
  3.     frame:SetWidth(50); frame:SetHeight(50)
  4.  
  5.     frame.Overlay = frame:CreateTexture(nil, "OVERLAY")
  6.     frame.Overlay:SetPoint("CENTER",frame, 1, -1)
  7.     frame.Overlay:SetWidth(20); frame.Overlay:SetHeight(20)
  8.     frame.Overlay:SetTexture(classWidgetPath.."BORDER")
  9.     --frame.Overlay:SetAllPoints(frame)
  10.  
  11.     frame.Icon = frame:CreateTexture(nil, "ARTWORK")
  12.     frame.Icon:SetPoint("CENTER",frame)
  13.     frame.Icon:SetTexCoord(.07, 1-.07, .07, 1-.07)  -- obj:SetTexCoord(left,right,top,bottom)
  14.     --frame.Icon:SetWidth(46); frame.Icon:SetHeight(47)
  15.     frame.Icon:SetAllPoints(frame)
  16.  
  17.     frame:Hide()
  18.     frame.Update = UpdateTotemIconWidget
  19.     return frame
  20. end

Tim 05-16-17 08:10 PM

The reason for your icon not moving is due to you setting all points to the frame. Remove that line and watch the magic happen. :P

Also, you can just obj:SetSize(w, h) instead of obj:SetWidth/SetHeight

Baggyman 05-16-17 11:51 PM

Well that was obvious, thanks man! The worst part is I tried that but it didn't work because I tested it on a totem that wasn't included in the file, so of course the totem icon wouldn't show....


All times are GMT -6. The time now is 07:53 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI