SA-MP Forums Archive
The problem with TextDraw`s - 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: The problem with TextDraw`s (/showthread.php?tid=540553)



The problem with TextDraw`s - VaReNiX - 05.10.2014

Hello all. Sorry for my bad english. But i'll try to speak it.

There was a problem...
Created TextDraw (box) of the following form:
Код:
        Textdraw[0] = TextDrawCreate(166.000000, 108.526634, "usebox");
	TextDrawFont(Textdraw[0], TEXT_DRAW_FONT_MODEL_PREVIEW);
	TextDrawLetterSize(Textdraw[0], 0.000000, 10.689743);
	TextDrawTextSize(Textdraw[0], 70.000000, 0.000000);
	TextDrawAlignment(Textdraw[0], 1);
	TextDrawColor(Textdraw[0], 0);
	TextDrawUseBox(Textdraw[0], true);
	TextDrawBoxColor(Textdraw[0], -3394765);
	TextDrawSetSelectable(Textdraw[0], true);
Next, I show it to the player in such a way:
Код:
CMD:test(playerid, params[])
{
    TextDrawSetPreviewModel(Textdraw[0], 411);
    TextDrawSetPreviewRot(Textdraw[0], -16.0, 0.0, -55.0, 1);
    TextDrawShowForPlayer(playerid, Textdraw[0]);
    SelectTextDraw(playerid, 0xFFFF00AA);
    return true;
}
But the fact is that as soon as TextDraw displayed, it immediately disappears. What could be the problem? (TextDrawHideForPlayer in vogue at all no)
(Clickable TextDraw with a picture Infernus )



Re: The problem with TextDraw`s - VaReNiX - 06.10.2014

The problem is not solved
What could be wrong?



Re: The problem with TextDraw`s - Eth - 06.10.2014

try this:
pawn Код:
CMD:test(playerid, params[])
{
    TextDrawSetPreviewModel(Textdraw[0], 411);
    TextDrawSetPreviewRot(Textdraw[0], -16.0, 0.0, -55.0, 1);
    TextDrawShowForPlayer(playerid, Textdraw[0]);
    return 1;
}
I deleted the
SelectTextDraw(playerid, 0xFFFF00AA);
I want to see if it will appear or not


Re: The problem with TextDraw`s - VaReNiX - 06.10.2014

Quote:
Originally Posted by Eth
Посмотреть сообщение
try this:
pawn Код:
CMD:test(playerid, params[])
{
    TextDrawSetPreviewModel(Textdraw[0], 411);
    TextDrawSetPreviewRot(Textdraw[0], -16.0, 0.0, -55.0, 1);
    TextDrawShowForPlayer(playerid, Textdraw[0]);
    return 1;
}
I deleted the
SelectTextDraw(playerid, 0xFFFF00AA);
I want to see if it will appear or not
Anyway TextDraw disappears
If want - I will record the video as everything happens


Re: The problem with TextDraw`s - VaReNiX - 06.10.2014

Functions TextDrawHideForAll and TextDrawHideForPlayer - Not Used



Re: The problem with TextDraw`s - VaReNiX - 07.10.2014

The problem was in string:
Код:
TextDrawTextSize(Textdraw[0], 70.000000, 0.000000);
Namely, the third argument:
Код:
0.000000
But now there's a new question ()
How to choose a value for 0.000000, as was done in iTD iPleomax?



Re: The problem with TextDraw`s - rodrijose2009 - 07.10.2014

Код:
TextDrawTextSize(Text:text, Float:x, Float:y)
text	The TextDraw to set the size of.
x	The size on the X axis (left/right) following the same 640x480 grid as TextDrawCreate.
y	The size on the Y axis (up/down) following the same 640x480 grid as TextDrawCreate.
Try
Код:
TextDrawTextSize(Textdraw[0], 70.000000, 10.000000);



Re: The problem with TextDraw`s - VaReNiX - 07.10.2014

Quote:
Originally Posted by rodrijose2009
Посмотреть сообщение
Код:
TextDrawTextSize(Text:text, Float:x, Float:y)
text	The TextDraw to set the size of.
x	The size on the X axis (left/right) following the same 640x480 grid as TextDrawCreate.
y	The size on the Y axis (up/down) following the same 640x480 grid as TextDrawCreate.
Try
Код:
TextDrawTextSize(Textdraw[0], 70.000000, 10.000000);
The fact that sizes, that were made in iTD, doesn't match with sizes, that iTD puts in code TextDraw.