roaddog Posted April 4, 2015 Share 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 Link to comment
WhoAmI Posted April 4, 2015 Share 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. Link to comment
roaddog Posted April 4, 2015 Author Share 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 Link to comment
WhoAmI Posted April 4, 2015 Share Posted April 4, 2015 Doesn't matter, you see that when you type "\n" it is doing break. It's about ~2px. Link to comment
roaddog Posted April 4, 2015 Author Share 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? Link to comment
WhoAmI Posted April 4, 2015 Share Posted April 4, 2015 (edited) You mean automatically? If so, I don't really know. Edited April 4, 2015 by Guest Link to comment
roaddog Posted April 4, 2015 Author Share 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? Link to comment
roaddog Posted April 4, 2015 Author Share 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 Link to comment
Et-win Posted April 4, 2015 Share Posted April 4, 2015 s = "Hello|World" table = split(s, "|") for placeNumber, stringData in ipairs(table) do outputChatBox(stringData) end *cough* edited 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