[Help] Pointer select more text..
#1

Problem on mouse pointer, look. [ Couser is pointer, i mixed some words ]

Image if I can put the pointer on the text.
http://www.dodaj.rs/f/1S/JF/3byXmRHP/sa-mp-001.png


When I put the pointer to text "Kola" select and text "Out of character".
http://www.dodaj.rs/f/1j/N8/trYkwyX/sa-mp-003.png


How to select only "Kola" and "out of character" stay white color?
Reply
#2

Each selectable text must be its own seperate TextDraw. Adjust the TextDrawSetSize parameters until the area matches your desired clickable area. The TextDrawSetSize areas can't overlap.
Reply
#3

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
Each selectable text must be its own seperate TextDraw. Adjust the TextDrawSetSize parameters until the area matches your desired clickable area. The TextDrawSetSize areas can't overlap.
Excuse me.. what is TextDrawSetSize? you mean TextDrawTextSize right?

Edit: gosh, I am not trying to disrespect Kalcor, I was just wondering if there was a new function that he didn't mention in the RC thread...
Reply
#4

Quote:
Originally Posted by vassilis
Посмотреть сообщение
TextDrawTextSize

And this is how a sa-mp developer is getting pwnt +rep from me kar xD
What so funny about it? Can't human make mistakes?
Reply
#5

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
What so funny about it? Can't human make mistakes?
Haha was just kidding by the way

So if i understood well from the conclusion if you set the text size bigger which will end to be part with other textdraw it will make 2 textdraws clickable by mistake?
Reply
#6

Quote:
Originally Posted by vassilis
Посмотреть сообщение
Haha was just kidding by the way

So if i understood well from the conclusion if you set the text size bigger which will end to be part with other textdraw it will make 2 textdraws clickable by mistake?
Yes, you have to understand that textdraw is text drawn on the screen, not some special GUI system. That's why text size matters on textdraw select. I will probably create a GUI library to make things easier for myself and many others who is facing the problem, misunderstanding with the term textdraw.
Reply
#7

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
Each selectable text must be its own seperate TextDraw. Adjust the TextDrawSetSize parameters until the area matches your desired clickable area. The TextDrawSetSize areas can't overlap.
Yes, I did so for each selectable text separate textdraw.
Look at this as an example:
pawn Код:
Stats[7] = TextDrawCreate(219.000000, 122.000000, "In character");
TextDrawAlignment(Stats[7], 2);
TextDrawBackgroundColor(Stats[7], 255);
TextDrawFont(Stats[7], 1);
TextDrawLetterSize(Stats[7], 0.239999, 0.999999);
TextDrawColor(Stats[7], 7660031);
TextDrawSetOutline(Stats[7], 0);
TextDrawSetProportional(Stats[7], 1);
TextDrawSetShadow(Stats[7], 1);
TextDrawUseBox(Stats[7], 1);
TextDrawBoxColor(Stats[7], 0);
TextDrawTextSize(Stats[7], 269.000000, 66.000000);
TextDrawSetSelectable(Stats[7], 1);
Reply
#8

Bump
Reply
#9

For some reason you have to reverse the TextDrawTextSize width/height when using alignment = 2 (centered). This is something to do with GTA:SA. It's not designed by SA-MP.

https://sampwiki.blast.hk/wiki/TextDrawTextSize

try:
pawn Код:
TextDrawTextSize(Stats[7], 20.0, 269.0);
If multiple text is still selected, change 20.0 to 15.0 or 10.0.
Reply
#10

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
For some reason you have to reverse the TextDrawTextSize width/height when using alignment = 2 (centered). This is something to do with GTA:SA. It's not designed by SA-MP.

https://sampwiki.blast.hk/wiki/TextDrawTextSize

try:
pawn Код:
TextDrawTextSize(Stats[7], 20.0, 269.0);
If multiple text is still selected, change 20.0 to 15.0 or 10.0.
Do we need to play with the coordinates now to acquire the best result or just reverse the exact value?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)