Aiue's Quest Tracker (AQT)

Aiue's Quest Tracker (AQT)

21.6k Downloads

Backdrop Vertical tiling

dalesnail opened this issue ยท 2 comments

commented

So I noticed that tiling only seems to work horizontally, but I also noticed that a lot of other addons had the same issues, so I did a little searching to find some answers.

Most people were saying to use custom large textures, but those people didn't have addons with interchangable backgrounds, and too much customization.

So I thought maybe all hope was lost...

But I did happen across this bit:

I ended up figuring it out faster than I thought I would... here's how I got it working:

Code:
local txLines = frame:CreateTexture(nil, "ARTWORK")

-- Note the last argument, true -- I couldn't find this documented, but
-- it's needed. Without the true argument, the tiling doesn't work
txLines:SetTexture([[Interface\AddOns\MyAddon\images\diag-tile]], true)

-- Set to the top/center of my frame, inset by 8 pixels

txLines:SetPoint("TOP", frame, "TOP", 0, -8)  
txLines:SetHeight(32)

-- Set the width to the width of my frame, inset by 8 pixels on each side
txLines:SetWidth(frame:GetWidth() - 16)

-- This is the tricky part. See my note below
txLines:SetTexCoord(0,(frame:GetWidth() / 8), 0,4)
in the SetTexCoord command, I originally thought I was limited between 0 and 1. What I didn't realize is that you can go beyond one. For example:

Code:
txLines:SetTexCoord(0,2,0,1)
This tells it to tile twice along X. So in my code above, I'm getting the frame width and dividing by the width of the tile image.

Voila. Maybe that will help another noob like myself one day... hahah! Or better yet, hopefully Blizzard will fix the SetVertTile and SetHorizTile functions.

Hoping this helps, but to be honest I don't understand most of what he's saying here, so it may be something way out of left field.

commented

Hmm. Yeah, I think the solution there would be to use a texture instead of a backdrop. Sort of like how I did with the artwork.

Which means, that with the current code, changing tiling behaviour of the backdrop, aside from do or don't, would not be possible.

However, it does give me the idea that if I allow for higher values for the zoom sliders, you could tile that one.

I could rewrite how the backdrop uses textures, but right now, it would be too much focus taken from other things, such as variable width, headers being optional, and the like.

commented

Fair enough, I thought this one might be something that would require some legwork to get going, if it was even possible haha.