Started by Calintz, October 13, 2009, 02:46:49 pm
#===============================================================================# Calintz's CMS v1.0# Enhanced Menu System#===============================================================================class CalintzCMS < Window_Base#===============================================================================# Object Initialize#=============================================================================== def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) end def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = 20 cx = contents.text_size("Hello").width self.font.draw_text(width/3, height/3+100, cx, 32, "Hello") @bitmap = RPG::Cache.battler("Luke", 0) self.contents.blt(width/3, height/3, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160) end end#===============================================================================# Calintz's CMS Scene#===============================================================================class Scene_CalintzCMS #===============================================================================# Main Processing#=============================================================================== def main # call the window @window = CalintzCMS.new # execute transition Graphics.transition # main loop loop do # update game screen Graphics.update # update input information Input.update # frame update update # abort this loop if the screen changes if $scene != self break end end # prepare for transition Graphics.transition # dispose of the window @window.dispose end #----------------------------------------------------------------------------- # Frame Update #----------------------------------------------------------------------------- def update # update windows @window.update # if the B button is pressed ... if Input.trigger?(Input::B) # play cancel se $game_system.se_play($data_system.cancel_se) # return to menu $scene = Scene_Menu.new return end end end
#===============================================================================# Calintz's CMS v1.0# Enhanced Menu System#===============================================================================class CalintzCMS < Window_Base#===============================================================================# Object Initialize#=============================================================================== def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) # NEW CODE BELOW refresh end def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = 20 cx = contents.text_size("Hello").width self.font.draw_text(width/3, height/3+100, cx, 32, "Hello") @bitmap = RPG::Cache.battler("Luke", 0) self.contents.blt(width/3, height/3, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160) end end#===============================================================================# Calintz's CMS Scene#===============================================================================class Scene_CalintzCMS #===============================================================================# Main Processing#=============================================================================== def main # call the window @window = CalintzCMS.new # execute transition Graphics.transition # main loop loop do # update game screen Graphics.update # update input information Input.update # frame update update # abort this loop if the screen changes if $scene != self break end end # prepare for transition Graphics.transition # dispose of the window @window.dispose end #----------------------------------------------------------------------------- # Frame Update #----------------------------------------------------------------------------- def update # update windows @window.update # if the B button is pressed ... if Input.trigger?(Input::B) # play cancel se $game_system.se_play($data_system.cancel_se) # return to menu $scene = Scene_Menu.new return end end end