roaddog Posted April 4, 2015 Posted April 4, 2015 (edited) So I got a label which is in a scrollpane, and This label is gonna be filled by a txt file which has many lines. and then I place it, but The text didn't really fill them up, the buttom just get wrapped out. See this picture if you dont get what I mean by wrapped out. You see it, the text isnt really finished. I need to calculate it, and then the offset will be used to set the size of it. Thankee. Edited April 4, 2015 by Guest You gone learn today. I work my ass off, but I still can't pay tho.
WhoAmI Posted April 4, 2015 Posted April 4, 2015 Normally size of this font is about 13 px. So ( 13 + 2 ) * n 2 is for break behind lines n is number of lines.
roaddog Posted April 4, 2015 Author Posted April 4, 2015 What do you mean by break behind lines? The label is just 1 block, not that each line for each label You gone learn today. I work my ass off, but I still can't pay tho.
WhoAmI Posted April 4, 2015 Posted April 4, 2015 Doesn't matter, you see that when you type "\n" it is doing break. It's about ~2px.
roaddog Posted April 4, 2015 Author Posted April 4, 2015 Oh alright then. -- Vehicle Commands /engine - Turn your engine on or off. l /lock - Lock your vehicle. /unlock - Unlock your vehicle. /fp - Toggle first person view. hey so this is pretty much the txt file. how do I split it by lines? You gone learn today. I work my ass off, but I still can't pay tho.
WhoAmI Posted April 4, 2015 Posted April 4, 2015 (edited) You mean automatically? If so, I don't really know. Edited April 4, 2015 by Guest
roaddog Posted April 4, 2015 Author Posted April 4, 2015 Yes. due to the height's of label cant go highter than 600, I need to split the file into tables by lines. and make a label for each lines, is that alright? You gone learn today. I work my ass off, but I still can't pay tho.
roaddog Posted April 4, 2015 Author Posted April 4, 2015 Please, Anyone? I know how to seperate a string into a table by space. to seperate a string by new lines, how to do that, what is the character class? s = "hello world from Lua\n Another line, I believe" for w in string.gmatch(s, "%a+") do print(w) end You gone learn today. I work my ass off, but I still can't pay tho.
Et-win Posted April 4, 2015 Posted April 4, 2015 s = "Hello|World" table = split(s, "|") for placeNumber, stringData in ipairs(table) do outputChatBox(stringData) end *cough* edited ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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