I need some help with a method of window.contents. I would like to know the arguments for draw_text, and how to fix this little script:
EDIT::Made some changes:
I need to window to be in the center of the screen, and I need the text to appear (which won't for unseen reasons). Any help would be much appreciated. Peace Out!
~Broken
EDIT::Made some changes:
Code:
class Window_PickLock < Window_Base
#PICK_ID = Game_LocKeys::PICK_ID
attr_accessor :pick_count
attr_accessor :text #Starts as "You attempt to pick the lock!"
def initialize(text)
super(100, 100, 448, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@text = text
self.x = 320 - width/2
self.y = 240 - height/2
refresh(@text)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(text, pick_count = $game_party.item_number(Lock::PICK_ID))
self.contents.clear
cx = contents.text_size(text).width
self.contents.font.color = normal_color
#self.contents.draw_text(x, y, width, hieght, hieght, text[, align])
self.contents.draw_text(4, 0, 120-cx-2, 32, text)
end
#--------------------------------------------------------------------------
# * Text
#--------------------------------------------------------------------------
def text=(string)
@text = string
refresh(@text)
end
end
I need to window to be in the center of the screen, and I need the text to appear (which won't for unseen reasons). Any help would be much appreciated. Peace Out!
~Broken