Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text width a length
#13
Ok czyli wczoraj brakowało mi tochar()

Wybrałem przykład z for()
Dzieki. Nie zamykać mimo to. Smile

Edit: A, zastanawiam się jeszcze, czy jest jakiś sposób na upiększenie tego typu brzydoty:



Code:
if(_chars_nr*2<text.len()&&this._textTable[0].heightPx*this._textTable.len()<tex_height)
{
this._textTable.append(Draw(0, 0, text.slice(_chars_nr,   _chars_nr*2)));
print("1");
}else if(text.len()>_chars_nr&&_chars_nr*2>text.len()&&this._textTable[0].heightPx*this._textTable.len()<tex_height)
{
this._textTable.append(Draw(0, 0, text.slice(_chars_nr, text.len())));
print("2");
}else{print("else");}


if(_chars_nr*3<text.len()&&this._textTable[0].heightPx*this._textTable.len()<tex_height)
{
this._textTable.append(Draw(0, 0, text.slice(_chars_nr*2, _chars_nr*3)));print("1");
}else if(text.len()>_chars_nr*2&&_chars_nr*3>text.len()&&this._textTable[0].heightPx*this._textTable.len()<tex_height)
{
this._textTable.append(Draw(0, 0, text.slice(_chars_nr*2, text.len())));
print("2");
}else{print("else");}

Ni cholery nie mam pomysłu jak łatwiej obliczac chars, no i muszę nadać odpowiednie warunki, a może to wcale nie wygląda najgorzej? :F
Reply


Messages In This Thread
Text width a length - by Son Goku - 20.04.2017, 15:46
RE: Text width a length - by KimiorV - 20.04.2017, 16:13
RE: Text width a length - by Son Goku - 20.04.2017, 16:22
RE: Text width a length - by KimiorV - 20.04.2017, 16:36
RE: Text width a length - by Bimbol - 20.04.2017, 16:59
RE: Text width a length - by Zmorra - 20.04.2017, 22:45
RE: Text width a length - by Son Goku - 21.04.2017, 11:22
RE: Text width a length - by Son Goku - 07.05.2017, 21:03
RE: Text width a length - by Bimbol - 07.05.2017, 21:09
RE: Text width a length - by Son Goku - 08.05.2017, 21:17
RE: Text width a length - by Marcel - 09.05.2017, 00:26
RE: Text width a length - by Bimbol - 09.05.2017, 01:06
RE: Text width a length - by Son Goku - 09.05.2017, 05:33
RE: Text width a length - by Marcel - 09.05.2017, 07:44
RE: Text width a length - by Son Goku - 09.05.2017, 17:49

Forum Jump:


Users browsing this thread: 1 Guest(s)