Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Yes, there are some hidden values in STM that should give you these values, but you can do some tricks with string.Split, too!

"stm.lineBreaks.Count" should give the amount of lines. "stm.hyphenedText.Split('\n').Length" should also return the same value.


"stm.hyphenedText.Split(' ').Length" should give the amount of words, by counting the amount of spaces in the final text shown.


Words in a line is a bit trickier, but you can use the info from the lineBreaks list (this list contains the indexes of line breaks in hyphenedText) to do this.

This is some really rough untested code, but something like this will give the amount of words in the first line of text:

string line1string = stm.hyphenedText.Split('\n')[0]; //get all text before first linebreak
int line1wordCount = line1string.Split(' ').Length;

I hope this helps!