赞 | 26 |
VIP | 0 |
好人卡 | 2 |
积分 | 31 |
经验 | 24979 |
最后登录 | 2024-1-20 |
在线时间 | 764 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3078
- 在线时间
- 764 小时
- 注册时间
- 2008-7-5
- 帖子
- 760
|
2楼
楼主 |
发表于 2009-5-15 03:42:26
|
只看该作者
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 生成活动块
- @spriteset = Spriteset_Map.new
- # 生成信息窗口
- @message_window = Window_Message.new
- @time_date_window = Window_Time_Date.new
- @gold_window = Window_Gold.new
- @gold_window.x = 75
- @gold_window.y = 20
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放活动块
- @spriteset.dispose
- # 释放信息窗口
- @message_window.dispose
- @time_date_window.dispose
- @gold_window.dispose
- # 标题画面切换中的情况下
- if $scene.is_a?(Scene_Title)
- # 淡入淡出画面
- Graphics.transition
- Graphics.freeze
- end
- end
- alias timedate_update update
- def update
- timedate_update
- @gold_window.refresh
- end # end def update
- end
- #-----------------------------------------
- class Window_Time_Date < Window_Base
- #-----------------------------------------
- def initialize
- super(0, 0, 240, 80)
- self.contents = Bitmap.new(width - 32, height - 32)
- $game_variables[3] = 30
- $game_variables[4] = 12
- $game_variables[5] = 1
- unless $scene.is_a?(Scene_Shop)
- end
- refresh
- end # end def initialize
- def refresh
- @total_sec = Graphics.frame_count
- 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_day = ["","1日","2日","3日","4日","5日","6日","7日","8日","9日","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 = ["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月",
- "11月","12月",][$game_variables[4]]
- text_year = ["", "第1年","第2年","第3年","第4年"][$game_variables[5]]
- self.contents.clear
- self.contents.draw_text(0, -5, 128, 32, text_month)
- self.contents.draw_text(45, -5, 128, 32, text_day)
- self.contents.draw_text(15, -5, 128, 80,text_year)
-
- self.contents.font.color = system_color
- self.contents.draw_text(100, -5, 128, 32, "名声") #描绘声望字样
- self.contents.font.color = normal_color
- self.contents.draw_text(170,-5,128, 32, $game_variables[1].to_s)#描绘声望值.
- if $game_player.screen_x >= (0 - 16) && $game_player.screen_x <= (0 + 640 + 16)
- if $game_player.screen_y >= (0 - 16) && $game_player.screen_y <= (0 + 55 + 16)
- self.x = 0
- self.y = 425
- @time_date_time_window_shifted = true
- else
- self.x = 0
- self.y = 0
- @time_date_time_window_shifted = false
- end # end if $game_player.screen_y >= (0 - 16) && $game_player.screen_y <= (0 + 55 + 16)
- else
- self.x = 0
- self.y = 0
- @time_date_time_window_shifted = false
- end # end if $game_player.screen_x >= (0 - 16) && $game_player.screen_x <= (0 + 640 + 16)
-
- if Input.press?(Input::A)
- if @time_date_time_window_shifted == true
- self.x = 0
- self.y = 425
- else
- self.x = 0
- self.y = 0
- end # end if @time_date_time_window_shifted = true
- else
- if @time_date_time_window_shifted == true
- self.y = 425 + 55 - 8
- else
- self.y = -(55) + 8
- end # end if @time_date_time_window_shifted = true
- end # end if Input.press?(Input::A)
- end # end def refresh
- def update
- end
- end
复制代码
这个是我按照教程做的...当然有些东西还是有点不一样,大大们可以54...= =|||
现在主要想解决如何做到"窗口隐藏与闪避"的问题>.<
---------------------------------------
囧 心急忘记编辑了...请不要扣分T-T 版主对此帖的评论:『最后一句话是特意加的么?那我就连象征都不性了……』,积分『-0』。这些被扣积分的一半会用于对本帖正确答案的悬赏。 |
|