It seems you have added additional backslashes inside a string, your text and screenshots show:
These backslashes are not valid in HTML. Just write
and HTML tags will be recognized OK. Looking at your code, you load text from test2.txt file, so you should remove backslashes from there.
( Maybe you wrote the backslashes because they have been present in the JSON contents in examples/fonts/html_text/data/gameviewmain.castle-user-interface ? If yes, then the explanation is that the backslashes are present in JSON because strings in JSON are surrounded by double quotes, so in JSON encoding backslashes are added when one wants to have a literal double quote in the output. But these backslashes are then stripped when reading JSON into a string (like Pascal string) in memory. )
P.S. As an unrelated suggestion: your code defines a lot of components using Pascal. I would suggest to define them instead using CGE editor, and just load the design from Pascal. Designing such components in CGE editor will allow to experiment with their properties much faster.
All things in CGE can be loaded from an arbitrary TStream (not just from a URL). There are methods like LoadFromStream or overloads (like TSerializedComponent.Create) to take a TStream instead of an URL, always.
If you find something that’s missing such capability, please report It is our design goal to always allow loading from TStream.
Note that we generally recommend creating new threads for new questions. A separate question deserves a separate thread, so that people searching the forum can see it better, and so that talk about it can go in parallel to unrelated questions.
You meant TComponent.Tag? Yes. All CGE components descend from standard FPC/Delphi TComponent, so they have Tag property.
We have a dedicated TCastleEdit It does not descend from TCastleLabel, since editing necessarily means somewhat different logic that only display (e.g. editing has cursor, and a frame typically).
Though if you want to dynamically change the label to edit, you can, just have 2 controls (TCastleLabel and TCastleEdit), synchronize their text (MyLabel.Caption and MyEdit.Text) and make only one of them Exists at given time.
Note that we don’t yet have multi-line editing, i.e. we don’t have TCastleMemo. It’s a TODO. Our TCastleEdit only handles single-line editing for now.
Good evening, no, I don’t need full html rendering, I thought CastleLabel is an analogue of TextView from android studio, it has such a spanned text class. In general, I’m writing an application that will download news, and some other data from the server, and so that the text is not completely dry, I want to add tags to the text