godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.11k stars 69 forks source link

Add Disabled text color and x and y offset #6576

Open Shadowblitz16 opened 1 year ago

Shadowblitz16 commented 1 year ago

Describe the project you are working on

Windows 95 like theme

Describe the problem or limitation you are having in your project

Windows 95 had a text shadow or you could say copy when the text was disabled It is currently impossible to recreate in a godot theme without attaching a script to the control and redrawing the text

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add Disabled text color and x and y offset Possibly add it for the normal, focused, pressed and hovered styles too for future customization.. Add it fro all controls that can display text

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

image

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

It makes themes more customizable

Shadowblitz16 commented 1 year ago

I just realized that icons and styles like line style have this issue too

Calinou commented 1 year ago

https://github.com/godotengine/godot-proposals/issues/4909 is likely a cleaner solution to this (you can override the font shadow properties whenever the control is disabled manually).

Shadowblitz16 commented 1 year ago

@Calinou Will that be possible to have pixel perfect font shadowing? As of now I don't think font shadows are pixel perfect. I think they are gradiants

Calinou commented 1 year ago

Will that be possible to have pixel perfect font shadowing? As of now I don't think font shadows are pixel perfect. I think they are gradiants

This should already be the case. Font shadow offset is specified as an integer in pixels, so the shadow always aligned to the pixel grid if the display scale is an integer factor (see https://github.com/godotengine/godot-proposals/issues/1666). (In fact, Godot doesn't have support for soft text shadows or soft outlines unless you use a custom shader to draw those.)

Also, if you disable antialiasing on the font, this will also affect its shadow (as the font shadow always renders the same font). This requires the font to be designed for a specific display size, and you must also display the font at that specified size (or an integer multiple of it).