Selection and deselection of Textdraws
#1

Hi guys. I'm trying to make a skin/age/gender selection that's made with textdraws however I'm having issues of when the correct textdraw is getting selected (highlighted in green)

Here are three pictures that'll help me describe what isn't working.



In this picture ^^^ I have no textdraw selected and this is what it looks like normally.



In this picture ^^^ I'm trying to select the "-" sign however my cursor is all the way in the very corner of the textdraw but not on it (I know you can't see my cursor)



In this picture ^^^ I'm trying to select the Help textdraw however now EVERYTHING is selected.

I've seen that where ever my cursor is on the screen if it's on the same X axis "------" >>> this way. That it gets highlighted. If it's on the same Y axis "|" ^^^ this way that it doesn't get selected.

This is the way I am displaying the textdraws

PHP код:
CMD:showskin(playerid)
{
    if(
PlayerInfo[playerid][pAdmin] < 5) return 0;
    
ShowSkinSelection(playerid);
    
SelectTextDraw(playerid0x00FF00FF);
    return 
1;
}
CMD:hideskin(playerid)
{
    if(
PlayerInfo[playerid][pAdmin] < 5) return 0;
    
TogglePlayerSpectating(playeridfalse);
    
HideSkinSelection(playerid);
    
CancelSelectTextDraw(playerid);
    return 
1;

Does anyone have any ideas? I've tried to move the textdraws further apart but as I've said it's the X axis and I would prefer the textdraws to be in proportion.
Reply
#2

Hi.
I think you used some third-party tools to create your selectable textdraws, I see many of them aren't standard and you have to modify the TextSize yourself if you want to have correct clickable area.
Wiki: Use TextDrawTextSize to define the clickable area.
https://sampwiki.blast.hk/wiki/TextDrawTextSize
Reply
#3

How would you recommend I find the coordinates for the TextDrawTextSize?
Reply
#4

You can enable the box and with the lowest numbers in TextDrawTextSize you can specify clickable area, there is other ways that I don't know or I don't remember. Just modify TextDrawTextSize and move your mouse over them and see what happens...
Also TextDrawAlignment is involved too, I usually set it to center and then I modify TextDrawTextSize.
Reply
#5

I do this

PHP код:
    HelpTxtDraw[playerid] = CreatePlayerTextDraw(playerid96.666679292.029846"Help");
    
PlayerTextDrawLetterSize(playeridHelpTxtDraw[playerid], 0.2543321.044147);
    
PlayerTextDrawTextSize(playeridHelpTxtDraw[playerid], 93.000022294.115173);
    
PlayerTextDrawAlignment(playeridHelpTxtDraw[playerid], 1);
    
PlayerTextDrawColor(playeridHelpTxtDraw[playerid], -1);
    
PlayerTextDrawSetShadow(playeridHelpTxtDraw[playerid], 0);
    
PlayerTextDrawSetOutline(playeridHelpTxtDraw[playerid], 1);
    
PlayerTextDrawBackgroundColor(playeridHelpTxtDraw[playerid], 51);
    
PlayerTextDrawFont(playeridHelpTxtDraw[playerid], 2);
    
PlayerTextDrawSetProportional(playeridHelpTxtDraw[playerid], 1);
    
PlayerTextDrawSetSelectable(playeridHelpTxtDraw[playerid], true); 
For example of the help textdraw. However whenever I hover over it, it isn't selectable anymore. I just don't understand how I'm supposed to get the coordinates. I went into the third party textdraw editor and tried to find the coords of the boxes (since they are made separately) and then inputted those coords as the text size however whenever I hover anywhere around my screen it doesn't get selected.
Reply
#6

I do not understand what you mean, do not you want to pass the mouse over a textdraw to make the others green?
Reply
#7

Yes. But what I'm asking is how am I supposed to get the coordinates of the selectable area for each textdraw when the method I'm using is the area of the box (different textdraw) which doesn't allow me to select anywhere in the textdraw. If that makes sense
Reply
#8

Bump!!??
Reply
#9

Quote:
Originally Posted by Tass007
Посмотреть сообщение
Yes. But what I'm asking is how am I supposed to get the coordinates of the selectable area for each textdraw when the method I'm using is the area of the box (different textdraw) which doesn't allow me to select anywhere in the textdraw. If that makes sense
That way you need to increase TextDrawLetterSize Or TextDrawSize X for able to click on them. Just try increase one by one. Like X = 5.0, Y = default(your position).
Reply
#10

Thanks for your guys help. But after 36 server restarts (altering code) I managed to get it to work correctly. Thank you for all your help.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)