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 script help

ccgr

Member

Hi everyone. I'm playing with RMXP and I'm trying to get an intro text going

I see this script here but any text after line 115 will not get shown..how can I expand that for more text?

Code:
#================================================= ====

# * Scrolling Text v 1.0

# by shadowball

# 14.01.2008

#================================================= ====

class Scrolling_Text < Window_Base

def initialize(index)

@index = index

super(0,480,500,544)

self.contents = Bitmap.new(width - 32, height - 32)

case index

when 0

@text = {

100 => 'Este script al menos sirve para dos cosas,',

101 => 'a no ser que a Uds. se les ocurra otras más.',

102 => '',

103 => 'Es útil para esas introducciones con',

104 => 'la historia de fondo de su juego, para',

105 => 'dar inicio a un nuevo capítulo...',

106 => 'O puede servir para los créditos también.',

107 => 'Siempre me pregunté por qué debían verse',

108 => 'tan estáticos o por qué se debían crear',

109 => 'varias imágenes para algo tan sencillo.',

110 => '',

111 => 'Este script no les impide usar un fondo de',

112 => 'pantalla. Si quieren, usen uno a su gusto.',

113 => '',

114 => 'Creo que esto es más fácil de editar en caso',

115 => 'de errores ortográficos o de alineamiento.'

}

when 1

self.contents.font.color = gold_color

@text = {

100 => 'Este es un ejemplo de cómo reutilizar el script',

101 => 'en caso de que necesiten usarlo al inicio de un',

102 => 'nuevo capítulo. Ah, lo demás está igual.',

103 => 'Es útil para esas introducciones con',

104 => 'la historia de fondo de su juego, para',

105 => 'dar inicio a un nuevo capítulo...',

106 => 'O puede servir para los créditos también.',

107 => 'Siempre me pregunté por qué debían verse',

108 => 'tan estáticos o por qué se debían crear',

109 => 'varias imágenes para algo tan sencillo.',

110 => '',

111 => 'Este script no les impide usar un fondo de',

112 => 'pantalla. Si quieren, usen uno a su gusto.',

113 => '',

114 => 'Creo que esto es más fácil de editar en caso',

115 => 'de errores ortográficos o de alineamiento.'

}

end

y = -32

@text.sort.each do |keys, values|

y += 32

self.contents.draw_text(0,y,488,32, values)

end

self.opacity = 0

refresh

end

 

def refresh

self.y -= 1 if self.y > -544

end

 

end

 

#================================================= ====

# * Scroll (Scene) v 1.0

# by shadowball

# 14.01.2008

#================================================= ====

 

class Scroll

 

def initialize(index = 0, pic = 0)

@index = index

@pic = pic

end

 

def main

@sprite1 = Sprite.new

@sprite1.bitmap = RPG::Cache.picture('scrollingtext')

@sprite2 = Sprite.new

if @pic == 1

@sprite2.bitmap = RPG::Cache.picture('barranegra')

@sprite2.z = 250

end

if @index == 0

@shb_scroll_window = Scrolling_Text.new(0)

elsif @index == 1

@shb_scroll_window = Scrolling_Text.new(1)

end

@shb_scroll_window.x = 80

@shb_scroll_window.y = 480

# Execute transition

Graphics.transition

# Main loop

loop do

# Update game screen

Graphics.update

# Update input information

Input.update

# Frame update

update

# Abort loop if screen is changed

if $scene != self

break

end

end

# Prepare for transition

Graphics.freeze

# Dispose of windows

@shb_scroll_window.dispose

@sprite1.dispose

@sprite1.bitmap.dispose

if @pic == 1

@sprite2.dispose

@sprite2.bitmap.dispose

end

end

 

def update

# Update windows

@shb_scroll_window.refresh

if @pic == 0

if @shb_scroll_window.y == -544

$scene = Scene_Map.new

elsif Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

$scene = Scene_Map.new

end

elsif @pic == 1

if @shb_scroll_window.y == -320

$scene = Scene_Map.new

elsif Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

$scene = Scene_Map.new

end

end

end

end

 

class Scene_Title

def command_new_game

# Play decision SE

$game_system.se_play($data_system.decision_se)

# Stop BGM

Audio.bgm_stop

# Reset frame count for measuring play time

Graphics.frame_count = 0

# Make each type of game object

$game_temp = Game_Temp.new

$game_system = Game_System.new

$game_switches = Game_Switches.new

$game_variables = Game_Variables.new

$game_self_switches = Game_SelfSwitches.new

$game_screen = Game_Screen.new

$game_actors = Game_Actors.new

$game_party = Game_Party.new

$game_troop = Game_Troop.new

$game_map = Game_Map.new

$game_player = Game_Player.new

# Set up initial party

$game_party.setup_starting_members

# Set up initial map position

$game_map.setup($data_system.start_map_id)

# Move player to initial position

$game_player.moveto($data_system.start_x, $data_system.start_y)

# Refresh player

$game_player.refresh

# Run automatic change for BGM and BGS set with map

$game_map.autoplay

# Update map (run parallel process event)

$game_map.update

# Switch to map screen

$scene = Scroll.new

end

end
 
When you say "won't get shown", what do you mean?

What is this script supposed to do?

From first glance it looks like the window is too small to display anything over 15 lines, so editing line 9 may help:

super(0,480,500,544)

That's (x, y, width, height)

Try editting the height (544) to a higher number.
 

ccgr

Member

I'm trying to use the script for a game intro, story back drop (in English) the script places a back ground image and scroll the text

Currently if I add some lines to the first section 116-119 or whatever they will just not appear in the game.. they get cut off
 

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