|
|
|
 |
Posted 2008-02-06, 01:41 PM
in reply to ironfist68's post starting "Ok well take this for an example, I..."
|
 |
 |
 |
Are you saying that you want text in the form of going from top to bottom see though? Not like credits? Let me take a look at the ruby code I will take this code and try to rewrite it, and see if I can get it to work, I am alright at scripting with ruby.
----
Here is the full code and make sure to make a picture called "scrollingtext.jpg" and place it in pictures.
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 |
--EDIT
One more thing make a non-touchable event off screen run this unter the script command "$scene = Scroll.new(1,1)"

Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。
I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.
Speed Test
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl
Anime List
Last edited by Goodlookinguy; 2008-02-06 at 07:15 PM.
|
 |
 |
 |
|
|
|
|
|
|
|