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
379
Reaction score
354
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,315
Reaction score
536
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

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top