PhoenixTilea
Member
Ugh... I'm having nothing but problems lately... Probably because I'm trying to program without being good at this language.
Okay... Basically, when I call this from the target window in the menu, it just goes to a black screen:
There's my window and my scene... I've looked at other scripts and even stuff I've done, and I can't figure this out at all...
Okay... Basically, when I call this from the target window in the menu, it just goes to a black screen:
Code:
Â
class Window_Bio < Window_Base
 attr_accessor :name
 attr_accessor :class
 attr_accessor :gender
 attr_accessor :age
 attr_accessor :height
 attr_accessor :weight
Â
 def initialize(actor)
  super(0, 0, 640, 480)
  self.contents = Bitmap.new(width - 32, height - 32)
  @actor = $game_party.actors[actor]
  @id = @actor.id
  @name = @actor.name.to_s
  @class = @actor.class_name.to_s
  @gender = ["1", "2", "3", "4"]
  @age = ["1", "2", "3", "4"]
  @height = ["1", "2", "3", "4"]
  @weight = ["1", "2", "3", "4"]
  refresh
  self.visible = true
 end
Â
 def refresh
  self.contents.clear
  draw_graphic(@actor)
  draw_name
  draw_class
  draw_gender(@id)
  draw_age(@id)
  draw_height(@id)
  draw_weight(@id)
  self.contents.font.color = system_color
  self.contents.draw_text(100, 50, 100, 32, "Class: ", 2)
  self.contents.draw_text(100, 114, 100, 32, "Gender: ", 2)
  self.contents.draw_text(100, 145, 100, 32, "Age: ", 2)
  self.contents.draw_text(300, 50, 100, 32, "Height: ", 2)
  self.contents.draw_text(300, 82, 100, 32, "Weight: ", 2)
  return
 end
Â
 def draw_name
  self.contents.font.size = 48
  self.contents.draw_text(0, 0, 608, 50, @name, 1)
 end
Â
 def draw_graphic(actor)
  bitmap = Bitmap.new('Graphics/Pictures/' + actor.name)
  rect = Rect.new(2, 0, 100, 100)
  self.contents.blt(0, 50, bitmap, rect)
 end
 Â
 def draw_class
  self.contents.draw_text(200, 82, 100, 32, @class)
 end
Â
 def draw_gender(actor)
  self.contents.draw_text(200, 114, 100, 32, @gender[actor])
 end
Â
 def draw_age(actor)
  self.contents.draw_text(200, 146, 100, 32, age[actor])
 end
Â
 def draw_height(actor)
  self.contents.draw_text(400, 50, 100, 32, height[actor])
 end
Â
 def draw_weight(actor)
  self.contents.draw_text(400, 82, 100, 32, weight[actor])
 end
end
Â
Code:
Â
class Scene_Bio
 def initialize(actor)
  @actor = actor
 end
Â
 def main
  @bio = Window_Bio.new(@actor)
  @bio.visible = true
  @bio.active = true
  Graphics.transition
  loop do
   Graphics.update
   Input.update
   update
   if $scene != self
    break
   end
  end
  Graphics.freeze
  @bio.dispose
 end
 Â
 def update
  if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Menu.new(5)
  end
 end
end
Â
There's my window and my scene... I've looked at other scripts and even stuff I've done, and I can't figure this out at all...