|
tekno
|
tekno
|
It wanted to know as I can divide a phrase. I have one picwin of 550pixels,I want if the text passes of those pixels made a jump of line. I have proven with $mid
Set %txt $mid($1->, 1, 300) Set %txt1 $mid($1->, 300, 640) Set %txt2 $mid($1->, 640, 960)
but does not keep the variables well. anyone can help me ?..
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
$1-> is an invalid argument. Try using $1-. A variable defined using set will not unset on its own. If after the code is executed the variable is not in your variables list, and you did not manually unset it (or via the script), it was never there to begin with.
|
|
|
|
tekno
|
tekno
|
$1-> is a mistake sorry.. the point is i don't know how to divide the text
|
|
|
|
Charlie
|
Charlie
|
i don't know exactly what you mean, but try this one set %txt $mid($1-, 1, 300) set %txt1 $mid($1-, 300, 340) set %txt2 $mid($1-, 640, 960) etc... set %txt1 $mid($1-, 300, 340) <== why 340? because 300 add 340 equal 640  hope i can help you with it, if not, please explain it what you're doing to do with
|
|
|
|
tekno
|
tekno
|
okey, let's see..
i have a picwin (553x40px) and i redirected my notices to this window, the problem is if the text of the notice is longer than 553px.. and well, i don't know how divider the text for do the jump of line..
|
|
|
|
Joined: Dec 2002
Posts: 332
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 332 |
you mean you want to wrap the text ? around to a new line if it is to long such as it keeps going like this ?
|
|
|
|
Joined: Mar 2003
Posts: 1,256
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,256 |
Your original $mid statements are correct - they chop the text up into bits. If the variables are not saved, this is not an error with $mid.
|
|
|
|
DaveC
|
DaveC
|
sorry for my previous short reply ie:
/help $wrap
Set %txtline1 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,1) Set %txtline2 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,2) Set %txtline3 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,3)
FONTNAME & SIZE well these are pretty clear, as for the rest... I used 530 (width of the text) above as you said the picwin is 550, so i thought a small indenting would be what ya wanted, if not take it up to 550. The ,1 following the 530 means break at word boundries, if its not wanted set it to 0, for charcter boundries., the last value is what line of the text you want.
|
|
|
|
tekno
|
tekno
|
this is what i have.. alias blah { var %i 1 while ($wrap($1-,dungeon,9,530,0) >= %i) { var %txt $wrap($1-,dungeon,9,530,%i) drawtext -pbr @bottombar $rgb(0,0,0) $rgb(218,230,231) dungeon 9 406 40 - $asctime(HH:nn) - %txt actualiza_noticias
inc %i } } mirc say: * Invalid format: $wrap on var %txt $wrap($1-,dungeon,9,530,%i) wtf ? the same it happens if I put drawtext -pbrc @bottombar $rgb(0,0,0) $rgb(218,230,231) dungeon 9 406 40 - $asctime(HH:nn) - $wrap($1-,dungeon,9,530,%i)
Last edited by tekno; 11/02/04 04:12 PM.
|
|
|
|
DaveC
|
DaveC
|
two problems.
(1) you dropped one of the fields in the $wrap command out. $wrap(text, font, size, width, [word,] N) The [word,] field, the help says its optional, but i suggest to leave it in, as removing it has caused me troubles when getting ,0 (number of lines) and ,1 (1st line),. I always include the [word,] value being 0, or 1,
(2) and this is your main problem.. var %txt $wrap($1-,dungeon,9,530,%i) replace with var %txt = $wrap($1-,dungeon,9,530,%i)
|
|
|
|
|