codeluaeveryday Posted July 5, 2012 Share Posted July 5, 2012 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
codeluaeveryday Posted July 5, 2012 Author Share Posted July 5, 2012 isnt quite what I need. I am not trying to make it go down a line or anything. All i wish to do is resize the font size depending on the characters. Link to comment
Anderl Posted July 6, 2012 Share Posted July 6, 2012 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
qaisjp Posted July 8, 2012 Share Posted July 8, 2012 string.len(messages[countcheck])*0.001 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now