-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add color option for img bbcode tag in RichTextLabel to tint images #39113
Conversation
Maybe this could be an optional parameter in [img] instead of a new tag? |
If breaking compatibility isn't an issue, we could make |
I think this would be annoying to have to close a color tag just to have your icon to be displayed with the original colors. As it is kind of a corner case, I think I like @akien-mga's solution better. |
Thanks all for the feedback! @Calinou If possible, I would rather not break compatibility and keep the two branches in sync, but my main concern is that I think intuitively you would not expect the font color to affect images too. I agree the idea proposed by @akien-mga to have an optional parameter instead of a dedicated tag seems like a good compromise. The syntax for images with color could be: |
I'd say the
Edit: Well looking at https://docs.godotengine.org/en/stable/tutorials/gui/bbcode_in_richtextlabel.html currently we do have various tags that use I think there's an opportunity for cleaning up the BBcode tags and make them more consistent and standard for 4.0. But in the meantime if we want a simple change that doesn't break compat, just adding the optional |
Maybe This is |
@akien-mga Yes, I would rather keep this PR simple for now and have more involved syntax changes separated. About changing the syntax: So if we want to keep our syntax consistent with this reference we could add this version as an alternative to set the size: That said, we could use a custom syntax, but I don't know if it should be called bbcode if it's too different from the original version, to make sure it's not misleading to users. |
I think we should aim to stay BBcode compatible as far as possible yeah, even though we do have extra tags that BBcode doesn't have (so it's more like "Godot Extended BBcode"). |
1d076f1
to
5c3b70f
Compare
Just pushed the changed to make color an option in Since I've added easier-to-use code to check for options in tags, I've also added |
5c3b70f
to
7b7d4ef
Compare
I've pushed a little update on comments styling. |
Thanks! |
edit: changed to add a
color
option inimg
tag instead of a new tagimg-color
.Allows
RichTextLabel
to display an image with tint using a new optioncolor
inimg
tag.AllowsRichTextLabel
to display an image with tint using a new bbcode tagimg-color
.It works the same way as thecolor
tag, but only affects images. It was added as a separate tag to keep the expected behavior thatcolor
only affects the font color and images are not affected by color changes by default.bbcode =
Text with icon [img width=16]res://icon.png[/img]
bbcode =
Text with icon[img width=16 color=#00FF00]res://icon.png[/img]