godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Allow to customize caret symbol in `LineEdit` #1220

Open Shadowblitz16 opened 4 years ago

Shadowblitz16 commented 4 years ago

Describe the project you are working on: A network test

Describe the problem or limitation you are having in your project: there is no way to change the LineEdit control's caret

Describe the feature / enhancement and how it helps to overcome the problem or limitation: allow us to set a texture for the caret and offset it

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: It would just be a theme and style override

If this enhancement will not be used often, can it be worked around with a few lines of script?: Yes and No not that i know if if someone knows you can tell me

Is there a reason why this should be core and not an add-on in the asset library?: Its a pretty basic feature the was overlooked

Calinou commented 4 years ago

Can you point to some examples of games that use textured carets? I can see an use for changing the caret's color and width for accessibility reasons, but I wouldn't go as far as using textures.

KoBeWi commented 4 years ago

Can you point to some examples of games that use textured carets?

Judging from "A network test", OP probably tries to create a fancy chat. But this should be said in the proposal. Requesting a feature just because it doesn't exist isn't a valid reason for it to happen.

Shadowblitz16 commented 4 years ago

@Calinou the issue is not it being textures but letting us style controls how we want. I just think textures are the best way to style a caret since you can literally make them look however you want.

now that I think of it thought a Style would probable be better suited for this

Most other game frameworks require that you make your own line edits if you need them by drawing the text a caret manually. Godot doesn't have this because it implements everything as nodes which should cover basic needs like this.

@KoBeWi I agree with you I am suggesting this so I can edit the style of my line edit to fit my font. this is due to my game being really small resolution 128x128

hidemat commented 3 years ago

I my case, I have my resolution set to 1080x1920, and the caret is not visible when the game is run (I think because the width of the caret is to thin).

In this picture the LineEdit node has focus, but I can't see the caret. Screenshot 2021-04-23 082943

Godot ver.: 3.3 stable

Calinou commented 3 years ago

@hidemat What is your project's base resolution (defined in the Project Settings) and stretch mode?

hidemat commented 3 years ago

@Calinou base resolution is 1080x1920 test resolution is 360x640

stretch>mode = 2d stretch>aspect = expand stretch>shrink = 1

olive20xx commented 3 years ago

I just wish I could use TextEdit's "block mode" caret. Or a chunky underscore like in Windows cmd:

image

jabsatz commented 3 years ago

I think this should really be considered, or at least the "block mode" that @craigostrin mentioned. That's very common for arcade style games with a pixely font.

Calinou commented 3 years ago

@jabsatz Please don't bump issues without contributing significant new information. Use the :+1: reaction button on the first post instead.

jabsatz commented 3 years ago

wasn't the main issue mentioned here that there weren't examples of games that needed this enough for it to be considered?

Shadowblitz16 commented 2 years ago

@Calinou can you reopen this I can't seem to edit the offset x/y and size x/y of the caret. Its not even matching the font.. image

Calinou commented 2 years ago

@Calinou can you reopen this I can't seem to edit the offset x/y and size x/y of the caret. Its not even matching the font..

I don't think we should expose more than the caret width (which is considered to be an accessibility option). If you need more options, set the caret width to 0 and draw a caret yourself. This should be easier if you're using a fixed-width font.

Shadowblitz16 commented 1 day ago

@Calinou again running into issues with godot engine when it comes to flexability and godot dev's thinking they know better then the user. image

image

Please reopen this