Using scrollarea repeatedly. Do variables need reset?

  • I have implemented a tour with several information pop-ups using scrollarea The message box that is generated can be called to display many different messages. This all works well an but there is an issue when the message box is scrolled...

    If the message box is used and the text is a bit long then the user drags the text down to read.

    After the message box is dismissed, if another instance of the message box is started, and this time it displays a very short message.

    After the above scénario, the short message doesn't display because the message box still thinks the long message is there and so remains scrolled down. There are three outcomes for this behaviour:

    1. If nothing has been scrolled (or the scroll is moved back to the start) then the system works normally.

    2. If the first message is longer than the second message by less than the height of the message box then on the first drag event there is an awkward jump then everything works.

    3. If the new message is a lot shorter than the original message then the second message appears to be blank, and it stays blank. I dont believe it is blank, its just that you are stuck looking at the window past where there is active data.

    I believe I am not resetting a variable that needs reset. The variable containing the y position of the currently displayed message is being left behind and reused when it should be reset.

    After exhausting most possibilities with the obvious variables used, I believe there must be a less obvious variable, e.g. layer[scrollbox].find_y_here,0 that needs reset, can anyone help please?

    Thanks

    James

    Edited once, last by james: spelling, typo and clarity. (May 9, 2024 at 11:05 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!