SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/10/2019, 02:17 PM   #1
Adi007
Big Clucker
 
Join Date: Jul 2014
Location: Pitesti,Romania
Posts: 78
Reputation: 0
Default PlayerTextDrawLetterSize Y converted for PlayerTextDrawTextSize

Hi.

As it says here: https://wiki.sa-mp.com/wiki/PlayerTextDrawLetterSize
"When using this function purely for the benefit of affecting the textdraw box, multiply 'Y' by 0.135 to convert to TextDrawTextSize-like measurements", meaning that if I have the Y from PlayerTextDrawLetterSize and I want the Y from TextDrawTextSize, it can be optained using the formula: Y(from PlayerTextDrawLetterSize ) / 0.135.

Actually, the 0.135 is not good for the formula everytime. When the TD box has a low height (like 2.0, 3.0, etc), the formula works ok using the 0.135, but if the TD box has a big height (like 30.0), the formula will give a wrong Y (TextDrawTextSize) and it will work fine if we-re using instead of 0.135, something like 0.1.

Anyone know some other way to fix this?
Adi007 is offline   Reply With Quote
Old 19/10/2019, 04:21 PM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,442
Reputation: 1620
Default Re: PlayerTextDrawLetterSize Y converted for PlayerTextDrawTextSize

Well, you must find out what is the maximum height that works for 0.135. Then if the height is above that height, use something like 0.1.
I assume you need a fix like that? It's a bit of a workaround but it is probably the most straight-forward way
Kwarde is offline   Reply With Quote
Old 19/10/2019, 07:35 PM   #3
Adi007
Big Clucker
 
Join Date: Jul 2014
Location: Pitesti,Romania
Posts: 78
Reputation: 0
Default Re: PlayerTextDrawLetterSize Y converted for PlayerTextDrawTextSize

It's not that easy. I just gave 2 examples like 0.135 for low heights and 0.1 for big heights, but in fact it changes continuously as the height increases.
It's not a "liniar" increase, it's something exponential I think, that's why I did not succeded until now to convert the Y from letter size to Y for text size.
I tought there is someone here who had this issue and already solved it.
Thanks for your reply, btw!
Adi007 is offline   Reply With Quote
Old 19/10/2019, 08:53 PM   #4
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,442
Reputation: 1620
Default Re: PlayerTextDrawLetterSize Y converted for PlayerTextDrawTextSize

I've been away from SAMP for some years so I've no idea..
Unless someone replies who does know more about this you should test multiple values for multiple sizes, and create a formula out of that (: But I'm sure you figured that out already
Kwarde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] PlayerTextDrawTextSize ssm1le Português/Portuguese 1 19/07/2019 10:27 AM
[Ajuda] PlayerTextDrawLetterSize Welconha Português/Portuguese 4 18/07/2018 04:20 AM
PlayerTextDrawTextSize DeadNudock Scripting Help 2 14/07/2015 03:08 AM
PlayerTextDrawTextSize ? Fierro Scripting Help 1 29/11/2013 08:26 PM
PlayerTextDrawLetterSize Help Burthop Scripting Help 2 06/05/2012 12:24 PM


All times are GMT. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.