Jump to content

Auto Sizing Dx Font Size


Recommended Posts

Hey all. Ive been working on a script. The original one I made worked perfect. Now I have simplified it for tables. My formula is correct. You should not need my code, so do not ask for me to show it :). My code is working all i need to do is auto size it with string.len(messages[countcheck])

for an example:

  
messages = { 
"____________________", 
"_________________________________", 
"____________________________________________________" 
} 
  
dxDrawColorText(messages[countcheck], 0, 0, width, height, tocolor(255,255,255,fade), (width/960)*??????, "default", "center", "center") 

I am going to use string.length, but I cannot figure out a way to fit the last table entry. If you know what math formula could be used please tell me. Where I put the ?????? is meant to auto size it.

I tried my best to speak full english... I am in a hurry to go.

Regards Chris.

Link to comment
messages = { 
"____________________", 
"_________________________________", 
"____________________________________________________" 
} 
  
dxDrawColorText(messages[countcheck], 0, 0, width, height, tocolor(255,255,255,fade), (width/960)*#messages[countcheck], "default", "center", "center") 

This should need some math.

You can use to get message length:

#messages[countcheck]

or

string.len( messages[countcheck] )

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...