PlayerTextDrawTextSize string problem
#1

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?
Reply
#2

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
Reply
#3

Bump
Reply
#4

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);
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)