设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
123
返回列表 发新帖
楼主: 我不宅
打印 上一主题 下一主题

[已经解决] 求一与众不同的日期脚本

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
220
在线时间
24 小时
注册时间
2008-8-2
帖子
128
21
发表于 2009-7-3 11:46:55 | 显示全部楼层
修正BUG:跳着其他场景时不刷性。
  1. class Window_MapDate2 < Window_Base
  2.   # 开启用的开关
  3.   SWITCH = 2
  4.   
  5.   # 小时变量
  6.   VARIABLES4 = 4
  7.   
  8.   # 分钟变量
  9.   VARIABLES5 = 5
  10.   
  11.   # 颜色
  12.   TEXT_COLOR = Color.new(255, 255, 255, 255)
  13.   
  14.   # 画面色调
  15.   COLOR = Tone.new(-119,-119,-68,0)    #晚上
  16.   COLOR2 = Tone.new(0,0,0,0)           #日常
  17.   COLOR3 = Tone.new(34,34,34,0)        #正午
  18.   #--------------------------------------------------------------------------
  19.   # ● 初始化窗口
  20.   #--------------------------------------------------------------------------
  21.   def initialize
  22.     super(0, 64, 160, 64)
  23.     # 初始化窗口透明度
  24.     self.opacity = 0
  25.     self.back_opacity = 0
  26.     self.contents_opacity = 0
  27.     self.contents = Bitmap.new(width - 32, height - 32)
  28.     setname
  29.   end
  30.   #--------------------------------------------------------------------------
  31.   # ● 刷新
  32.   #--------------------------------------------------------------------------
  33.   def setname
  34.     if $game_switches[SWITCH] == true
  35.       @total_sec = Graphics.frame_count / Graphics.frame_rate
  36.       $sec2 = @total_sec % 60
  37.       if $sec != @total_sec % 60
  38.         $game_variables[VARIABLES5] += $sec2-$sec
  39.         $sec = @total_sec % 60
  40.       end
  41.       if $game_variables[VARIABLES5] > 59
  42.         $game_variables[VARIABLES5] -= 59
  43.         $game_variables[VARIABLES4] += 1
  44.       end
  45.       if $game_variables[VARIABLES4] > 23
  46.         $game_variables[VARIABLES4] -= 23
  47.         $game_variables[VARIABLES1] += 1
  48.       end
  49.       if $game_variables[VARIABLES4] > 18
  50.           $game_screen.start_tone_change(COLOR, 100)
  51.       end
  52.       if $game_variables[VARIABLES4] > 7
  53.         if $game_variables[VARIABLES4] < 12
  54.           $game_screen.start_tone_change(COLOR2, 100)
  55.         end
  56.       end
  57.       if $game_variables[VARIABLES4] > 13
  58.         if $game_variables[VARIABLES4] < 19
  59.           $game_screen.start_tone_change(COLOR2, 100)
  60.         end
  61.       end
  62.       if $game_variables[VARIABLES4] < 8
  63.           $game_screen.start_tone_change(COLOR, 100)
  64.       end
  65.       if $game_variables[VARIABLES4] > 11
  66.         if $game_variables[VARIABLES4] < 14
  67.           $game_screen.start_tone_change(COLOR3, 100)
  68.         end
  69.       end
  70.       self.contents.clear
  71.       self.contents.font.color = TEXT_COLOR
  72.       self.contents.draw_text(32, 0, 32, 32, "时")
  73.       self.contents.draw_text(96, 0, 32, 32, "分")
  74.       self.contents.draw_text(0, 0, 32, 32, "#{$game_variables[VARIABLES4]}")
  75.       self.contents.draw_text(64, 0, 32, 32, "#{$game_variables[VARIABLES5]}")
  76.       self.opacity = 192
  77.       self.back_opacity = 192
  78.       self.contents_opacity = 192
  79.     end
  80.   end
  81. end
复制代码
GRESK
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
220
在线时间
24 小时
注册时间
2008-8-2
帖子
128
22
发表于 2009-7-3 15:21:50 | 显示全部楼层
我早有打算。发了……
GRESK
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-8 00:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表