Project1

标题: 请问如何让游戏内时间和现实时间同步? [打印本页]

作者: huahuapro    时间: 2013-2-18 14:38
标题: 请问如何让游戏内时间和现实时间同步?
就像3ds动物之森那样??

谢谢!!!!
作者: 婉烟沉沫    时间: 2013-2-18 16:59
=-=昼夜交替脚本
作者: huahuapro    时间: 2013-2-19 10:24
谢谢我找了,但是不适用xv
我在网上找了一个老外写的,但也是xp的,哪位老大能转化成xv的吗?太感谢了!
  1. Time.now
复制代码
  1. t = Time.now
  2. time = t.strftime("%I:%M:%S %p")
  3. date = t.strftime("%a, %d %b, %Y")
复制代码
  1. #=================================================================
  2. # ** Window_PlayTime
  3. #-----------------------------------------------------------------
  4. #  This window displays play time on the menu screen.
  5. #=================================================================
  6. class Window_PlayTime < Window_Base
  7.   #---------------------------------------------------------------
  8.   # * Object Initialization
  9.   #---------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 160, 64)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     refresh
  14.   end
  15.   #---------------------------------------------------------------
  16.   # * Refresh
  17.   #---------------------------------------------------------------
  18.   def refresh
  19.     self.contents.clear
  20.     self.contents.font.size = 16
  21.     t = Time.now
  22.     time = t.strftime("%I:%M:%S %p")
  23.     date = t.strftime("%a, %d %b, %Y")
  24.     self.contents.font.color = normal_color
  25.     self.contents.draw_text(0, -2, 140, WLH, date, 1)
  26.     self.contents.draw_text(0, 14, 140, WLH, time, 1)
  27.   end
  28.   #---------------------------------------------------------------
  29.   # * Frame Update
  30.   #---------------------------------------------------------------
  31.   def update
  32.     super
  33.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  34.       refresh
  35.     end
  36.   end
  37. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1