PlayerTextDraw - Selectable?
#1

Hey.
I'm searching for a little tutorial, to make textdraw which i can select with my mouse.
currently i've script it like this:
pawn Code:
pTutorialDrawSkin[10][playerid] = CreatePlayerTextDraw(playerid, 370.000, 251.377, "<");
                    PlayerTextDrawLetterSize(playerid, pTutorialDrawSkin[10][playerid], 0.685, 2.375);
                    PlayerTextDrawAlignment(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawColor(playerid, pTutorialDrawSkin[10][playerid], -1);
                    PlayerTextDrawSetOutline(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawBackgroundColor(playerid, pTutorialDrawSkin[10][playerid], 51);
                    PlayerTextDrawFont(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawSetProportional(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawTextSize(playerid, pTutorialDrawSkin[10][playerid], 1337.000, 1337.000);

                    pTutorialDrawSkin[12][playerid] = CreatePlayerTextDraw(playerid, 532.833, 251.048, ">");
                    PlayerTextDrawLetterSize(playerid, pTutorialDrawSkin[12][playerid], 0.685, 2.375);
                    PlayerTextDrawAlignment(playerid, pTutorialDrawSkin[12][playerid], 1);
                    PlayerTextDrawColor(playerid, pTutorialDrawSkin[12][playerid], -1);
                    PlayerTextDrawSetOutline(playerid, pTutorialDrawSkin[12][playerid], 1);
                    PlayerTextDrawBackgroundColor(playerid, pTutorialDrawSkin[12][playerid], 51);
                    PlayerTextDrawFont(playerid, pTutorialDrawSkin[12][playerid], 1);
                    PlayerTextDrawSetProportional(playerid, pTutorialDrawSkin[12][playerid], 1);
                    PlayerTextDrawTextSize(playerid, pTutorialDrawSkin[12][playerid], 1337.000, 1337.000);

                    PlayerTextDrawSetSelectable(playerid, pTutorialDrawSkin[playerid][10], true);
                    PlayerTextDrawSetSelectable(playerid, pTutorialDrawSkin[playerid][12], true);
                   
                    SelectTextDraw(playerid, 0xFFCC00FF);
But if i try to move over the textdraws with my mouse, the color doesnt change, and if i click on it, nothing happens, but i have used OnPlayerClickPlayerTextDraw() :/

Can anyone help me?
Reply
#2

Try to read this tutorial http://forum.sa-mp.com/showthread.ph...kable+textdraw it was helpful for me.
Reply
#3

Thats the same as me o____Т
._.
Reply
#4

I edited it:
pawn Code:
pTutorialDrawSkin[10][playerid] = CreatePlayerTextDraw(playerid, 370.000, 251.377, "<");
                    PlayerTextDrawLetterSize(playerid, pTutorialDrawSkin[10][playerid], 0.685, 2.375);
                    PlayerTextDrawAlignment(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawColor(playerid, pTutorialDrawSkin[10][playerid], 0xFFFFFFFF);
                    PlayerTextDrawSetOutline(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawBackgroundColor(playerid, pTutorialDrawSkin[10][playerid], 51);
                    PlayerTextDrawFont(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawSetProportional(playerid, pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawTextSize(playerid, pTutorialDrawSkin[10][playerid], 60.000000, 20.000000);
                    PlayerTextDrawSetSelectable(playerid, pTutorialDrawSkin[10][playerid], true);
But it doesnt works too .________.
Reply
#5

Personally i don't have much experience with textdraws but you should of posted this in the Scripting help section, you would of gotten much faster responses, because this is scripting related.
Reply
#6

pawn Code:
PlayerTextDrawTextSize(playerid, pTutorialDrawSkin[12][playerid], 1337.000, 1337.000);
1337 TextSize? really? that's why this isn't work.

TextSize, which works as box size is the area that will be avilable to be clicked. Also, when the cursor is moved on the area the color will change.

Use a text draw editor to use a box, set the area and use it before setting the text draw as selectable.
You should remove the UseBox line from the output of the TD editor.

** AND: scripting section next time!
Reply
#7

@Amit_B
I dont understand ...
I use the td-editor from iPleomax (the new), i created an textdraw, and set the textdraw to "Selectable" with a function in the editor.
Then i exported it, and it doesnt works.
HEEEEEEEELP
and i already removed the UseBox Line from the script
Reply
#8

I dunno how that new editor works, but using Zamaroht's editor, i've setted up TextSizes used as a bound for the text draw to click it.
Reply
#9

Okay, now i can use "<", "Fertig" (fertig is german for finished) and ">".
But if i go over ">" theres a little zone or something like that, if my mouse is in this zone, the > is purple, but it should be only if i'am at the >.

Heres a picture:


the code:
pawn Code:
pTutorialDrawSkin[10][playerid] = CreatePlayerTextDraw(playerid,510.000000, 265.000000, ">");
                    PlayerTextDrawBackgroundColor(playerid,pTutorialDrawSkin[10][playerid], 255);
                    PlayerTextDrawFont(playerid,pTutorialDrawSkin[10][playerid], 0);
                    PlayerTextDrawLetterSize(playerid,pTutorialDrawSkin[10][playerid], 0.720000, 3.000000);
                    PlayerTextDrawColor(playerid,pTutorialDrawSkin[10][playerid], -1);
                    PlayerTextDrawSetOutline(playerid,pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawSetProportional(playerid,pTutorialDrawSkin[10][playerid], 1);
                    PlayerTextDrawTextSize(playerid,pTutorialDrawSkin[10][playerid], 800, 20);
                    PlayerTextDrawSetSelectable(playerid,pTutorialDrawSkin[10][playerid], true);
PS: now i used zamaroths editor, because ipleomax's editor is not really useful, only a bit currently.

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)