SA-MP Forums Archive
PlayerTextDrawTextSize string problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerTextDrawTextSize string problem (/showthread.php?tid=653156)



PlayerTextDrawTextSize string problem - jasperschellekens - 27.04.2018

I am creating a stylish message box but are having a problem with PlayerTextDrawTextSize.
What i want to achieve with this is that the text goes to the next line below the current text.
This works fine, when i use this:
PHP код:
PlayerInfoUITD6[playerid] = CreatePlayerTextDraw(playerid190.000000165.096282"Some text here"); 
But when i use a string, or in this case i have:
ShowUserMessageBoxUI(playerid, title[], message[])
PHP код:
PlayerInfoUITD6[playerid] = CreatePlayerTextDraw(playerid190.000000165.096282message); 
It does not work. The text does not go to the next line.

I have also tried formatting another string something like :
PHP код:
format(msgstrsizeof(msgstr), "%s"message); 
But also with no result. How can i fix this?


Re: PlayerTextDrawTextSize string problem - CrystalGamer - 27.04.2018

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
I am creating a stylish message box but are having a problem with PlayerTextDrawTextSize.
What i want to achieve with this is that the text goes to the next line below the current text.
This works fine, when i use this:
PHP код:
PlayerInfoUITD6[playerid] = CreatePlayerTextDraw(playerid190.000000165.096282"Some text here"); 
But when i use a string, or in this case i have:
ShowUserMessageBoxUI(playerid, title[], message[])
PHP код:
PlayerInfoUITD6[playerid] = CreatePlayerTextDraw(playerid190.000000165.096282message); 
It does not work. The text does not go to the next line.

I have also tried formatting another string something like :
PHP код:
format(msgstrsizeof(msgstr), "%s"message); 
But also with no result. How can i fix this?
if you want your text in 2nd line then you have to set textsize of text to 2.000 or something else but dont get over then 7.00 cuz that makes the line straight


Re: PlayerTextDrawTextSize string problem - jasperschellekens - 29.04.2018

Bump


Re: PlayerTextDrawTextSize string problem - jasperschellekens - 01.05.2018

bump. how to fix it?
Only when using a string it does not goes to the following line:
Код:
PlayerTextDrawSetString(playerid, CharacterCreationTD24[playerid], string);
while this works:
Код:
PlayerTextDrawSetString(playerid, CharacterCreationTD24[playerid], "text");
Код:
PlayerTextDrawTextSize(playerid, CharacterCreationTD24[playerid], 300.000000, 5.0);



Re: PlayerTextDrawTextSize string problem - NaS - 01.05.2018

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
bump. how to fix it?
Only when using a string it does not goes to the following line:
Код:
PlayerTextDrawSetString(playerid, CharacterCreationTD24[playerid], string);
while this works:
Код:
PlayerTextDrawSetString(playerid, CharacterCreationTD24[playerid], "text");
Код:
PlayerTextDrawTextSize(playerid, CharacterCreationTD24[playerid], 300.000000, 5.0);
First of all is the TextDraw's alignment set to center (2)?

If yes you must switch X and Y parameters in PlayerTextDrawTextSize (Y will be width and X height).

If not you must adjust Y to allow the text to break. Toggle the box visible to see the exact dimensions of the TextDraw so you can see how big it actually is.


Re: PlayerTextDrawTextSize string problem - jasperschellekens - 01.05.2018

Quote:
Originally Posted by NaS
Посмотреть сообщение
First of all is the TextDraw's alignment set to center (2)?

If yes you must switch X and Y parameters in PlayerTextDrawTextSize (Y will be width and X height).

If not you must adjust Y to allow the text to break. Toggle the box visible to see the exact dimensions of the TextDraw so you can see how big it actually is.
I have no idea what was wrong. It seems to work now. after i added the ~n~ tags manually suddenly the textsize did work and i could remove the ~n~ tags.