Jump to content




Scroll through printed text


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

#1 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 26 June 2014 - 08:13 PM

I was looking through the forums and could not find how to do this. I want to find a way to print text, then scroll through it, like when you're editing a program. The text printed would be too long to fit on the screen so you have to scroll through it using the mouse_scroll event. But when you use that, it deletes the text that went off the screen. Is there any way to keep the text there?

Any help is appreciated, thanks! :)

#2 AssossaGPB

  • Members
  • 126 posts
  • LocationFlorida, USA

Posted 26 June 2014 - 09:50 PM

The only way I can think of doing it is by storing each line in a table and have a variable storing what line your currently on, then each frame redraw the screen with the appropriate text.

Edited by AssossaGPB, 26 June 2014 - 09:50 PM.


#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 27 June 2014 - 01:00 AM

I suppose if you're on CC1.6+, you could probably use the window API here. Very inefficient, but should be easy to code around.

Basically, it hands you a custom terminal object (dubbed a "window") that exists within an existing one. You can then redirect to that object and print/write stuff into it as usual. Everything you write into that window is stored in a buffer, and so if the window is later obscured, you can restore it later.

So the idea is to make a window that's larger than the display you're rendering it on - big enough to print your entire document into. Then all you have to do is respond to mouse scrolling events by moving that window up / down.

AssossaGPB's solution would require a bit more coding on your end, but it'd be far more efficient. You might find this thread useful in implementing it.

#4 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 08 July 2014 - 03:19 PM

Thanks for the help. :)

Edited by metron80, 08 July 2014 - 03:19 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users