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,368
Reaction score
604
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 Posts

Latest Profile Posts

Based on this screenshot alone, which one would you sell, and which to equip?
Some random sketch-letons.

I have a strong urge to make a tutorial video of all the random things I've learned since starting on my game. little helpful tips and stuff that may help people.
Do you guys think it's better to have all members in your team from the beginning (then you can pick who battles) or you gain team members as the story goes?
PL: Patch polonizujący do RPG Makera 2003 prawie gotowy! Mamy przetłumaczoną bazę danych (projekt), polskie fonty, wiadomości walki i jakieś 90% edytora.
Do przetłumacznia pozostało te 10% edytora i plik pomocy. Niedługo więcej informacji!

Forum statistics

Threads
107,479
Messages
1,029,970
Members
139,606
Latest member
Aerilate
Top