Hello, The purpose of this message is to teach them to create a TextDraw, both as Textdraws TextDrawBox (Normal.) Ah you mean by "TextDrawBox" Well is that there is a part of the text behind different color than yourself you can add, that is, a huge square on the screen, in short it can be used for various things, the same way I want to clarify that these will not be created with any FilterScript available.
TextDraw:
Well mainly we need to create lead us to the following code that fails them ah then Note that the definition of the codes will be taught in front of them.
First of all we have to define the variable textdraw follows:
The tutorial part is to define the variable inside the textdraw, Tutorial can be changed by other text.
The second step is to go to "OnGameModeInit" and in the same place the following:
pawn Код:
Tutorial = TextDrawCreate(120.000000, 410.000000,"Tutorial - Tutorial");
TextDrawAlignment(Tutorial,0);
TextDrawBackgroundColor(Tutorial,0x000000ff);
TextDrawFont(Tutorial,1);
TextDrawLetterSize(Tutorial,0.430000, 1.400000);
TextDrawColor(Tutorial,0xffffffff);
TextDrawSetOutline(Tutorial,1);
TextDrawSetProportional(Tutorial,1);
TextDrawSetShadow(Tutorial,1);
Well now we know the definitions, now we have to add a function so that when the user leaves the textdraw disappear, first headed ah "OnPlayerDisconnect" and we put the following which will make disappear textdraw:
pawn Код:
TextDrawHideForPlayer(playerid, Tutorial);
But we need to put the definition to Cundo log in to the server to look the same, It is noteworthy that they can be taught in different ways to die, to connect or spawn, Here'll "OnPlayerSpawn" so that when the user spawnee automatically leave you the same.
pawn Код:
TextDrawShowForPlayer(playerid, Tutorial);
This I have concluded in the creation of a textdraw, then to teach how to make a textdrawbox.
TextDrawBox:
All the above definitions are the same only this only add the following in OnGameModeInit below what we define as well Lagging:
pawn Код:
Tutorial = TextDrawCreate(120.000000, 410.000000, "_");
TextDrawBackgroundColor(Tutorial, 255);
TextDrawFont(Tutorial, 1);
TextDrawLetterSize(Tutorial, 0.330000, 1.200000);
TextDrawColor(Tutorial, 16777215);
TextDrawSetOutline(Tutorial, 0);
TextDrawSetProportional(Tutorial, 1);
TextDrawSetShadow(Tutorial, 1);
TextDrawTextSize(Tutorial, 651.000000, -572.000000);
TextDrawUseBox(Tutorial, 1); //-- is this aggregate
TextDrawBoxColor(Tutorial, 0x0000FF15); //-- is this aggregate
Concepts:
Something that is very important for creating them is to know their names giving each code, then ah will try to explain as detailed as possible.
TextDrawDestroy: This is the function that destroy textdraw, ie no longer coming out, can be defined in a command or another callback and is defined as follows:
pawn Код:
TextDrawDestroy(Tutorial[playerid]);
TextDrawColor: This makes you a color or letter textdraw, hexadecimally can be marked and must be added along with the rest remaining in OnGameModeInit well:
pawn Код:
TextDrawColor (Tutorial, 0x000000FF)
TextDrawBoxColor: Sets the color of a textdrawbox, likewise added along with the rest being marked in OnGameModeInit and color hexadecimally being defined as follows:
pawn Код:
TextDrawBoxColor (Tutorial, 0xFFFFFFFF);
TextDrawBackgroundColor: If I remember correctly it does mark an outline color to the letters, and must be marked hexadecimally aggregate OnGameModeInit and being defined as follows:
pawn Код:
TextDrawBackgroundColor (Tutorial, 0xFFFFFFFF);
TextDrawAlignment: Sets in various parts of the textdraw, If set to 0 is left hand, if it is seteado 1 is centered and if seteado in 2 is right side, and is defined in OnGameModeInit:
pawn Код:
TextDrawAlignment (Tutorial, 2)
TextDrawFont: Defines the font should be added in OnGameModeInit and defined as follows:
pawn Код:
TextDrawFont (Tutorial, 2)
Here the ids of the letters:
TextDrawLetterSize: Defines the font size, it is not difficult to do and OnGameModeInit defined as follows:
pawn Код:
TextDrawLetterSize (Tutorial, 3.2, 5.1);
TextDrawTextSize: If I remember correctly defines the size textdrawbox, OnGameModeInit is added as follows:
pawn Код:
TextDrawTextSize (Tutorial, 2.0, 3.6);
TextDrawSetShadow: Make a Shadow to the area of Textdrawbox, if set to 1 it works If set to 0 does not work, is added as follows OnGameModeInit way:
pawn Код:
TextDrawSetShadow (Tutorial, 1);
TextDrawSetProportional: Add to textdraw proportionality, enable desahbilita by 1 and 0, OnGameModeInit is added as follows:
pawn Код:
TextDrawSetProportional (Tutorial, 1);
TextDrawUseBox: is what enables textdrawbox, if seteada to 0 does not work if seteada 1 if it works, add in OnGameModeInit follows:
pawn Код:
TextDrawUseBox (Tutorial, 1);
TextDrawSetString: Enables a string to textdraw, should be used as follows:
pawn Код:
new Text: Tutorial;
public OnGameModeInit ()
{
Tutorial TextDrawCreate = (1.0, 5.6, "Hello, are you doing?");
return 1;
}
public OnPlayerConnect (playerid)
{
new text [41], name [MAX_PLAYER_NAME];
GetPlayerName (playerid, name, MAX_PLAYER_NAME);
format (newtext, sizeof (text), "Hello% s, What are you doing?", name);
TextDrawSetString (Tutorial, Text);
TextDrawShowForPlayer (playerid, Tutorial)
return 1;
}
TextDrawShowForPlayer: Make a textdraw ah a specified player.
TextDrawHideForPlayer: goes missing textdraw a specified player, can be added anywhere you like but OnPlayerDeath recommended with the following definition:
pawn Код:
TextDrawHideForPlayer (playerid, Tutorial [playerid]);
TextDrawShowForAll: Make a textdraw all users.
TextDrawHideForAll: Removes a textdraw all users, where you like being defined as follows:
pawn Код:
TextDrawShowForAll (Tutorial)
They note that there are other intelligent systems Actualemente which help in creating a better Textdraws such are Zamorath Editor & iPLEOMAX, among others.
That would be all, if you have a question to answer you comment it immediately, greetings.