RMMV Appending text to a window with scroll

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
Ok, the title may be a bit confusing but I could not find a better way to summarize my issue.

So I have a window that periodically gets text added to it, when new text is added the old text is pushed up vertically by a fixed amount, (this is the first problem) I do not want the text to overlap, think "chat box" I'm very new to windows in rpg maker.

Here's a diagram of what I'm trying to explain

because the new text is always a different length I do not want the old text to be moved up by a fixed amount, how can i calculate how much the old text should be moved up by?

The second problem is once the window is full how do I create a scrolling effect? Right now i'm just clearing the entire window after a fixed amount of text has been appended, e.g. after 7 additions the window is cleared. By scrolling affect I mean I want all the text to stay in the box but as new text is added it continuously scrolls.

Thanks for listening, and I will appreciate any help.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
439
Reaction score
421
First Language
german
Primarily Uses
RMMZ
because the new text is always a different length I do not want the old text to be moved up by a fixed amount, how can i calculate how much the old text should be moved up by?
You can use "this.fittingHeight(numberOfLines)" to the height, when you know or able to guess the number of lines of the text.

The second problem is once the window is full how do I create a scrolling effect? Right now i'm just clearing the entire window after a fixed amount of text has been appended, e.g. after 7 additions the window is cleared. By scrolling affect I mean I want all the text to stay in the box but as new text is added it continuously scrolls.
Let your Window inherit from Window_Scrollable. Use "this.scrollBaseY()" to get the y value of the text to be drawn. Then you need to override the "overallHeight()" method. As soon as this method returns a number being higher than the window itself, the scroll effect is applied automatically for you :)
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
I really appreciate the answer and it did help, I the first problem is pretty much solved.
However, this is RMMV and Window_Scrollable does not exist in MV, perhaps Window_Selectable could be used in someway?
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,367
Reaction score
603
First Language
indonesian
I really appreciate the answer and it did help, I the first problem is pretty much solved.
However, this is RMMV and Window_Scrollable does not exist in MV, perhaps Window_Selectable could be used in someway?
you can try making a custom window named Window_Scrollable... make it's 'parent' Window_Selectable...
and try adding the Window_Scrollable code from MZ to that custom window.

maybe need some little fine tuning here and there... there's also potential problem with "Mouse part" (if MV and MZ have different mouse function name) but it's a start.

hope this help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Made a surprising amount of progress in these past two days. Really helps when parallax mapping breaks limitation and allowing me to be creative and make maps that match my vision.
Let's promote our amazing artists in RPG Maker community! I posted right now about my game Phil Alone on Twitter and I decided to thanks Lime Zu, the amazing artist that did all the pixel assets for my game!
I just realised that the reason behind me not being able to make a game may be the lack of my original resources. I just dont like the look of MV faces and sprites, lol. Guess I will have make my own art.
I'm posting a commission art soon! :kaoswt2:
So here's a fun/tragic fact about me: I have an awful memory. But to be correct, I have memory "leaks". My memory is actually amazing, my issue is I can't keep memories for long, in fact, I once forgot my name. :kaoswt2:

Forum statistics

Threads
107,455
Messages
1,029,813
Members
139,586
Latest member
chikenwyngx
Top