SA-MP Forums Archive
[Help] Pointer select more text.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Pointer select more text.. (/showthread.php?tid=327595)



[Help] Pointer select more text.. - SteeLFelna - 21.03.2012

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?


Re: [Help] Pointer select more text.. - Kalcor - 21.03.2012

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.


Re: [Help] Pointer select more text.. - Kar - 21.03.2012

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...


Re: [Help] Pointer select more text.. - T0pAz - 21.03.2012

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?


Re: [Help] Pointer select more text.. - vassilis - 21.03.2012

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?


Re: [Help] Pointer select more text.. - T0pAz - 21.03.2012

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.


Re: [Help] Pointer select more text.. - SteeLFelna - 22.03.2012

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);



Re: [Help] Pointer select more text.. - SteeLFelna - 23.03.2012

Bump


Re: [Help] Pointer select more text.. - Kalcor - 23.03.2012

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.


Re: [Help] Pointer select more text.. - T0pAz - 23.03.2012

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?