Jump to content




word warp around questions


  • You cannot reply to this topic
6 replies to this topic

#1 BigSHinyToys

  • Members
  • 1,001 posts

Posted 20 April 2012 - 10:28 AM

I looking for advice on how to best implement word wrap around.
so this is the program so far It works ok but all the words are being cut off on the ends.
also any improvements i could make would be greatly appreciated.

http://pastebin.com/raw.php?i=YjXzaq35

#2 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 20 April 2012 - 10:50 AM

Just add n between. That creates a new line

#3 BigSHinyToys

  • Members
  • 1,001 posts

Posted 20 April 2012 - 10:56 AM

the point is it will scale with the screens size while allowing it to be scrolled with up/down keys or else I would have just used print()

new line will not help.

Pictures showing scroll
Spoiler


#4 libraryaddict

  • New Members
  • 195 posts

Posted 20 April 2012 - 11:33 AM

Spoiler

Thats write function with proper word wrapping.

Its found in bios.lua.

You can look at how its does it then modify your own code with code from that :)/>

#5 BigSHinyToys

  • Members
  • 1,001 posts

Posted 20 April 2012 - 11:39 AM

View Postlibraryaddict, on 20 April 2012 - 11:33 AM, said:

Spoiler

Thats write function with proper word wrapping.

Its found in bios.lua.

You can look at how its does it then modify your own code with code from that :)/>

i will look into that

Thanks it looks like it will be able to do what i want it to. after a few modifications

#6 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 20 April 2012 - 02:33 PM

OK Good to hear that you managed it. And you can place functions IN functions?!?

#7 Hawk777

  • Members
  • 162 posts

Posted 21 April 2012 - 03:39 AM

Wolvan: Lua functions are first-class. A function actually doesn't have a name inherently; it's just a value which can be assigned to a name. This:

function f()
  …
end

is actually equivalent to this:

f = function()
  …
end

and you can also (as you discovered) create functions inside other functions, assign them into variables, pass them as parameters, return them from function calls, use them as values in tables, and so on. Basically everything from "function()" to "end" is a single giant expression.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users