Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

scrolling... text

Aran

Member

Now I've heard of somebody's (dubealex's most likely) text scrolling for books and what not, but i wasn't sure if it could make the text in regular messages scroll. What I'd like to know is: how do you make the message text scroll (when you press DOWN or UP) instead of having to hit the [Action Button] to continue with the text?

I mean yes, I know that I have to change the ox and the oy values, for one, but to what?
 
Yes. The plane class is just like a sprite, just tiles the bitmap instead of displaying it once.

So you could do something like this:

Code:
bitmap = Bitmap.new(640, 960)
lines = ['Some Random Line', 'Another Random Line', 'Seph is Great', 'Trickster is a Tool!', 'Hahahaha']
for i in 0...40
  bitmap.draw_text(0, i * 24, 640, 24, lines[rand(5)])
end

# Insert this in main
@plane = Plane.new(Viewport.new(0, 0, 640, 480))
@plane.bitmap = bitmap

# Insert this in update
@plane.oy += 4

Just try it.
 

Queue

Sponsor

This was how that old preview game of RMXP animated it's title screen. If you wanted a title screen Background or Text that animated, you could easily use that script in a newly created Scene (Set up properly) and it would say:

Some Random Line
Another Random Line
Seph is Great
Trickster is a Tool!
Hahahaha

Which would animate in across the screen like a marquee and freeze at a certain point that Sephi defined. It can also be used for pictures but without the freezing frame. I think I might be wrong with the freezing of the text, or perhaps not, kinda rusty to RGSS.

class Scene_SephiAnimate
def main
bitmap = Bitmap.new(640, 960)
lines = ['Some Random Line', 'Another Random Line', 'Seph is Great', 'Trickster is a Tool!', 'Hahahaha']
for i in 0...40
bitmap.draw_text(0, i * 24, 640, 24, lines[rand(5)])
end
@plane = Plane.new(Viewport.new(0, 0, 640, 480))
@plane.bitmap = bitmap
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
end
def update
@plane.oy += 4
end
end
A butchered Scene_Title as an example. Throw that above main and have an event call it with
Code:
$scene = Scene_SephiAnimate.new

NOTE: It'll loop.
 

Aran

Member

@Quintessence: That works, but its not what I'm talking about.

Okay, in RMXP your messages are broken up and thus you have to hit the [action button] to go to the next line. I'm talking about a script that makes it so your text is all in one text box and you can scroll down or up the text when you hold the down or up button.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top