WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   TargetFrame SetTextCoords (https://www.wowinterface.com/forums/showthread.php?t=58635)

sirpucna 03-14-21 11:25 PM

TargetFrame SetTextCoords
 
i'm looking for a demonstration on how to cut out a portion of the PlayerFrame/TargetFrame with SetTextCoords as show here:


My intent is to use blizzards texture and not use a custom one to create thick health bar, but doing so without it being obvious(green highlighted square to cut and paste the part below it)

I've seen it done with a addon called Baik UnitFrame Module, but its complexity is far beyond my skills.

d87 03-15-21 06:21 AM

If you want to cut out the green rectangle it'll be something like tex:SetTexCoord(0.1, 0.12, 0.4, 0.45)
That's left, right, top, bottom. And the values are how deep into the image the cut is starting from top left

sirpucna 03-15-21 07:12 AM

thanks for the reply, i uploaded a better picture of the area i want to cut(green), but doing so would leave a ugly mark on the left, so i was thinking using the purple highlighted area to copy and paste this portion of the frame, and drop it down to cover up the mark.

d87 03-15-21 11:46 AM

Then you should use texture mask on the default texture to completely cut out the separator with the sides and then cover the hole with the purple part

Lua Code:
  1. local mask = self:CreateMaskTexture(nil, "BACKGROUND", nil, 0)
  2. mask:SetTexture("Interface\\Addons\\tmask", "CLAMPTOWHITE", "CLAMPTOWHITE")
  3. mask:SetAllPoints(self)
  4. mainTexture:AddMaskTexture(mask)


All times are GMT -6. The time now is 03:02 PM.

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