marblelight
Member
Hi i've got this script written by AcedentProne which shows the time and money in the same window and instead of writing "Time" and "$data_system.words.gold" i want it to show icons instead
i put this into the script
and from that i get the error "can't convert Fixnum into Bitmap"
well i know why it's there i just don't know how to fix it':|
Please Help.
i put this into the script
Code:
self.contents.blt(124-cx2+1, 4, cx2, 32, RPG::Cache.icon(Window_GameStats::Gold_Symbol))
well i know why it's there i just don't know how to fix it':|
Please Help.
Code:
#=======================================#
# â– Window_GameStats #
# written by AcedentProne #
#------------------------------------------------------------------------------#
class Window_GameStats < Window_Base
Gold_Symbol = "G"
Clock_Symbol = "Clock"
def initialize
super(0, 0, 160, 60)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
#Drawing gold into separate commas by Dubealex
case $game_party.gold
when 0..9999
gold = $game_party.gold
when 10000..99999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
when 100000..999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
when 1000000..9999999
gold = $game_party.gold.to_s
array = gold.split(//)
gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
end
#Draw Gold
self.contents.font.color = system_color
gold_word = $data_system.words.gold.to_s
cx = contents.text_size(gold_word).width
cx2=contents.text_size(gold.to_s).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 4, 120-cx-2, 32, gold_word, 2)
self.contents.blt(124-cx2+1, 4, cx2, 32, RPG::Cache.icon(Window_GameStats::Gold_Symbol))
# Draw "Time"
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, -10, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.blt(4, -10, 120, 32, RPG::Cache.icon(Window_GameStats::Clock_Symbol))
end
#--------------------------------------------------------------------------
# Update of The count
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end