Jump to content

Indentation using '\t' in GUI Memo


Mr_Moose

Recommended Posts

Posted (edited)

I got a GUI memo which loads it's text from a data source similar to this:

local text = [[Long text document here...    value 
property    value2]] 

Now, the problem is to make the indentation to the word 'value' equal on both the lines (using a non courier font), usually '\t' would have solved this, but in this case it only outputs '\t' as in it's source. Inserting and justifying with space doesn't work either since the vertical lines never get's straight. Any ideas or alternatives to '\t' in lua?

Edited by Guest
Posted

Nope, that will only remove the '\t', I'm looking for the same effect you get in other programming languages like C, where '\t' is converted to an indentation.

Posted

Whitespace would have the same effect as regular space, it may look nice in the code editor where the font is courier or monospace, (all letters has equal width), the problem is that even if the layout looks nice in the code it won't be a straight vertical line in game (with a different more nice looking font), of course there are other solutions like changing the layout of the text or use courier or moonscape fonts for example but I can't really see why it should be any difference in lua compared to kind of all other languages where you can make nice looking table structures using '\t'.

outputChatBox("test1\ttest2") 

This appears to produce the same result, '\t' is just ignored, there might be a reason for it in some cases but somehow it must be possible to solve.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...