defold-richtext icon indicating copy to clipboard operation
defold-richtext copied to clipboard

Add a richtext.remove equivalent for characters

Open ChrisRegan opened this issue 1 year ago • 2 comments

I just want to request the equivalent of the remove function to work with richtext.characters. Though adapting richtext.remove to work with characters would work as well.

ChrisRegan avatar Aug 15 '23 23:08 ChrisRegan

Could you please be a bit more specific about exactly what you expect from such a function? Could you give an example of how it would be used and what the expected result is?

britzl avatar Aug 16 '23 05:08 britzl

Well remove does this.

richtext.remove(words)

Removes all gui text nodes created by richtext.create() I was hoping for an equivalent for the same function for richtext.characters.

Since a similar existing function already existed I thought to ask for it.

Though my use case currently is that currently I get the result of create. And replace some of the words with the characters like:

Words = richtext.create("some sentence")

local temp = richtext.characters(Words[1]) richtext.remove(Words[1]) Words[1] = temp.

On cleanup I would like to do the same as

richtext.remove(Words) or a similar richtext.removeCharacters(Word[1])

to simplify cleanup. Probably easy to do manually but thought I should ask since a similar function already exists

ChrisRegan avatar Aug 16 '23 05:08 ChrisRegan