CODE
class Window_Betting < Window_Base
#-----------------------------------------
######Object Initialization###############
#-----------------------------------------
attr_accessor :variable
def initialize
super (0, 0, 256, 96)
self.contents = Bitmap.new(width - 32, height - 32)
#Wins and Losses
@Betting_Wins=$game_variables[1]
@Betting_GoldWon=$game_variables[2]
refresh
end
#-------------------------------------------
#############Refresh########################
#-------------------------------------------
def refresh
self.contents.clear
update
self.contents.draw_text(0, 0, 256, 32, "Dice Gamble", 1)
self.contents.draw_text(0, 0, 256, 64, "Wins")
self.contents.draw_text(0, 0, 256, 64, @Betting_Wins.to_s, 1)
self.contents.draw_text(0, 0, 256, 98, "Gold Won")
self.contents.draw_text(0, 0, 256, 98, @Betting_GoldWon.to_s,1)
end
#--------------------------------------------
##############Update#########################
#--------------------------------------------
def update
super
if $game_variables[1] != @Betting_Wins or $game_variables[2] != @Betting_GoldWon
@Betting_Wins=$game_variables[1]
@Betting_GoldWon=$game_variables[2]
end
end
end
#-----------------------------------------
######Object Initialization###############
#-----------------------------------------
attr_accessor :variable
def initialize
super (0, 0, 256, 96)
self.contents = Bitmap.new(width - 32, height - 32)
#Wins and Losses
@Betting_Wins=$game_variables[1]
@Betting_GoldWon=$game_variables[2]
refresh
end
#-------------------------------------------
#############Refresh########################
#-------------------------------------------
def refresh
self.contents.clear
update
self.contents.draw_text(0, 0, 256, 32, "Dice Gamble", 1)
self.contents.draw_text(0, 0, 256, 64, "Wins")
self.contents.draw_text(0, 0, 256, 64, @Betting_Wins.to_s, 1)
self.contents.draw_text(0, 0, 256, 98, "Gold Won")
self.contents.draw_text(0, 0, 256, 98, @Betting_GoldWon.to_s,1)
end
#--------------------------------------------
##############Update#########################
#--------------------------------------------
def update
super
if $game_variables[1] != @Betting_Wins or $game_variables[2] != @Betting_GoldWon
@Betting_Wins=$game_variables[1]
@Betting_GoldWon=$game_variables[2]
end
end
end
