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
366
Reaction score
336
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,275
Reaction score
508
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

Once again working on a game I'm not sure I'm going to sell or even publish
That feel when you're awake past midnight and suddenly you're one year older :ninja:
I miss collaborations, but I don't know how to find someone to make face parts just to share them with others, and even though I don't like writing or music, I can't trust anyone with writing on my game because it has themes that are easy to mess up, and music needs a clear tone and scenes.
People donating to me for my upcoming birthday so I can pay my team a little. Such angels, I'm so happy. T uT I smile so much my face hurts. Good souls in this world.
Playing Ragnarok Online again is very nostalgic. The last time I played it was 20 years ago, when I was ten-twelve old.
My first mmorpg.^^

Forum statistics

Threads
105,571
Messages
1,014,723
Members
137,245
Latest member
dashstop
Top