WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Released AddOns (https://www.wowinterface.com/forums/forumdisplay.php?f=9)
-   -   LitePanels - An art framework (https://www.wowinterface.com/forums/showthread.php?t=25283)

Katae 07-08-09 01:55 PM

LitePanels

This is the official discussion thread for LitePanels. Feel free to submit your own scripts, layouts, or general questions here. Please use the addon's comments for bug reporting and feature requests.

What is LitePanels exactly?
It's basically a framework for quickly building and editing panel art and scripts from a layout file. LitePanels has no GUI configuration. Full documentation is provided in the default layout.lua file.

Who should use it?
UI compilation authors, anyone who wants a more open way to edit layouts, or anyone with a slight programming background or willing to learn.

There's a slight learning curve, but once understood what a layout should look like, panels can be created quickly and shared easily.

Tutorials
» Getting Started
» Using Art Textures and Viewport
» Gradients, Text, and Script Examples

Plugins
» LiteStats - Conceptual data text addon.

User Scripts, UIs
» Skarj: Skaarj UI
» bluenjoy: BluenJoyUI
» Aesh: NeoClassic
» Minerv: KUI
» Dajova: Dajova UI mini
» Katae: Buff Watch

Please notify me to add your link to this list.

Development by myself has ceased, any interested individuals may fork me @ github to fix bugs or update patch compatibility.

Katae 07-08-09 07:29 PM

Gradients with a stats display



I'll start with some scripts I've been using. This is the same layout code I used for the stats display, copy and paste this into the default or your character's profile. This also demonstrates the built-in class coloring.

If you want to only use the gradient box, you could remove the stats panel (name = "Stats") and tweak the dimensions, locations, and colors. (Font in the screenshot is 04B_03)

Code:

lpanels:CreateLayout("Stats", {
    -- Stat Container
    {    name = "Container",
        anchor_to = "TOP",
        width = 280, height = 20,
        x_off = 0, y_off = -30,
        bg_alpha = 0,
    },
    -- Left mid-section of the box
    {    name = "BoxL", parent = "Container",
        anchor_to = "LEFT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.2,
    },
    -- Right mid-section
    {    name = "BoxR", parent = "Container",
        anchor_to = "RIGHT",
        width = "50%", height = "100%",
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.2, gradient_alpha = 0,
    },
    -- Top Left gradient line
    {    name = "LineTL",
        parent = "BoxL", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Top right line
    {    name = "LineTR",
        parent = "BoxR", anchor_to = "TOP",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Bottom left line
    {    name = "LineBL",
        parent = "BoxL", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0, gradient_alpha = 0.8,
    },
    -- Bottom right line
    {    name = "LineBR",
        parent = "BoxR", anchor_to = "BOTTOM",
        width = "100%", height = 1,
        gradient = "H",
        bg_color = "CLASS", gradient_color = "CLASS",
        bg_alpha = 0.8, gradient_alpha = 0,
    },
    -- Text display
    {    name = "Stats", parent = "Container",
        anchor_to = "CENTER", anchor_from = "CENTER",
        text = {
            string = function()
                -- monies
                local gold = format("%.1f|cffffd700g|r",GetMoney()/10000)

                -- durability
                local durability = 100
                for i = 1, 11 do
                    if GetInventoryItemDurability(i) ~= nil then
                        local dur, max = GetInventoryItemDurability(i)
                        local perc = dur / max * 100
                        if perc < durability then
                            durability = floor(perc)
                        end
                    end
                end

                -- fps
                local fps = floor(GetFramerate())

                -- memory
                local memory = 0
                UpdateAddOnMemoryUsage()
                for i = 1, GetNumAddOns() do
                    if IsAddOnLoaded(i) then
                        memory = memory + GetAddOnMemoryUsage(i)
                    end
                end
                memory = format("%.1f", memory/1024)

                -- latency
                local latency = select(3,GetNetStats())

                return format(":: %s :: %s%%dur :: %sfps :: %smB :: %sms ::", gold, durability, fps, memory, latency)
            end, update = 1,
            size=10, shadow=1, font = "Fonts\\FRIZQT__.TTF",
        }
    }
}); lpanels:ApplyLayout(nil, "Stats")

Afker "mod"



If you're like me and you have auto-clear afk turned off, you may sometimes unintentionally spam your friends. This functionality is much like LazyAFK.

Whether this is useful for you or not, I'm hoping to demonstrate how simple addons can be created with relative ease using this framework. Also note that you may create multiple text objects per frame.

Code:

lpanels:CreateLayout("Afker", {
    {    name = "AFK", anchor_to = "TOP", y_off = -210,
        bg_alpha = 0.5, width = 200, height = 75,
        border = "SOLID", border_color = "1 1 0",
        text = {
        -- "YOU ARE AFK!"
            {    string = "You are AFK!", anchor_to = "TOP", y_off = -10,
                shadow=1, font = "Fonts\\FRIZQT__.TTF", size=14,
            },
            -- "0:00" TIMER
            {    string=function()
                    if afk_timer then
                        local secs = mod(time() - afk_timer, 60)
                        local mins = floor((time() - afk_timer) / 60)
                        return format("%s:%02.f", mins, secs)
                    end
                end, update=0.1,
                shadow=1, font = "Fonts\\FRIZQT__.TTF", size=16,
                anchor_to = "CENTER", color = "1 0.3 0.3"
            },
            -- "RIGHT CLICK TO HIDE"
            {    string="Right click to hide.", anchor_to="BOTTOM", y_off = 10,
                shadow=1, size=8, font = "Fonts\\FRIZQT__.TTF",
            }
        },
        OnLoad = function(self)
            self:RegisterEvent("PLAYER_FLAGS_CHANGED")
            self:Hide()
        end,
        OnEvent = function(self)
            if UnitIsAFK("player") and not afk_timer then
                self.text2:SetText("0:00")
                afk_timer = time()
                self:Show()
            elseif not UnitIsAFK("player") then
                self:Hide()
                afk_timer = nil
            end
        end,
        OnClick = function(self, b)
            self:Hide()
            if b == "LeftButton" then SendChatMessage("", "AFK") end
        end,
        OnEnter = function(self) self.bg:SetTexture(.1,.1,.1,.5) end,
        OnLeave = function(self) self.bg:SetTexture(0,0,0,.5) end
    }
}); lpanels:ApplyLayout(nil, "Afker")

Whether or not these "addons" are useful to you, I would hope you get the feel for how panel codes should be set up.

Cralor 07-08-09 08:16 PM

Nice addon here.

Your AFK example looks a lot like my LazyAFK. I like it! :D

Katae 07-08-09 09:15 PM

Quote:

Originally Posted by Cralor (Post 146501)
Nice addon here.

Your AFK example looks a lot like my LazyAFK. I like it! :D

Thanks, I really like the idea behind LazyAFK, it gave me the inspiration :)

zerodark9 07-10-09 07:25 AM

I guess i'm too new to messing around with the UI to know how exactly to make this work. I have read the documentation but still am very lost.

Would it be possible for you to post your complete lua file so I may see what you did where. That way I have something to go one instead of being completely in the dark.

Katae 07-10-09 05:42 PM

Quote:

Originally Posted by zerodark9 (Post 146663)
I guess i'm too new to messing around with the UI to know how exactly to make this work. I have read the documentation but still am very lost.

Would it be possible for you to post your complete lua file so I may see what you did where. That way I have something to go one instead of being completely in the dark.

Hi zerodark! First, you'll need to create a layout. To create one, your layout.lua file will start out looking much like this:

Code:

lpanels:CreateLayout("LayoutName", {
    -- Panel code for this layout will go right here.
}, { bottom = 150, top = 10 }) -- Optional viewport config

This is what a basic layout code looks like. Creating a layout alone will not apply it, you'll need to add that. The first string is the profile, strings after the profile are the names of your layouts you want to apply to the profile. If the profile string is nil, the layouts will be applied to ALL characters. Here's a basic profile you can use for unique characters.
Code:

lpanels:ApplyLayout("n:yourchar r:yourrealm", "LayoutName", "AnotherLayout")
ApplyLayout can be used for as many profiles you need. The profile string is very flexible and NOT case-sensitive, please see the included docs for more examples. Note that all spaces in the realm name must be removed.

Next, you'll want to start making your panels. Lets say, for example, you want to make a black bar at the bottom of your UI. You would use something like this panel code inside of your layout, between the first set of {curly braces}:

Code:

{  name = "BlackBar",    -- names your panel "BlackBar"
    anchor_to = "BOTTOM",    -- positions it at the bottom of the UI
    y_off = 20,        -- moves the whole panel 5 pixels UP
    width = "100%",        -- sets the width to 100% of the UI
    height = 30,        -- sets the height to 30 pixels
    bg_color = "0 0 0",    -- sets the background color to black (r g b)
    bg_alpha = 0.5,        -- sets the transparency to 50% opaque
},

Great, now maybe you'd like to put a 1 pixel border on the top and bottom of that panel, perhaps you want the color to be of your class. Now your layout will begin to start looking something like this:

Code:

-- Your original black bar panel
{  name = "BlackBar",
    anchor_to = "BOTTOM", y_off = 20,
    width = "100%", height = 30,
    bg_color = "0 0 0", bg_alpha = 0.4,
},

-- Your new 1 pixel borders, first on the top, second on the bottom of BlackBar
{  name = "BorderTop", parent = "BlackBar",
    anchor_to = "TOP", -- Anchoring to the TOP of "BlackBar"
    width = "100%", height = 1,
    bg_color = "CLASS", bg_alpha = 0.75,
},
{  name = "BorderBottom", parent = "BlackBar",
    anchor_to = "BOTTOM", -- Anchoring to the BOTTOM of "BlackBar"
    width = "100%", height = 1,
    bg_color = "CLASS", bg_alpha = 0.75,
},

Reminder, always always always, put a comma after your closing brackets and attribute values like I have done in the examples. This is probably the top syntax error of all time.

If all was done correctly, you should now have a bar with 2 borders that looks like this.



You'll use other attributes from the documentation such as gradients and textures much the same way. You should also note that every single panel attribute has a default value, which are noted in the docs.

Hope this has cleared up some things for you!

Katae 07-10-09 08:43 PM

Quote:

Originally Posted by cbuck (Post 146734)
Might someone post an example of how to use textures in a panel? The code looks something like this:

Code:

["Player - Realm"] = {
        {        name = "BoxesRFun",
                width = 512, height = 512,
                tex_file ["texture.tga"],
        },
},


It should be tex_file="texture.tga" if texture.tga is in the media folder.

cbuck 07-10-09 08:56 PM

Quote:

Originally Posted by Katae (Post 146737)
It should be tex_file="texture.tga" if texture.tga is in the media folder.

Yeah, after looking around the lua website, I thought, "I. Am. Moron." Didn't get my original post down fast enough.

Thanks :) Working like a charm now. I will post my layouts when I finish converting them from KG. This is SO much easier to deal with than KG....

Again, thanks a ton for the quick reply. :)

/cbuck

Mugrax 07-23-09 07:51 PM

Intercept mouse clicks
 
Ive been searching for hours to find out how to get the panels to intercept mouse clicks to no avail. the code I'm using doesn't give any errors but doesn't intercept the mouse clicks either, its like its not even there. this is the part im trying to get to work:

{ name = "Right",
anchor_to = "BOTTOM", y_off = 300, x_off = 546.5,
mouse = false,
width = "272", height = 195,
bg_color = {0,0,0}, bg_alpha = 1,
},

am i using the right code is it in the right place?
thanks in advance for any information anyone can give me.
Mugs

ps: im trying to learn how to write the addons. ive found this a great learning experience. i would prefer for someone to point me in the right direction for finding the information myself through forums, etc instead of just "handing" to me, so to speak. thanks again

Katae 07-23-09 07:57 PM

When you set `mouse = true`, this will set the frame to intercept clicks. The same behavior will be default if you give the frame an OnClick, OnEnter, or OnLeave script.

Mugrax 07-23-09 08:02 PM

Thank you
 
That was fast. thank you. works like a charm

Dajova 08-02-09 05:01 PM

I need some help, cause i can't get this to work >.<

I am trying to switch from Btex to LitePanels, but i'm stuck with the fact that i don't know how to use artwork to make it work with it. I wanna make it look like THIS.

Have a idea of how to do it and maybe even supply with the code (i'm a UI supplier, yes, will release this UI when it's done)?

Katae 08-02-09 05:42 PM

Quote:

Originally Posted by richerich (Post 150429)
I wanna make it look like THIS.

I'm going to assume for a minute that it's one image and not three. From the screenshot, it looks like 1280x154 and slightly transparent, so here's what you may be looking for:

Code:

["Default"] = {
    { width=1280, height=154, tex_file="texture", bg_alpha=.95, level=0 }
}

You can use "100%" as the width as well. Also, tex_file is assuming filenames with no path ("texture.tga") are in "Interface\\AddOns\\LitePanels\\media\\".

Placing art with 3 sections +Viewport
The left and right images can both be set to a static width, and the middle image will be stretched to fit any resolution.
Code:

lpanels:CreateLayout("Viewport Art x3", {
    -- Art Container
    { name="Art", width="100%", height=154, bg_alpha=0, level=0 },
    -- Left Section
    { name="Art_L", parent="Art", anchor_to="LEFT", height="100%",
      tex_file="texture_left", width=400 },
    -- Right Section
    { name="Art_R", parent="Art", anchor_to="RIGHT", height="100%",
      tex_file="texture_right", width=400 },
    -- Middle Section
    { name="Art_M", parent="Art", anchor_to="CENTER", height="100%",
      tex_file="texture_middle",
      OnLoad=function(self) self:SetWidth(self:GetParent():GetWidth() - LP_Art_L:GetWidth() - LP_Art_R:GetWidth()) end
    },
}, { bottom=154 }) -- Viewport (Optional)
lpanels:ApplyLayout(nil, "Viewport Art x3")

Placing art with 4 sections
This was a bit easier than 3 since they can all be 25% width.
Code:

lpanels:CreateLayout("Art x4", {
    -- Art Container
    { name="Art", width="100%", height=200, bg_alpha=0, level=0 },
    -- Texture #1
    { name="Art1", parent="Art", tex_file="texture-1", bg_alpha=.95,
      anchor_to="LEFT", width="25%", height="100%" },
    -- Texture #2
    { name="Art2", parent="Art", tex_file="texture-2", bg_alpha=.95,
      anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%" },
    -- Texture #3
    { name="Art3", parent="Art", tex_file="texture-3", bg_alpha=.95,
      anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%" },
    -- Texture #4
    { name="Art4", parent="Art", tex_file="texture-4", bg_alpha=.95,
      anchor_to="RIGHT", width="25%", height="100%" }
})
lpanels:ApplyLayout(nil, "Art x4")

Viewport Only
Only want a simple viewport? This is all you need.
Code:

lpanels:CreateLayout("Viewport", nil, {bottom=20, top=20})
lpanels:ApplyLayout(nil, "Viewport")


Dajova 08-02-09 08:43 PM

thx for the fast reply, but actually, it's 4 separated images provided from Btex.

Gonna test the code tomorrow, i'll give ya a shout if it works ;)

EDIT: Did a quick testing, but no success... you know any program to merge those 4 images into 1? I have tried paint, but no luck xD

willgk 08-03-09 03:18 AM

Great Addon!

Katae 08-03-09 03:22 AM

If you want to put a panel behind its parent frame, you need to set 'level' to 0.

Dajova 08-03-09 06:23 AM

... nope, it doesnt work :/

Quote:

[2009/08/03 14:29:32-435-x1]: LitePanels-1.3.1\layout.lua:1: unexpected symbol near '['

---

willgk 08-03-09 02:08 PM

Katae,

Can you example doing an onupdate resize? One that follows the size of the ChatFrame.

Thanks either way! :) :banana:

xandora 08-03-09 03:15 PM

Quote:

Originally Posted by richerich (Post 150507)
... nope, it doesnt work :/

Go back and check your spelling around the [ at the start of the script. It could be that you've accidentally added something before or after it.

Dajova 08-03-09 04:24 PM

Quote:

Originally Posted by xandora (Post 150551)
Go back and check your spelling around the [ at the start of the script. It could be that you've accidentally added something before or after it.

I used the exact code that Katae provided, so i dunno...

Katae 08-03-09 04:48 PM

Quote:

Originally Posted by richerich (Post 150507)
... nope, it doesnt work :/

Remember, you still need to keep `LPanels = { ...everything... }` still around your profiles. Paste your layout.lua to pastebin.com if there's still problems after that.

Quote:

Originally Posted by willgk (Post 150546)
Can you example doing an onupdate resize? One that follows the size of the ChatFrame.

edit: Automatic when you have width or height at "100%".

Dajova 08-03-09 07:27 PM

Quote:

Originally Posted by Katae (Post 150562)
Remember, you still need to keep `LPanels = { ...everything... }` still around your profiles.

That was the problem, now it works, sweet :D

57odd75 08-05-09 08:00 PM

I am having trouble with just a simple black bar on the bottom of the screen showing up. This is the only text in the layout.lua file:

LPanels = {
["Default"] = {

},
["RYUGEN - KORGATH"] = {

{ name = "BlackBar",
anchor_to = "BOTTOM", y_off = 20,
width = "100%", height = 30,
bg_color = {0,0,0}, bg_alpha = 0.4,
},


{ name = "BorderTop", parent = "BlackBar",
anchor_to = "TOP", -- Anchoring to the TOP of "BlackBar"
width = "100%", height = 1,
bg_color = "CLASS", bg_alpha = 0.75,
},
{ name = "BorderBottom", parent = "BlackBar",
anchor_to = "BOTTOM", -- Anchoring to the BOTTOM of "BlackBar"
width = "100%", height = 1,
bg_color = "CLASS", bg_alpha = 0.75,
},
},
}

This is the code that Katae had posted. The only thing I changed was my Character and Realm (the Name and Realm are spelled correctly). Any suggestions?

Katae 08-05-09 08:43 PM

Quote:

Originally Posted by 57odd75 (Post 151596)
["RYUGEN - KORGATH"] = {

["Ryugen - Korgath"] = {

It's case sensitive. I suppose I'll change it to not matter in the next update :)

57odd75 08-05-09 09:33 PM

I tried both upper case as well as just the first letter capitalized. Neither would work.

Katae 08-05-09 11:17 PM

Quote:

Originally Posted by 57odd75 (Post 151621)
I tried both upper case as well as just the first letter capitalized. Neither would work.

And the filename is named layout.lua? Can you copy the whole file to pastebin.com and pm me the url?

Cala 08-10-09 06:10 PM

I went one simpler, and am having the same issue, even with the latest release. Instead of by character, it's defualted.

Here's my pastebin: http://pastebin.com/m6a7d1a1

Katae 08-10-09 10:13 PM

Quote:

Originally Posted by Cala (Post 153006)
I went one simpler, and am having the same issue, even with the latest release. Instead of by character, it's defualted.

Here's my pastebin: http://pastebin.com/m6a7d1a1

Is the problem that it's not loading the panels? Did you restart the wow client after renaming layout_example.lua to layout.lua? What's your wow's resolution and scale set to? I'm quite curious as to why you're having problems.

http://imgur.com/fgTck.jpg

Cala 08-11-09 02:42 PM

It will load the green panel, but not the black one, and I restarted the client several times to be sure.

Resolution: 1920x1200
UI Scale: 0.64

terracloud 08-12-09 11:33 PM

Just found your mod. I love what I can do with it.

I just wanted to know if there was a way to create a frame with a curve to the border, and if i can specify only a certain side or sides to curve and where that curve occurs.

Katae 08-13-09 02:55 AM

Quote:

Originally Posted by terracloud (Post 153465)
I just wanted to know if there was a way to create a frame with a curve to the border, and if i can specify only a certain side or sides to curve and where that curve occurs.

I don't believe so, you'll need to create your own and use it as the background texture to make anything other than a straight border.

terracloud 08-14-09 12:23 AM

Another question has occurred to me. When making an image, does it have to be square?

Katae 08-14-09 12:29 AM

Quote:

Originally Posted by terracloud (Post 153637)
Another question has occurred to me. When making an image, does it have to be square?

No, the sides don't have to be the same height and width, but they must be in powers of two up to 512, i.e: 256x512, 128x64, etc.

dc_roenfanz 08-14-09 08:50 PM

Lovely addon. I like it so far, especially the builtin class coloring.
However, I've got some questions.

First, I should include a screenshot so y'all can follow what I'm talking about.



As you can see, if you enlarge the image, each panel has the same borders, meaning each whole panel, complete with borders, is about .. 13 different individual panels. Does anyone know of a way to duplicate each "border" without having to replicate all 12 border panels for each parent panel??

Secondly, is it possible to "hook" a panel to another frame, such as the bag frame from Bagnon, so that the panels show up whenever the bags do?

Katae 08-14-09 09:05 PM

Quote:

Originally Posted by dc_roenfanz (Post 153794)
Does anyone know of a way to duplicate each "border" without having to replicate all 12 border panels for each parent panel??

Copy and paste... unfortunately no other way as of right now.
Quote:

Originally Posted by dc_roenfanz (Post 153794)
Secondly, is it possible to "hook" a panel to another frame, such as the bag frame from Bagnon, so that the panels show up whenever the bags do?

Find the frame you want to hook the panel to and set the parent attribute to that frame.

Ellute 08-14-09 09:36 PM

Gradient Stat Display
 
Hi. I'm trying to get the gradient stat display working. For some reason it doesn't show up. Could someone tell me what I did wrong or what is missing?

Here is the code http://pastebin.ca/1530171

dc_roenfanz 08-15-09 12:32 AM

Quote:

Originally Posted by Katae (Post 153799)
Find the frame you want to hook the panel to and set the parent attribute to that frame.

That's what I suspected, kgPanels does the same thing. Thankyou.

Unkn 08-18-09 01:47 PM

Gotta say this is one of my favorites. I was having issues with parenting to a couple addons that show up only in combat but I'm hoping the newest push fixed it. Thanks again :)

Melikae 08-18-09 05:11 PM

Awesome mod, just redid my kgPanels configuration and it looks even better,
the gradient in kgP looked as if there where stripes in it, with LP it looks just perfect ;)

Here's a Screenshot, it's just some static panels at the bottom, nothing fancy but I like it :P


And yeah, I know that the HP text on my player frame isn't bold, it's just some bug and normally disappears after zoning, so I don't care about it (though I should tell Tekkub and Shafki that this is happening using tekticles and PB4).

xandora 08-19-09 07:23 PM

Not strictly related to Litepanels, but it should fit in with a few of the layouts I've seen posted here...

How do I get my chat panels to be completely transparent? Currently have chatter installed if it helps.

EDIT: I am using litepanels as my frames/backgrounds.

Katae 08-19-09 08:01 PM

Quote:

Originally Posted by xandora (Post 154650)
How do I get my chat panels to be completely transparent? Currently have chatter installed if it helps.

Turn off the borders/background chatter module and set the default chat background to opaque under the chat tab menu. There will still be a hover background which cant be disabled by chatter.

xandora 08-19-09 08:16 PM

Quote:

Originally Posted by Katae (Post 154667)
Turn off the borders/background chatter module and set the default chat background to opaque under the chat tab menu. There will still be a hover background which cant be disabled by chatter.

Perfect! I'm guessing that hover background can't be disabled by anything then?

1ngo 08-22-09 03:42 AM

Actually, it cannot be "disabled" but you can hide it. But I don't know if it is possible with chatter since I'm not using this addon.
I used Prat to change the alpha of the chat frame to 0.
Then I locked the chat frames with the default social interface.

It's not "disabled" but you won't see it anymore (and be able to click on names, links, etc). ;)

willgk 08-22-09 01:15 PM

Katae,

I see that you can add shadows to text, however, you dont allow for changing the shadows text size to generate essentially an outline. Can you add this or is there a way to do it already?

willgk 08-22-09 05:22 PM

Quote:

Originally Posted by willgk (Post 155148)
Katae,

I see that you can add shadows to text, however, you dont allow for changing the shadows text size to generate essentially an outline. Can you add this or is there a way to do it already?


I see that you don't have the support for this so i quickly hacked in support, maybe you can add something like it to the codebase? Would be awesome:

Code:

if t.outline == 1 then
  text:SetFont(t.font or "Fonts\\FRIZQT__.TTF", t.size or 12, "Outline")
 else
  text:SetFont(t.font or "Fonts\\FRIZQT__.TTF", t.size or 12)
 end

Added at line 183 instead of the text:SetFont line that's there now in core.lua.

Then to activate it in your text { } block just do Outline = 1

Katae 08-22-09 06:22 PM

Quote:

Originally Posted by willgk (Post 155186)
I see that you don't have the support for this so i quickly hacked in support, maybe you can add something like it to the codebase?

Thanks, been busy with other things and never got around to this. I'll remember to add it :)

Yhor 08-29-09 08:27 PM

1 Attachment(s)
I just to start off by saying how much this addon saves in efficiency and time, I love it.

However, I do come with a question (multi-part, unfortunately). The first UI that I ever fell in love with was MazzleUI, and I have been attempting to get the "Target Cave" (img attached at bottom, it's the panel behind the target, center of the bottom frames 'kinda', and on top of minimap). I can't figure out which frame to parent the target cave frame to, and my update script (frame is -supposed to- only be there when a target is selected) is bogus.

There was a discussion in the old MazzleUI forums on how to do this with kgpanels, but I can't find it after a few hours of searching (the forums were disbanded a few months ago after Mazzlefizz gave up featured artist status).

Hopefully someone who knows what I'm talking about can help (because honestly, I don't have a clue how to describe it).

Katae 08-29-09 09:11 PM

Yhor
I'll do my best here, since I don't know what your unitframes are.

To accomplish this, you could set the parent frame to your target unitframe, this will make the cave graphic inherit the visibility of your target unitframe. Then set anchor_frame to the frame you want it anchored to. This would remove the need for a script.

Alternatively, you can keep it parented where it is and use this OnUpdate:
Code:

function(self)
  if not UnitName'target' then self.bg:SetAlpha(0) else self.bg:SetAlpha(1) end
end

You can't Hide() the panel because Hide() will stop the OnUpdate from running.

Yhor 08-29-09 11:13 PM

Thank you, I'll give that a try :). I think my problem was anchoring and parenting to the same object (STUF target frame). I'll edit this post if it works (read, if I do it right).



Edit:
Bleh, been at it for a few, I'm sure I'm missing something, but whatever it is I fail to see it.

Code:

["Default"] = {
    -- This profile will be loaded on all characters.
    Viewport = { top = 0, bottom=130, left = 0, right = 0 },
    -- Art Container
    { name="Art", width="100%", height=250, bg_alpha=0, level=0 },
    -- Texture #1
    { name="Art1", parent="Art", tex_file="Bottom1.blp", bg_alpha=.95,
      anchor_to="LEFT", width="25%", height="100%" },
    -- Texture #2
    { name="Art2", parent="Art", tex_file="Bottom2.blp", bg_alpha=.95,
      anchor_to="RIGHT", anchor_from="CENTER", width="25%", height="100%" },
    -- Texture #3
    { name="Art3", parent="Art", tex_file="Bottom3.blp", bg_alpha=.95,
      anchor_to="LEFT", anchor_from="CENTER", width="25%", height="100%" },
    -- Texture #4
    { name="Art4", parent="Art", tex_file="Bottom4.blp", bg_alpha=.95,
      anchor_to="RIGHT", width="25%", height="100%" }
    -- Texture #5
    { name="Cave", anchor_frame="Stuf.units.target", tex_file="Cave.blp", bg_alpha=.95,
    level=0, anchor_to="CENTER", width="120", height="120" }
}

As you can see, I'm a newb (and have been away from addons for around 5 months (and WoW for that matter). Any help is greatly appreciated. When all of --Texture #5 is commented out (for the "Cave"), everything except the cave works, but as is, it kills all frames.

Katae 08-30-09 12:13 AM

Quote:

Originally Posted by Yhor (Post 156722)
Bleh, been at it for a few, I'm sure I'm missing something, but whatever it is I fail to see it.

Code:

    -- Texture #4
    { name="Art4", parent="Art", tex_file="Bottom4.blp", bg_alpha=.95,
      anchor_to="RIGHT", width="25%", height="100%" },
    -- Texture #5
    { name="Cave", anchor_frame="Stuf.units.target", tex_file="Cave.blp", bg_alpha=.95,
    level=0, anchor_to="CENTER", width="120", height="120" }
}


Nevermind my PM. I almost missed it, you forgot a comma after the closing curly bracket for tex4, happens to me all the time.

Yhor 08-30-09 12:31 AM

2 Attachment(s)
Jeez do I feel lame! Thanks a ton, now to get it sized and updating properly :).

I'm sure I'm all set, and once again, I'm loving this over the alternatives.


Edit:
Figured I'd at least show the result, so far. SS in attachment :o.

Minerv 08-30-09 09:05 AM

Hi, im trying to make a bar @ the bottom like on your pic up there.

but it seems like it wont work, here's my pastebin link

http://pastebin.com/f76a32170

my screen res is 1280x768 and smallest ui

this is teh error i get. "2009/08/30 17:16:55-111-x1]: LitePanels-1.4.1\layout.lua:287: unexpected symbol near ','

---"

Katae 08-30-09 09:49 AM

Minerv
Made changes necessary for it to work here.

Note: {CLASS} -> "CLASS", 100% -> "100%", and LPanels brackets surrounding.

Minerv 08-30-09 10:47 AM

ah great! :D missed some there, ty

Untoucheable 09-03-09 09:45 PM

Hi!

First of all I love your addon. I am having problems with getting a clock to work though. I don't even know how to get started. Any chance you could give me an example or something to work with?

Katae 09-03-09 10:23 PM

Quote:

Originally Posted by Untoucheable (Post 157546)
Hi!

First of all I love your addon. I am having problems with getting a clock to work though. I don't even know how to get started. Any chance you could give me an example or something to work with?

I actually just wrote a clock module for a stats layout I was working on the other day. Pick it apart if you like: http://pastebin.com/f486e5824

Gnoore 09-06-09 02:31 PM

Hi,

would have liked to display a panel only when I'm in the raid. How is this possible?

Yhor 09-06-09 03:01 PM

Quote:

Originally Posted by Gnoore (Post 157839)
Hi,

would have liked to display a panel only when I'm in the raid. How is this possible?

Might parent it to a raid frame... but.

What is the purpose of the frame you want to display? A little more detail will get you much better help :).

