• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

HIVE

Dellirium
Dellirium
Hey, is there a way to "add a border" to a BUTTON frame?
With SIMPLEFRAME types I just add another SIMPLEFRAME child to them and add a texture to it, but with button I can't add a SIMPLEFRAME (because of the parent/child can't be mixed types) and if I try with FRAME, it doesn't let me click the button because FRAME blocks events.

Same problem, i assume, if I want to add a "Cooldown counter" on top of a button.

Any ideas of how the BUTTON .fdf should look?
Tasyen
Tasyen
Dellirium
Dellirium
Tasyen
Tasyen
Layer, Texture, String and Anchor are SimpleFrame things you can't use them in "BACKDROP" or "TEXT" which belong to the Frame-family/group.

When you want an image for Frames create a "BACKDROP". For that BACKDROP you only have to set BackdropBackground, if you want an inital image (BackdropBackground) and maybe Width / Height. If that Image is not a functional children you also have to pos it with SetPoint.

"TEXT"-Frames are the frames that display the text themself they don't need someone else to do that for them.
Compared to String "TEXT" sets its font with:
FrameFont "EscMenuTextFont", 0.013, "",

You UI looks nice.

functional Children like ControlMouseOverHighlight do not need SetAllPoints.
Dellirium
Dellirium
Can I then define a frame-type of BACKDROP and inside it define another BACKDROP to overlay two textures one ontop of the other, or in other words, how does one define the order in which the textures will be displayed when i have multiple BACKDROPs inside a single FRAME in fdf, just the order in which they are written?
Tasyen
Tasyen
Yes, "BACKDROP" can have other "BACKDROP" as Childs and the childs will be displayed above the Parent, that child also could have another child "BACKDROP".
But for such non functional child frames you need to know how to use SetPoint (in fdf). https://www.hiveworkshop.com/threads/ui-positionate-frames.315860/

"FRAME" and "TEXT" can be mainframes.
  • Like
Reactions: Pwnica
Dellirium
Dellirium
Thank you, I just use SetAllPoints in .fdf and then deal with points in code. Is there a way to make a TEXT frame have a fixed width and expand in height based on the text it contains? I sort of want to make a tooltip but obviously not every tooltip has the same length and i need to expand it :S

Also do I need to set "UseActiveContext," on every childFrame, simple, non-simple, etc? Everytime I nest any frame?
Tasyen
Tasyen
UseActiveContext, changes the behaviour of the fdf-Action SetPoint inside the Frame it is used (also for Texture String children of SimpleFrame). SetPoint calls on the frames creation BlzGetFrameByName(name, 0). With UseActiveContext, the 0 is replaced by the create context you currently use for framecreation. You have to use it in every Frame you use SetPoint and wana connect to a Frame which createcontext is not 0.

For TEXT that extends to the bottom you could only set only a Width (no Height) in fdf and place a TOP* Point. But I wonder how that looks with a Background.
Dellirium
Dellirium
When you say text with no height, I assume it means dont even define it, because if i say height = 0 then it disapears yes?

If the "background" is a parent of the text, can text expand over it, and outside of it? If that is the case we can just set parent's bottom to text's bottom.
Tasyen
Tasyen
With no Height I mean not writing it at all for that frame. Nor in fdf nor using BlzFrameSetSize...

Frame Parentship has nothing to do with position on screen, your text can be inside or outside of the background as it pleases (if not limited by your other rules).
Dellirium
Dellirium
Tasyen
Tasyen
Well, FrameFont requires 3 args ( fontName, real, "",) in that fdf Framefont was given only 2.
LIne 174
LIne 190

SimpleFrames have Font which takes only 2, that is easy to mix up.
Dellirium
Dellirium
But if that is the case, why is it working for one of them and not for the other o.0? The third argument is always an empty string?
Tasyen
Tasyen
Unsure how exactly that behaves but my guess is that as soon an error is encountered the parser stops for that fdf. Before the first FrameFont is encountered and breaks, there already is a valid working "FRAME" with a "TEXT" child.

Sry no idea, about possible options for that 3. arg of FrameFont. Found nothing in Blizzard's built in fdf.
Dellirium
Dellirium
Thanks a ton
Dellirium
Dellirium
How do I get the YELLOW frame to not block the clicks on the vampiric aura icons. They are of type FRAME (yellow one) and BUTTON (vamp aura icon) ones.

I tried creating them with levels 0 and 100 respectively, but that didnt change the behaviour.

https://imgur.com/yU2VCrF.jpg
Tasyen
Tasyen
One can disable the FRAME with BlzFrameSetEnable(frame, false) then it won't take mouse inputs anymore.
Or one can add in fdf: LayerStyle "IGNORETRACKEVENTS",
Dellirium
Dellirium
Upon further inspection I've realized that the yellow one is actually a:
SIMPLEBUTTON, thus the disabling doesn't work. Though how is a SIMPLEBUTTON blocking a BUTTON is beyond me. Aren't simpleframes suppose to be underneeth normal ones?

Is there a way to make BUTTONs have screen priority over SIMPLEBUTTONs?
Tasyen
Tasyen
No idea, how to make BUTTON to take Control_Click when fighting a SIMPLEBUTTON. But you could use another event from what I know SIMPLEBUTTON can only use CONTROL_CLICK, the other ones should work.
Dellirium
Dellirium
Do you know if there is a way to get frame's position on the grid in code, something like GetFrameX? I want to limit position the tooltip depending on the X / Y so it doesnt go offscreen.

Also is there a way to make text extend to bottom only without specifying the width or height.
I have used
SetPoint TOP, "parent", TOP, 0, 0,
SetPoint TOPLEFT, "parent", TOPLEFT, 0, 0,
SetPoint TOPRIGHT, "parent", TOPRIGHT, 0, 0,

assuming that this will give it a "width" and it will expand towards bottom. If I define the width it works, but it doesn't work if I define points, it just "hides" whatever doesn't fit.
Top