Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RichTextLabel's get_position_at_character(index) #5518

Open
CsloudX opened this issue Sep 30, 2022 · 1 comment · May be fixed by godotengine/godot#84715
Open

Implement RichTextLabel's get_position_at_character(index) #5518

CsloudX opened this issue Sep 30, 2022 · 1 comment · May be fixed by godotengine/godot#84715

Comments

@CsloudX
Copy link

CsloudX commented Sep 30, 2022

Related to #5513.

Describe the project you are working on

A dictionary app, and I want implement a RichTextEdit extends RichTextLabel, now I was implemented some features.
GIF

Describe the problem or limitation you are having in your project

But there was some problem on current RichTextLabel:
I can't draw my flash cursor at correct position because there have not api get a character position, so I neet a get_position_for_character_at(index) api for that

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

Implement get_position_for_character_at(index) api.
OR: Implement a RichTextEdit by core, I realy wish it.

I often use GODOT for GUI-application, I realy need a RichTextEdit

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

/

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

No, I can't!

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

/

My project:
RichTextEditTest.zip

@markdibarry
Copy link

markdibarry commented Sep 30, 2022

This can be achieved using get_character_line(int character) and get_line_offset(int line). Though you may need to know more about your specific font to get the horizontal offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants