I made a pokedex script but I need some help,
look:
http://img328.imageshack.us/img328/2553/naamloosks3.jpg[/img]
I want to show the picture of the pokemon in the left window, here is my script
You need this module
and you need this picture:
http://img194.imageshack.us/img194/4332/pokedexpi3.png[/img]
call it pokedex and put it in the pictures folder
look:
http://img328.imageshack.us/img328/2553/naamloosks3.jpg[/img]
I want to show the picture of the pokemon in the left window, here is my script
class Window_showpicture < Window_Base
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 139,245)
self.contents = Bitmap.new(width - 32, height - 32)
end
def update
end
#---------------------------------------------------------------------------------
end
Font.default_name = "Pokemon RS"
Font.default_size = 24
class Window_pokedex < Window_Selectable
def initialize
super(0, 0, 255,210)
@item_max = $data_enemies.size - 1
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.index = 0
refresh
end # end of initialize
def refresh
self.contents.clear
for i in 0...$data_enemies.size
enemy = $data_enemies
x = 4
y = i * 32 - 32
next if enemy == nil
id = sprintf("%03d" , enemy.id)
name = enemy.seen == true ? enemy.name : "not seen"
self.contents.draw_text(x, y, 196, 32, "#{id} - #{name}")
end # end of for statement
end # end of method
end # end of Window_pokedex
class Scene_pokedex
def main
#the pokedex window
@win = Window_pokedex.new
@win.x =260
@win.y =24
@win.height = 270
@win.width = 220
@win.z = 9998
@showpicture = Window_showpicture.new
@showpicture.x =120
@showpicture.y =37
@showpicture.z = 9998
#the pokedex background
@dex = Sprite.new
@dex.bitmap = RPG::Cache.picture("pokedex")
@dex.z = 9996
@dex.zoom_x = 2
@dex.zoom_y = 2
@bg = Sprite.new
@bg.z = 9995
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@win.dispose
@dex.dispose
@bg.dispose
@showpicture.dispose
end
def update
@win.update
@dex.update
@bg.update
@showpicture.update
if Input.press?(Input::B)
$scene = Scene_Map.new
end
end
end
#---------------------------------------------------------------------------------
def initialize
super(0, 0, 139,245)
self.contents = Bitmap.new(width - 32, height - 32)
end
def update
end
#---------------------------------------------------------------------------------
end
Font.default_name = "Pokemon RS"
Font.default_size = 24
class Window_pokedex < Window_Selectable
def initialize
super(0, 0, 255,210)
@item_max = $data_enemies.size - 1
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.index = 0
refresh
end # end of initialize
def refresh
self.contents.clear
for i in 0...$data_enemies.size
enemy = $data_enemies
x = 4
y = i * 32 - 32
next if enemy == nil
id = sprintf("%03d" , enemy.id)
name = enemy.seen == true ? enemy.name : "not seen"
self.contents.draw_text(x, y, 196, 32, "#{id} - #{name}")
end # end of for statement
end # end of method
end # end of Window_pokedex
class Scene_pokedex
def main
#the pokedex window
@win = Window_pokedex.new
@win.x =260
@win.y =24
@win.height = 270
@win.width = 220
@win.z = 9998
@showpicture = Window_showpicture.new
@showpicture.x =120
@showpicture.y =37
@showpicture.z = 9998
#the pokedex background
@dex = Sprite.new
@dex.bitmap = RPG::Cache.picture("pokedex")
@dex.z = 9996
@dex.zoom_x = 2
@dex.zoom_y = 2
@bg = Sprite.new
@bg.z = 9995
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@win.dispose
@dex.dispose
@bg.dispose
@showpicture.dispose
end
def update
@win.update
@dex.update
@bg.update
@showpicture.update
if Input.press?(Input::B)
$scene = Scene_Map.new
end
end
end
You need this module
module RPG
class Enemy
attr_accessor :seen
alias old_initialize initialize
def initialize
seen = []
for i in 0...999
seen = false
end
end
end
end
class Enemy
attr_accessor :seen
alias old_initialize initialize
def initialize
seen = []
for i in 0...999
seen = false
end
end
end
end
and you need this picture:
http://img194.imageshack.us/img194/4332/pokedexpi3.png[/img]
call it pokedex and put it in the pictures folder