PDA

View Full Version : [HELP]: How much Textdraws !


Areax
20/10/2013, 07:23 PM
Hello SA-MP !

I would like to know, How much textdraws can i show at the same time ?

Thanks :)

Wizzy951
20/10/2013, 07:24 PM
I think that they are unlimited.
Edit: but I don't suggest you to make them 100+, because I used this tool (http://forum.sa-mp.com/showthread.php?t=274064) which converted a image to textdraws, they were like 2000 + and they were loading slowly.

Patrick
20/10/2013, 07:26 PM
Limits: http://wiki.sa-mp.com/wiki/Limits

You can use 20 textdraw at the same time aslong it doesn't fuck up the whole screen.

Areax
20/10/2013, 07:27 PM
Well, then I have a weird problem... If I use 4 Normal Textdraws and 1 Player Textdraw, Then i see only Player Textdraw and 1 Normal Textdraw :/

EDIT: I have like this:


PlayerTextDrawShow(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);
But it only shows PlayerTextDraw and Texdraw id 5 :/

Wizzy951
20/10/2013, 07:29 PM
Well, then I have a weird problem... If I use 4 Normal Textdraws and 1 Player Textdraw, Then i see only Player Textdraw and 1 Normal Textdraw :/

Could you show us the code ?

Areax
20/10/2013, 07:34 PM
At the top:
new PlayerText:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;

OnGameModeInit:

Textdraw2 = TextDrawCreate(313.000000, 210.000000, "Terrorist");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 3);
TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
TextDrawColor(Textdraw2, -16776961);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
TextDrawUseBox(Textdraw2, 1);
TextDrawBoxColor(Textdraw2, -1);
TextDrawTextSize(Textdraw2, 401.000000, 0.000000);
TextDrawSetSelectable(Textdraw2, 1);

Textdraw3 = TextDrawCreate(240.000000, 210.000000, "Police");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 3);
TextDrawLetterSize(Textdraw3, 0.500000, 1.000000);
TextDrawColor(Textdraw3, 65535);
TextDrawSetOutline(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
TextDrawUseBox(Textdraw3, 1);
TextDrawBoxColor(Textdraw3, -1);
TextDrawTextSize(Textdraw3, 293.000000, 0.000000);
TextDrawSetSelectable(Textdraw3, 1);

Textdraw4 = TextDrawCreate(241.000000, 159.000000, "Pick up the team, you want to be in");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 2.000000);
TextDrawColor(Textdraw4, -65281);
TextDrawSetOutline(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);
TextDrawUseBox(Textdraw4, 1);
TextDrawBoxColor(Textdraw4, -1);
TextDrawTextSize(Textdraw4, 401.000000, 221.000000);
TextDrawSetSelectable(Textdraw4, 0);

Textdraw5 = TextDrawCreate(240.000000, 140.000000, "Selecting Teams :");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 2);
TextDrawLetterSize(Textdraw5, 0.300000, 1.000000);
TextDrawColor(Textdraw5, 16711935);
TextDrawSetOutline(Textdraw5, 1);
TextDrawSetProportional(Textdraw5, 1);
TextDrawUseBox(Textdraw5, 1);
TextDrawBoxColor(Textdraw5, -1);
TextDrawTextSize(Textdraw5, 400.000000, 0.000000);
TextDrawSetSelectable(Textdraw5, 0);

OnPlayerConnect:

Textdraw1 = CreatePlayerTextDraw(playerid,230.000000, 130.000000, " ");
PlayerTextDrawBackgroundColor(playerid,Textdraw1, 255);
PlayerTextDrawFont(playerid,Textdraw1, 5);
PlayerTextDrawLetterSize(playerid,Textdraw1, 0.500000, 1.000000);
PlayerTextDrawColor(playerid,Textdraw1, -1);
PlayerTextDrawSetOutline(playerid,Textdraw1, 0);
PlayerTextDrawSetProportional(playerid,Textdraw1, 1);
PlayerTextDrawSetShadow(playerid,Textdraw1, 1);
PlayerTextDrawUseBox(playerid,Textdraw1, 1);
PlayerTextDrawBoxColor(playerid,Textdraw1, 255);
PlayerTextDrawTextSize(playerid,Textdraw1, 182.000000, 99.000000);
PlayerTextDrawSetPreviewModel(playerid, Textdraw1, 2);
PlayerTextDrawSetPreviewRot(playerid, Textdraw1, -16.000000, 0.000000, -55.000000, -5.000000);
PlayerTextDrawSetSelectable(playerid,Textdraw1, 0);

OnDialogResponse

PlayerTextDrawShow(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw5);

Pottus
20/10/2013, 07:35 PM
That is because playertextdraws are created AFTER normal textures usually therefore they overlap. You are using playertextdraws incorrectly they should almost never have a visible box and are typically meant for overlaying. Make sure everything possible is in your normal textdraws only text and sometimes textures would be used.

iZN
20/10/2013, 07:35 PM
Replied above.

Areax
20/10/2013, 07:38 PM
Pottus;2748640']That is because playertextdraws are created AFTER normal textures usually therefore they overlap. You are using playertextdraws incorrectly they should almost never have a visible box and are typically meant for overlaying. Make sure everything possible is in your normal textdraws only text and sometimes textures would be used.

It's created BEFORE, check Textdraw's id. Player textdraw is id 1 and then other textdraws.

EDIT: Then how can I create just a box ? Without a text ? BTW: I am using textdraw editor. (http://forum.sa-mp.com/showthread.php?t=406833)

Wizzy951
20/10/2013, 07:45 PM
Try this editor (http://forum.sa-mp.com/showthread.php?t=376758). It's easy to use. And check the way it creates boxes after that.

Pottus
20/10/2013, 07:46 PM
I see whats happening, you wouldn't be asking for help if you knew the problem I just explained it look you do this in your playertextdraw PlayerTextDrawUseBox(playerid,Textdraw1, 1); that will cause the box to overlap any textdraws created in gamemode init you need to create ALL background draws in ongamemodeinit including your box then the playertextdraw will display on top of all of them.

Try this editor (http://forum.sa-mp.com/showthread.php?t=376758). It's easy to use. And check the way it creates boxes after that.

The editor has absolutely nothing to do with his problem furthermore he's using the better editor.

Areax
20/10/2013, 07:49 PM
So, if I understand right, I need to make PlayerTextdraw first or last ?

Pottus
20/10/2013, 07:51 PM
It's created last obviously since they are created when a player connects you just need to make sure they will overlap correctly order is ever so important here but also design, your design is flawed because your using a box which is overlapping textures as I said you need to create that box first you can use _ as the text which will cause it not to appear at all.

Areax
20/10/2013, 07:54 PM
Okay, I will try ! Thanks for helping :)