赞 | 0 |
VIP | 3 |
好人卡 | 0 |
积分 | 3 |
经验 | 3830 |
最后登录 | 2016-4-14 |
在线时间 | 24 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 255
- 在线时间
- 24 小时
- 注册时间
- 2008-8-2
- 帖子
- 128
|
修正BUG:跳着其他场景时不刷性。- class Window_MapDate2 < Window_Base
- # 开启用的开关
- SWITCH = 2
-
- # 小时变量
- VARIABLES4 = 4
-
- # 分钟变量
- VARIABLES5 = 5
-
- # 颜色
- TEXT_COLOR = Color.new(255, 255, 255, 255)
-
- # 画面色调
- COLOR = Tone.new(-119,-119,-68,0) #晚上
- COLOR2 = Tone.new(0,0,0,0) #日常
- COLOR3 = Tone.new(34,34,34,0) #正午
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- super(0, 64, 160, 64)
- # 初始化窗口透明度
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 0
- self.contents = Bitmap.new(width - 32, height - 32)
- setname
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def setname
- if $game_switches[SWITCH] == true
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- $sec2 = @total_sec % 60
- if $sec != @total_sec % 60
- $game_variables[VARIABLES5] += $sec2-$sec
- $sec = @total_sec % 60
- end
- if $game_variables[VARIABLES5] > 59
- $game_variables[VARIABLES5] -= 59
- $game_variables[VARIABLES4] += 1
- end
- if $game_variables[VARIABLES4] > 23
- $game_variables[VARIABLES4] -= 23
- $game_variables[VARIABLES1] += 1
- end
- if $game_variables[VARIABLES4] > 18
- $game_screen.start_tone_change(COLOR, 100)
- end
- if $game_variables[VARIABLES4] > 7
- if $game_variables[VARIABLES4] < 12
- $game_screen.start_tone_change(COLOR2, 100)
- end
- end
- if $game_variables[VARIABLES4] > 13
- if $game_variables[VARIABLES4] < 19
- $game_screen.start_tone_change(COLOR2, 100)
- end
- end
- if $game_variables[VARIABLES4] < 8
- $game_screen.start_tone_change(COLOR, 100)
- end
- if $game_variables[VARIABLES4] > 11
- if $game_variables[VARIABLES4] < 14
- $game_screen.start_tone_change(COLOR3, 100)
- end
- end
- self.contents.clear
- self.contents.font.color = TEXT_COLOR
- self.contents.draw_text(32, 0, 32, 32, "时")
- self.contents.draw_text(96, 0, 32, 32, "分")
- self.contents.draw_text(0, 0, 32, 32, "#{$game_variables[VARIABLES4]}")
- self.contents.draw_text(64, 0, 32, 32, "#{$game_variables[VARIABLES5]}")
- self.opacity = 192
- self.back_opacity = 192
- self.contents_opacity = 192
- end
- end
- end
复制代码 |
|