Reputation Bar
1 Attachment(s)
I need some feedback/ideas/help on my reputation bar addon JWRepBar (I'll use the same ideas for my XP bar addon JWXPBar). As you can see in the screenshot, the reputation is just about to exceed the width of the bar. I'd like the bar to be dynamic and increase in size to accommodate the reputation displayed. Here are some ideas I have but, I'm not sold on them. I've looked at a lot of examples and they all seem to follow the approach to create a frame, then the bars, font then set the text later after calculating the rep.
1. Make the font smaller, but I like 18pt. font due to my eyes. 2. Make the bar wide enough to account for the longest reputation string. Not practical and could lead to some really long bars. 3. I tried to make the code that creates the frame and bars a function so I could call it and pass the width base on the length of the reputation string. It never worked very well, or I was missing something in my coding. 4. Change the format (i.e. 10.6k/12k), but I'm also not sure if I like it. 5. Modify the display of the rep so that after a set length it shows ... (Bilgewater Ca...). Here is a screenshot: Attachment 9229 Here is my code (I'm omitting the code from Zork's rLib as it doesn't directly affect the creation of the bar): Lua Code:
Lua Code:
As always, any help is appreciated. |
Let me try rephrasing my question. Once you create a frame, can you change the width dynamically by using frame:SetWidth?
|
It depends on your SetPoint but if you've only set one point then yes. If you set a TOPLEFT/BOTTOMRIGHT or SetAllPoints then you would resize the the "container" (if you've only used one referece frame).
You might try a slightly taller bar with a slightly smaller font and the FontString with a SetAllPoints to the bar so you get two lines that wrap. If you fix the width of the FontString to the width of the bar you will automaticaly get a "Text..." if the text gets too long. Two FontStrings, Name(Justified Left) and Value (Justified Right or Center) sized 70/30 (80/20 or whatever works) across the bar so you get Steamwh... 92% if the name gets too long |
Quote:
|
I meant to post earlier, that your suggestions worked for me! I have some other minor annoyances that I'm in the process of addressing.
|
Quote:
|
All times are GMT -6. The time now is 03:32 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI