Hi @all,
I think I need a pointer in the right direction; I have two problems:
-
Issue - wrong alignment:
When I change the text in a nifty element like this: <text id=“abc” font=… />,
it seems like the text does not align in the right way…
I set it to align=“left” but it looks more like align=“center” to me. At least it is noticeable the text goes WAY over the left border of the panel
Is there some issue with nifty resetting the alignment values or do I miss something?
The code in the .xml-file:
[java]<text id=“inv_description” font=“Interface/Fonts/Default.fnt” color="#ffff" text=“Description” align=“left” valign=“top”/> [/java]
Resetting the text from the source code:
[java] nifty.getScreen(“inventory”).findElementByName(“inv_description”).getRenderer(TextRenderer.class).setText(“Very long text here”); [/java] -
Issue - no line breaks:
The text should be used to contain some sort of description of the single items in the inventory, therefore it´s fairly long.
When testing it out, I saw that NiftyGUI seemingly has no automatic line breaks when the text is longer than the panel.
Is there some way to do those automatic line breaks?
I tried to use the TextField but usually the user should not be able to edit this text.
Thanks for giving me hints for either one of the issues!