Welp, I have a 800x440 image of Ragefire Chasm with notes on it. I stuck it in the upper left corner of a 1024x512 tga file. Now I’m trying to use SetTexCoord() to crop the image and only show the map, leaving out the white space. But when I try I get get no image. It only works if I show the full image with whitespace. I guess I don’t fully understand the function. Any help would be appreciated! (There are commented out lines of code as I try different solutions and they don’t work.)
local fgfww = CreateFrame(“Frame”,nil,UIParent)
fgfww:SetFrameStrata(“BACKGROUND”)
fgfww:SetWidth(1024) – Set these to whatever height/width is needed
fgfww:SetHeight(512) – for your Texture
fgfww:SetMovable(true)
fgfww:EnableMouse(true)
fgfww:SetScript(“OnMouseDown”,function()
fgfww:StartMoving()
end)
fgfww:SetScript(“OnMouseUp”,function()
fgfww:StopMovingOrSizing()
end)
– the key to cropping images in wow lua is settexcoord but i cant master it
local fgfww = CreateFrame("Frame", nil, UIParent)
fgfww:SetPoint("CENTER")
fgfww:SetFrameStrata("BACKGROUND")
fgfww:SetSize(1024, 512)
fgfww:SetMovable(true)
fgfww:EnableMouse(true)
fgfww:SetScript("OnMouseDown",function()
fgfww:StartMoving()
end)
fgfww:SetScript("OnMouseUp",function()
fgfww:StopMovingOrSizing()
end)
– the key to cropping images in wow lua is settexcoord but i cant master it
fgfww.Map = fgfww:CreateTexture()
fgfww.Map:SetAllPoints()
fgfww.Map:SetTexture("Interface\\AddOns\\dummyrfc\\rfc-base-map") -- will test for .blp and .tga files
--fgfww.Map:SetTexCoord(0, 0.5, 0, 0.5)
fgfww.Map:SetTexCoord(0, 800/1024, 0, 440/512) -- crop the texture to coords
You can use a addon like Discord Art (or probably KgPanels) to see your map and set/test the coords dynamically to be copied top your addon rather than fiddling with the numbers and a thousand /reloads
No, the coords adjust the image inside the texture widget like a viewport.
Maybe if I had the image I could be a bit more exact. Possibly the coords you are using are wrong which is why I suggested start with something like DART.