Project1
标题:
请问如何把游戏时间和步数在同一个框里显示?
[打印本页]
作者:
hykwf233
时间:
2008-4-13 01:59
标题:
请问如何把游戏时间和步数在同一个框里显示?
请问如何把游戏时间和步数在同一个框里显示? [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
9244579
时间:
2008-4-13 02:16
修改一下窗口内容 [LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
9244579
时间:
2008-4-13 02:20
把这个脚本放到main前就可以合起来了
class Window_Steps < Window_Base
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.back_opacity = 0
refresh
end
def refresh
self.contents.clear
end
end
class Window_PlayTime < Window_Base
def initialize
super(0, 0, 160, 192)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "游戏时间")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 0+80, 120, 32, "步数")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32+80, 120, 32, $game_party.steps.to_s, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
复制代码
作者:
hykwf233
时间:
2008-4-13 23:02
虽然我自己已经解决了!但还是谢谢~~{/tp}
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1