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.

Can't remember how to use scroll text script.

Text Scroll Script R3-Fixed - Created by dubealex

I can't remember how to use it and it doesn't have any notes. this is what I get for taking out sections from my game to redo them a year later >_<
 
I am not sure about dubes, but I just worked this up real quick:
Code:
class Scene_TextScroll
  def initialize(filename, scroll_speed = 4, transition_frames = 40)
    @filename = filename
    @scroll_speed = scroll_speed
    @transtion_frames = transition_frames
    @last_scene = $scene.class
  end
  def main
    @textscroll_window = Window_TextScroll.new(@filename)
    Graphics.transition(@transtion_frames)
    loop do
      Graphics.update
      Input.update
      @textscroll_window.y -= @scroll_speed
      if @textscroll_window.y == 0 - @textscroll_window.height
        break
      end
    end
    Graphics.freeze
    @textscroll_window.dispose
    $scene = @last_scene.new
  end
end

class Window_TextScroll < Window_Base
  def initialize(filename)
    file = "TextScroll/#{filename}"
    lines = IO.readlines(file)
    super(0, 480, 640, lines.size * 24 + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    for i in 0...lines.size
      self.contents.draw_text(0, i * 24, 640, 24, lines[i], 1)
    end
  end
end

Make a folder in you project folder named TextScroll. Put text files in it with whatever names, and just type you text there.

Then, just call it with:
Code:
$scene = Scene_TextScroll.new(filename, scroll_speed, transition_frames)

Theres defaults on the scroll speed and transition frames, so you don't have to send those arguments if you don't want to.

I didn't put any effort into it, but if you want to change anything go for it. If you need help just ask.

I am sure Dube's probably works just like this to a degree.
 

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