Quest Script

Started by G_G, May 31, 2009, 11:43:40 am

Previous topic - Next topic

G_G

Okay this window is being stupid. The window is setup correctly I'm sure yet it says undefined method .clear or something heres my window

Spoiler: ShowHide
class Window_QuestInfo < Window_Base
  def initialize(name, info, location, reward, completed)
    super(300, 64, 340, 416)
    @name = name
    @info = info
    self.z = 200
    @location = location
    @reward = reward
    @completed = completed
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 300, 32, "Quest")
    self.contents.draw_text(4, 64, 300, 32, "Description")
    self.contents.draw_text(4, 160, 300, 32, "Location")
    self.contents.draw_text(4, 256, 300, 32, "Reward")
    self.contents.draw_text(4, 320, 300, 32, "Completed")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 300, 32, @name)
    self.contents.draw_text(4, 96, 300, 32, @info)
    self.contents.draw_text(4, 192, 300, 32, @location)
    self.contents.draw_text(4, 288, 300, 32, @reward)
    self.contents.draw_text(4, 352, 300, 32, @completed)
  end
end


Someone help here's the error I get

Spoiler: ShowHide

Aqua

.clear is a Sprite feature, not a Window one.

I don't know the Window equivalent... @.@

G_G

I removed that line and apparently it gets an error with
self.contents.font.color = system_color

It says the same error just replaces clear with font and I know that cant be right

Blizzard

You never created the bitmap. There's no line in def initialize saying:

self.contents = Bitmap.new(width - 32, height - 32)
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

OMG I AM RETARDED!!! Thats one of the things I have to remember in windows and I forgot!! Thanks blizzard!

Blizzard

It still sometimes happens to me as well. xD
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.