Project1
标题:
帮忙写个地图显示变量及定时加变量的脚本
[打印本页]
作者:
18229042
时间:
2011-3-13 12:53
提示:
作者被禁止或删除 内容自动屏蔽
作者:
忧雪の伤
时间:
2011-3-13 12:56
本帖最后由 忧雪の伤 于 2011-3-13 12:59 编辑
class Scene_Map
alias :old_main_now :main unless method_defined? :old_main_now
def main
@count = 0
old_main_now
end
alias :old_update_now :update unless method_defined? :old_update_now
def update
if @count < 400
@count += 1
else
$game_variables[1] += 1
# => print $game_variables[1]
@count = 0
end
$game_variables[2] += 1 if $game_variables[1] >= 60
# => print $game_variables[2]
$game_variables[3] = "春" if $game_variables[2] == 1
old_update_now
end
end
复制代码
class Window_Mapnumber < Window_Base
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 128, 32, $game_variables[1].to_s, 0)
self.contents.draw_text(20, 0, 128, 32, $game_variables[2].to_s, 0)
self.contents.draw_text(40, 0, 128, 32, $game_variables[3].to_s, 0)
end
end
class Scene_Map
alias :old_main_now_now :main unless method_defined? :old_main_now_now
def main
@mapnumber_window = Window_Mapnumber.new
@old_number = $game_variables[1]
old_main_now_now
@mapnumber_window.dispose
end
alias :old_update_now_now :update unless method_defined? :old_update_now_now
def update
if @old_number != $game_variables[1]
@mapnumber_window.refresh
@old_number = $game_variables[1]
end
old_update_now_now
end
end
复制代码
作者:
精灵使者
时间:
2011-3-13 13:01
本帖最后由 精灵使者 于 2011-3-13 13:02 编辑
纯事件其实也可以办到呢。
关键词:并行事件,等待帧,开关,计算处理
关于变量显示部分就用金钱窗口来做吧——核心部分我可以做,问题是外接
作者:
IamI
时间:
2011-3-13 13:03
本帖最后由 IamI 于 2011-3-13 13:03 编辑
随意各种偷懒= =b
class Scene_Map
alias re_main main
def main
@windowxx = Window_Base.new(0,0,280,64)
@windowxx.contents = Bitmap.new(280-32,32)
@windowxx.opacity = 125
re_windowxx
re_main
@windowxx.dispose
end
alias update_orz update
def update
update_orz
if Graphics.frame_count % 400 == 0
$game_variables[1] += 1
end
if $game_variables[1] >= 60
$game_variables[2] += 1
$game_variables[1] = 0
end
if $game_variables[2] == 1
$game_variables[3] = "春"
end
if Graphics.frame_count % 100 == 0
re_windowxx
end
end
def re_windowxx
@windowxx.contents.clear
if Graphics.frame_count % 200 == 0
t = ":"
else
t = " "
end
s = $game_variables[1].to_s
s += (t + $game_variables[2].to_s)
s += (t + $game_variables[3].to_s)
@windowxx.contents.draw_text(0,0,@windowxx.width - 32,@windowxx.height - 32,s,1)
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1