private void buildLines()
	{
		wrapSize.update();
		buildLines |= wrapSize.hasChanged();
		if (!buildLines)
			return;

		lines.clear();

		String str = cache.replace("\r?(?<=\n)", "\n");

		StringBuilder line = new StringBuilder();
		StringBuilder word = new StringBuilder();
		//FontRenderOptions fro = new FontRenderOptions();

		int wrapWidth = multiLine ? getWrapSize() : -1;
		float lineWidth = 0;
		float wordWidth = 0;
		float lineHeight = 0;

		StringWalker walker = new StringWalker(str, fontOptions);
		walker.skipChars(false);
		walker.applyStyles(true);
		while (walker.walk())
		{
			char c = walker.getChar();
			lineWidth += walker.width();
			wordWidth += walker.width();
			lineHeight = Math.max(lineHeight, walker.height());

			word.append(c);

			//we just ended a new word, add it to the current line
			if (Character.isWhitespace(c) || c == '-' || c == '.')
			{
				line.append(word);
				word.setLength(0);
				wordWidth = 0;
			}
			if (isMultiLine() && ((wrapWidth > 0 && lineWidth >= wrapWidth) || c == '\n'))
			{
				//the first word on the line is too large, split anyway
				if (line.length() == 0)
				{
					line.append(word);
					word.setLength(0);
					wordWidth = 0;
				}

				//remove current word from last line
				lineWidth -= wordWidth;

				//add the new line
				lines.add(new LineInfo(line.toString(), MathHelper.ceil(lineWidth), MathHelper.ceil(lineHeight), 0));
				line.setLength(0);

				lineWidth = wordWidth;
			}
		}

		line.append(word);
		lines.add(new LineInfo(line.toString(), MathHelper.ceil(lineWidth), MathHelper.ceil(lineHeight), 0));

		buildLines = false;
		updateSize();
	}
private void buildLines ( ) { wrapSize . update ( ) ; buildLines |= wrapSize . hasChanged ( ) ; if ( ! buildLines ) return ; lines . clear ( ) ; String str = cache . replace ( "\r?(?<=\n)" , "\n" ) ; StringBuilder line = new StringBuilder ( ) ; StringBuilder word = new StringBuilder ( ) ; int wrapWidth = multiLine ? getWrapSize ( ) : - 1 ; float lineWidth = 0 ; float wordWidth = 0 ; float lineHeight = 0 ; StringWalker walker = new StringWalker ( str , fontOptions ) ; walker . skipChars ( false ) ; walker . applyStyles ( true ) ; while ( walker . walk ( ) ) { char c = walker . getChar ( ) ; lineWidth += walker . width ( ) ; wordWidth += walker . width ( ) ; lineHeight = Math . max ( lineHeight , walker . height ( ) ) ; word . append ( c ) ; if ( Character . isWhitespace ( c ) || c == '-' || c == '.' ) { line . append ( word ) ; word . setLength ( 0 ) ; wordWidth = 0 ; } if ( isMultiLine ( ) && ( ( wrapWidth > 0 && lineWidth >= wrapWidth ) || c == '\n' ) ) { if ( line . length ( ) == 0 ) { line . append ( word ) ; word . setLength ( 0 ) ; wordWidth = 0 ; } lineWidth -= wordWidth ; lines . add ( new LineInfo ( line . toString ( ) , MathHelper . ceil ( lineWidth ) , MathHelper . ceil ( lineHeight ) , 0 ) ) ; line . setLength ( 0 ) ; lineWidth = wordWidth ; } } line . append ( word ) ; lines . add ( new LineInfo ( line . toString ( ) , MathHelper . ceil ( lineWidth ) , MathHelper . ceil ( lineHeight ) , 0 ) ) ; buildLines = false ; updateSize ( ) ; }
Splits the cache in multiple lines to fit in the {@link #wrapSize}.

@param str the str