Thread Tools Display Modes
05-16-17, 07:50 PM   #1
Baggyman
A Deviate Faerie Dragon
Join Date: Jan 2016
Posts: 12
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

Last edited by Baggyman : 05-16-17 at 07:59 PM.
  Reply With Quote
05-16-17, 08:10 PM   #2
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
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
  Reply With Quote
05-16-17, 11:51 PM   #3
Baggyman
A Deviate Faerie Dragon
Join Date: Jan 2016
Posts: 12
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....
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » TidyPlates Totem Widget

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off