string minigame_getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
{
- int last_word;
- string s;
- int take_until;
- int skip = 0;
-
- s = getWrappedLine_remaining;
+ string s = getWrappedLine_remaining;
if(w <= 0)
{
return s; // the line has no size ANYWAY, nothing would be displayed.
}
- take_until = textLengthUpToWidth(s, w, theFontSize, tw);
+ int take_until = textLengthUpToWidth(s, w, theFontSize, tw);
if ( take_until > strlen(s) )
take_until = strlen(s);
+ int skip = 0;
for ( int i = 0; i < take_until; i++ )
if ( substring(s,i,1) == "\n" )
{
{
if ( skip == 0 && take_until < strlen(s) )
{
- last_word = take_until;
+ int last_word = take_until;
while(last_word > 0 && substring(s, last_word, 1) != " ")
--last_word;