creating 3px border
Hey, I'm kind of starting with Lua and I am in the process of building a UI with Lua only addons. What I mean by that is no in game config.
I was wondering if somebody could help me achieve the look f.e. TukUi or qMinimap achieved. It looks like that A 3px border with black at the outside and grey inside. I looked into the code of qMinimap but I mean nowhere near to understand it. It would really help if someone could explain to me how to achieve this look/ or how qMinimap does it. here some of the border code of qMinimap Atleast I think it is. Code:
local shadows = { |
Yes, it's all there, but to break it down, here's what you'll need to do.
First set the backdrop of the frame to one with a solid texture and a edge size (border size) of 3, and color it black. Code:
f:SetBackdrop({ Code:
local iborder = CreateFrame("Frame", nil, f) |
Ok thanks!
The problem i could see with this that the inner Border would only be black when the main frame is black. Correct me If I'm wrong I haven't tried, yet. |
No, the "inner" border is the gray stripe. The "main" border is 3 pixels wide, and the inner border runs on top, in the middle of that.
|
Hm, nice! Thanks.
I still have a problem though. When I add my Backdrop (for the tooltip in this case, I miss the inner black border.) it looks like this (might have to zoom in to see the borders): This is what my code looks like Code:
local tooltips = { GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2, ShoppingTooltip3, WorldMapTooltip, } |
You should set the main border on the original frame instead creating your own. You don't have to, but in this case the new border frame does not have its points set, so it won't be visible. Since it already has a backdrop, you'll also want to retain the background bit. Try this:
Code:
local tooltips = { GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2, ShoppingTooltip3, WorldMapTooltip, } |
Okay, I'm confused now what my actual backdrop is.
I think Code:
tooltip:SetBackdrop({ Because using my own texture created something wrong, not the actual color of my texture or what I wanted. Edit: Im dumb. Code:
tooltip:SetBackdrop({ |
Ah, yes. SetBackdrop color will multiply the values passed with the colors of the texture. Full white means use original texture colors. I think it will be set to white when you call SetBackdrop, though, so you shouldn't need to SetBackdropColor there.
|
All times are GMT -6. The time now is 12:11 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI