加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
下面这个脚本可以显示时间,如何去掉显示几秒,因为这样每秒都刷新,好像地图上的时候有点卡,不知道是不是错觉
#============================================================================== # ■ Window_PlayTime #------------------------------------------------------------------------------ # 显示现实时间 #============================================================================== class Window_RealTime < Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(24, 38, 100, 50-4) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 13 self.contents.font.name = (["黑体","宋体"]) self.opacity = 0 self.z = 300 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color @total_sec = Graphics.frame_count / Graphics.frame_rate time = Time.now text = time.strftime("%x %X") self.contents.font.color = normal_color self.contents.draw_text(-68, -24, 130, 64, text, 2) end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end
#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
# 显示现实时间
#==============================================================================
class Window_RealTime < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(24, 38, 100, 50-4)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 13
self.contents.font.name = (["黑体","宋体"])
self.opacity = 0
self.z = 300
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
@total_sec = Graphics.frame_count / Graphics.frame_rate
time = Time.now
text = time.strftime("%x %X")
self.contents.font.color = normal_color
self.contents.draw_text(-68, -24, 130, 64, text, 2)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
|