Enable/Disable scrolling... (EDIT, problem: auto-scroll restore)

Kavaz
07 May 2022, 17:47I have a question...
The command to disable scrolling is : JS.eval ("scrollToEnd = function () {}")
But to restore it in the next room ?
Thanks for the replies ! ;)
mrangel
07 May 2022, 18:48Off the top of my head, I think you want:
JS.eval("addTextAndScroll = addText;")
to disable scrolling, and
JS.eval("addTextAndScroll = function(w) {addText(w); scrollToEnd();}")
to enable it again.
Remember that scrolling will always be enabled when loading a saved game unless you disable it in the UI initialisation script.

Kavaz
07 May 2022, 19:17ah...Ok
and if i want to start with the scroll on the top ( cause long text that would be cut off), and then restore it (default auto-scrolling) in the room later ?
JS.eval("addTextAndScroll = addText;") keeps cutting my text, and you don't see the title because the auto-scrolling is ON.

Kavaz
08 May 2022, 15:22-My structure: Room1 to Room 2
-1) ROOM 1 (room_prologue) > i can stop auto autoscrolling only with:
JS.eval ("scrollToEnd = function () {}")
msg ("BLABLABLABLABLABLABLABLA......... A VERY BIG WALL OF TEXT)
PrintCentered ("> PRESS ANY KEY TO CONTINUE <")
wait {
ClearScreen
MoveObject (player, room_start)
}
-2)ROOM 2 (room_start)> I can't restore autoscrolling !!!
JS.eval("addTextAndScroll = addText;") in room1 not working.....