Project1
标题: 请问怎么在不用时关掉这个脚本…… [打印本页]
作者: z121310 时间: 2012-8-16 10:20
标题: 请问怎么在不用时关掉这个脚本……
这是一个显示虚拟游戏时间的脚本,怎么在不用时关掉它:- class Scene_Map
- def main
- @MSG_Movie_Window = Window_MSGMovie.new
- @black = Sprite.new
- @black.bitmap = Bitmap.new(640,480)
- @black.bitmap.fill_rect(0,0,640,50,Color.new(25,25,25,255))
- @black.bitmap.fill_rect(0,400,640,80,Color.new(25,25,25,255))
- @black.opacity = 0
- @black.z = 1
- @spriteset = Spriteset_Map.new
- @message_window = Window_Message.new
- @time_date_window = Window_Time_Date.new
- Graphics.transition
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end # end if $scene != self
- end # end loop do
- Graphics.freeze
- @spriteset.dispose
- @message_window.dispose
- @time_date_window.dispose
- if $scene.is_a?(Scene_Title)
- Graphics.transition
- Graphics.freeze
- end # end if $scene.is_a?(Scene_Title)
- end # end def main
- end # end class Scene_Map
- class Window_Time_Date < Window_Base
- def initialize
- super(390, 0, 250, 55)
- self.contents = Bitmap.new(width - 33, height - 33)
- refresh
- end # end def initialize
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.font.size = 19
- @total_sec = Graphics.frame_count
- if @total_sec % 9 ==0
- $game_variables[1] += 1
- end # end if @total_sec % 40 ==0
-
- if $game_variables[1] >= 60 + 0
- $game_variables[1] = 0
- $game_variables[2] += 1
- end # end if $game_variables[1] >= 60 + 0
-
- if $game_variables[2] >= 23 + 1
- $game_variables[2] = 0
- $game_variables[3] += 1
- end # end if $game_variables[2] >= 23 + 1
-
- if $game_variables[3] >= 30 + 1
- $game_variables[3] = 1
- $game_variables[4] += 1
- end # end if $game_variables[3] >= 30 + 1
-
- if $game_variables[4] >= 12 + 1
- $game_variables[4] = 1
- $game_variables[5] += 1
- end # end if $game_variables[4] >= 12 + 1
-
- text_min = ["00", "01", "02", "03", "04", "05", "06","07","08","09","10","11",
- "12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27",
- "28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43",
- "44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59",
- "60"][$game_variables[1]]
- text_hour = ["00:", "01:", "02:", "03:", "04:", "05:", "06:",
- "07:", "08:", "09:", "10:", "11:", "12:","13:","14:","15:","16:",
- "17:","18:","19:","20:","21:","22:","23:","24:"][$game_variables[2]]
- text_day = ["", "01日", "02日", "03日", "04日", "05日", "06日",
- "07日", "08日", "09日", "10日", "11日", "12日",
- "13日", "14日", "15日", "16日", "17日", "18日",
- "19日", "20日", "21日", "22日", "23日", "24日",
- "25日", "26日", "27日", "28日", "29日",
- "30日"][$game_variables[3]]
- text_month = ["", " 01月", " 02月", " 03月", " 04月", " 05月", " 06月",
- " 07月", " 08月", " 09月", " 10月", " 11月", " 12月"][$game_variables[4]]
- text_year = ["1560年", "1561年", "1562年","1563年","1564年","1565年","1566年",
- "1567年","1568年","1569年","1570年","1571年","1572年"][$game_variables[5]]
- self.contents.clear
- self.contents.draw_text(5, -5, 128, 32,text_year)
- self.contents.draw_text(60, -5, 128, 32, text_month)
- self.contents.draw_text(111, -5, 128, 32, text_day)
- self.contents.draw_text(155, -5, 128, 32, text_hour)
- self.contents.draw_text(184, -5, 128, 32, text_min)
- def update
- super
- refresh
- end
- end
- end
复制代码