Miralen 09-06-09 05:09 PM

Hey let me just say as many others have thanks for a great little addon, it's nice that it has so much potential without needing to load a ton of other junk, not knocking kgpanels or any other panel addon at all as kg has done a pretty good job at being user friendly and personally I would of been lost if I had picked this up before knowing what I do about kgpanels. Anyways, now that my preamble is out of the way question that hopefully there is an answer to, Let's say I play wow on two seperate computers with seperate resolutions but want the same ui that I have made for myself, is there a way to tell your panels to always place themselves at the same location on the screen regardless of screen resolutions and all that jazz? I will give you an example:

I have two panels one on the right and one on the left and I want them to be positioned let's say 10% away from the side of the screen and bottom of the screen. Instead of me having to have multiple layout files for each screen resolution I just want one and have it adjust. I apologize if this isn't making much sense, I am having a hard time wording it. Anyways hope to hear back and hopefully I have made sense.

Katae 09-06-09 11:25 PM

Quote:

Originally Posted by Miralen (Post 157863)
I have two panels one on the right and one on the left and I want them to be positioned let's say 10% away from the side of the screen and bottom of the screen.

So I want to get this right, you want x and y pos to be a percentage of the width and height of your screen? You could use this function as your panel's OnLoad handler:
Code:

OnLoad = function(self)
        local width, height = UIParent:GetWidth(), UIParent:GetHeight()
        -- percentage; set percentX to negative if panel is
        -- anchored to RIGHT side, percentY if anchored to TOP

        local percentX, percentY = 0.10, 0.10
        local points = {self:GetPoint()}
        points[4], points[5] = width * percentX, height * percentY
        self:ClearAllPoints()
        self:SetPoint(unpack(points))
end



All times are GMT -6. The time now is 09:27 PM.

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