Rich Edit Object Text Formatting Help

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi Guys, I haven't posted here in awhile. Hopefully someone can help me out with the Rich Edit object.

    So I'm making an online chatroom as a part of my online game using Lacewing. I want to use the Rich Edit object to display the chat box. I was reading through the help file for the object, and it says for the "Set Text : inserts the given text at the current caret position or replaces the current selection by the given text.". Okay so in theory if I position the caret to the end of the text box, it should add the new message at the bottom, maybe in conjunction with a NewLine$ expression. I tried using the "Goto - sets the caret to the given character or line." action to move the caret to the end of the text by using the "Get total number of characters" expression. However it just rewrites the text box instead of adding it to the end. I also tried to use the "Unselect block" action to stop it from rewriting the text, but it still happens.

    I don't want to do the workaround of adding the current text + the new text like you would do with a regular edit box. This is because I would also like to style the names of the people differently compared to the message they send.

    For example, I would like to have the player's name bolded and colored blue. If I had the expression to do "current text + the new text", the formatting would be applied to all the text.

    I also tried doing simple tests of just outputting a colored bolded name and a simple regular text message, but it didnt work either. Maybe I'm doing something wrong. I feel like this should be simple... Any help would be appreciated. I've included screenshots of my code and the output.

    Code: Please login to see this link.

    Output: Please login to see this link.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

  • Append Text will add to the current text without replacing it.

    For the player nme text modifying, you'll need to trigger those settings, append the desired text, then trigger the regular settings again.

    It's been a while but I do recall the text modification doesnt stick when using Set Text vs. Append Text. I assume this was by design.

  • Ah, thank you ratty. That fixed my problems. I was looking through all of the actions in the help file and Append Text wasn't listed there. Now that I think about it, append makes total sense compared to Set text. Although I wish it was in the help file to make it a bit clearer. Changing it to Append also kept the bold and color formatting as well.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!