[Include] td-helper - Deal with PlayerTextDraws easier
#1

After seeing the new PlayerTextDraw functions I felt it was very superfluous having two of all TextDraw functions when they essentially do the same thing.. Not only that, but also having to specify playerid every single time when it only could be one value.

Now, instead of doing this:
pawn Код:
new PlayerText:td = CreatePlayerTextDraw(playerid, 280.0, 240.0, "abc");

PlayerTextDrawUseBox(playerid, td, true);
PlayerTextDrawSetShadow(playerid, td, 0);
PlayerTextDrawAlignment(playerid, td, 1);
PlayerTextDrawSetOutline(playerid, td, 0);
PlayerTextDrawBoxColor(playerid, td, 0xFF000077);
PlayerTextDrawColor(playerid, td, 0);
PlayerTextDrawBackgroundColor(playerid, td, 0);
PlayerTextDrawTextSize(playerid, td, 356.18825, 0.0);
PlayerTextDrawLetterSize(playerid, td, 0.0, 7.81);

PlayerTextDrawShow(playerid, td);
You can now do this:
pawn Код:
new Text:td = CreatePlayerTextDraw(playerid, 280.0, 240.0, "abc");

TextDrawUseBox(td, true);
TextDrawSetShadow(td, 0);
TextDrawAlignment(td, 1);
TextDrawSetOutline(td, 0);
TextDrawBoxColor(td, 0xFF000077);
TextDrawColor(td, 0);
TextDrawBackgroundColor(td, 0);
TextDrawTextSize(td, 356.18825, 0.0);
TextDrawLetterSize(td, 0.0, 7.81);

TextDrawShowForPlayer(_, td);

Furthermore, OnPlayerClickPlayerTextDraw now leads towards OnPlayerClickTextDraw, so if you use OnPlayerClickPlayerTextDraw, change it to OnPlayerClickTextDraw.
Also change all "PlayerText" tags to "Text".

Viva la simplicity!


http://pastebin.com/kzsgS9NY
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)