Jump to content




Scrolling textbox function

utility lua computer

6 replies to this topic

#1 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 05 February 2013 - 05:37 AM

Hello folks, here's a simple function I made. It's a scrolling textbox with configurable width.

Warning: has not been fully tested (yet)! Tested, should work as expected.

Code:

Spoiler

or

eJGVpdFv

Edited by InputUsername, 02 January 2014 - 04:12 AM.


#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 February 2013 - 02:55 PM

having a default char would be nice, so you can have max length and password.

#3 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 05 February 2013 - 03:27 PM

Having support for up/down/left/right keys is also good.

Sincerely, you can accomplish this by seeing the code of read() and changing the line local sx, sy = term.getSize() into local sx, sy = maxX, 1

#4 GopherAtl

  • Members
  • 888 posts

Posted 06 February 2013 - 03:13 AM

anonimo, that would limit the area it displays the entered text in before scrolling it, not the length of the text you're allowed to enter.

#5 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 07 February 2013 - 09:45 AM

Oh, sorry for that...

#6 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 10 February 2013 - 03:10 AM

View PostGopherAtl, on 06 February 2013 - 03:13 AM, said:

anonimo, that would limit the area it displays the entered text in before scrolling it, not the length of the text you're allowed to enter.

That's actually what my function is supposed to do; it's a 'scrolling' text box ;) it does not limit the length of text to be entered, although I could add that option.

#7 GopherAtl

  • Members
  • 888 posts

Posted 10 February 2013 - 06:23 AM

oh! sorry, haha. Never mind, anonimo, carry on :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users