EgoMooseOldProjects / Rbx_CustomFont

A custom font management system for Roblox
MIT License
21 stars 17 forks source link

BackgroundTransparency #3

Closed Gskartwii closed 9 years ago

Gskartwii commented 9 years ago

What is the exact reason not to support TextTransparency? I did read the post linked, but still can't quite understand.

EgoMoose commented 9 years ago

Text transparency is supported, it just auto-sets the property to 2 so that the changed event will fire and the actual text of the text-object won't be shown. Eg. changing the property works, but getting the value will give you 2 regardless of what it actually is.

I assume that you are referring to background transparency?

The reason that it can't be supported is because each individual letter is a image label. These letters are then positioned, sized, and set as children of a text object. Unfortunately, as explained in the article by Anaminus, the z-index is kinda, shall we say, "broken".

For some reason (Anaminus does better job explaining than I could), text gui objects (labels, boxes, buttons) have priority over image labels when on the same z-index (which is what the custom fonts are made up of). As a result I have to make the text object's background transparency fully transparent in order for the text to be seen.

You might be thinking it'd make sense then to set the z-index of the image labels to something higher than the text object, but then the text will take priority over things it shouldn't and it wouldn't work on the 9th zindex.

It's unfortunate, but that's just the way it is...

Gskartwii commented 9 years ago

Yeah, I did mean BackgroundTransparency.
I sort of see what's going on, but why not use the ImageLabels' background? Or place them inside the TextLabel and use the TextLabel's background? Because then child-order wouldn't apply.

EgoMoose commented 9 years ago

Can't use the image label background because then you'd have mis-shaped backgrounds and The labels currently are placed in the text object, the glitch still applies.

Ill take a look at it again sometime soon (very busy this week though), maybe I'll be able to work some rendering magic.

Gskartwii commented 9 years ago

I see, good luck.

EgoMoose commented 9 years ago

Think I got backgrounds working: http://gfycat.com/ContentFlashyEidolonhelvum http://gfycat.com/SneakyVagueGibbon http://gfycat.com/CompassionateFrailAmericantoad

Feel free to try it and let me know if I've broken anything. I've had very little time to test (approx 5 mins).

Gskartwii commented 9 years ago

Wonderful, I'll take a look at it.