• General Chat
  • Is there a way to set the boarder of the richtextlabel?

I have a simple type game. I want to add a border to the word which is focus on.

I check the theme seems to no property like this, any way to make it ?

In your second screenshot, notice on the right where it says Type: there is a grayed out dropdown selection box and a button with a plus sign next to it. Press the button with the pluss sign and you should get a add item type dialog showing up.

In that box you will want to pick your control node type you want to override with the theme. Pick the RichTextLabel node class from the list that should show up.

Once you've done that the panel on the right should become populated with properties that can be overridden. From there you want to press the plus sign next to font_color_shadow then switch to the second tab going from left to right. And in that panel you want to press the plus sign next to shadow as outline.

Though how well that will work for your font I do not know. It looks god awful on the default font IMO.

@Megalomaniak said: In your second screenshot, notice on the right where it says Type: there is a grayed out dropdown selection box and a button with a plus sign next to it. Press the button with the pluss sign and you should get a add item type dialog showing up.

In that box you will want to pick your control node type you want to override with the theme. Pick the RichTextLabel node class from the list that should show up.

Once you've done that the panel on the right should become populated with properties that can be overridden. From there you want to press the plus sign next to font_color_shadow then switch to the second tab going from left to right. And in that panel you want to press the plus sign next to shadow as outline.

Though how well that will work for your font I do not know. It looks god awful on the default font IMO.

Two questions: 1. Cant find the shadow as outline option after following your advice.

I already know the answer of question 2. Thank you. It will take effect immediately, change the modify item to default_color will see it 2. How to change color of the item, I cant see a confirm button after I change the color on the color picker panel. Click the "+" button not work, nothing happens.

When I was referring to the panel on right, I meant in your cropped screenshot, so as part of that bottom area that shows up for theme editing. Same place as font_color_shadow but different tab.

@origami said:

  1. How to change color of the item, I cant see a confirm button after I change the color on the color picker panel. Click the "+" button not work, nothing happens.

The plus there adds the sampled color to a palette index for easier access/reuse. To "apply" the color change just click outside of the color picker panel/dismiss it. In truth the color change should already have been applied when you picked inside the colored area.

edit: I'd also increase the alpha of the color selection tho, your resulting shadow/outline wouldn't be visible if the alpha is too low.

@Megalomaniak said: When I was referring to the panel on right, I meant in your cropped screenshot, so as part of that bottom area that shows up for theme editing. Same place as font_color_shadow but different tab.

@origami said:

  1. How to change color of the item, I cant see a confirm button after I change the color on the color picker panel. Click the "+" button not work, nothing happens.

The plus there adds the sampled color to a palette index for easier access/reuse. To "apply" the color change just click outside of the color picker panel/dismiss it. In truth the color change should already have been applied when you picked inside the colored area.

edit: I'd also increase the alpha of the color selection tho, your resulting shadow/outline wouldn't be visible if the alpha is too low.

I want a rectangle surrounded the richtextlabel, maybe I miss something in your post. Could you tell me a direct answer about how to add a border(rectangle) around on the richtextlabel. Or it is impossible.

Ah, that would be something very different indeed, I completely misunderstood what you wanted then. But that would have nothing to do with the RichTextLabel theme. I'd probably look into canvas item shaders. Or you could use a Panel Container as a parent of the RichTextLabel and then theme that Panel Container.

Just make a second layer on the node with a ColorRect or TextureRect. So the word would be a Node2D with two children, the text and the background/border.