Project1
标题:
怎么按住W显示时钟,一松开W窗口自动消失?已解决
[打印本页]
作者:
飞翔的小鸟3
时间:
2017-10-9 15:16
标题:
怎么按住W显示时钟,一松开W窗口自动消失?已解决
本帖最后由 飞翔的小鸟3 于 2017-10-9 15:42 编辑
还是按耐不住写脚本的心情。
再来问一个问题。
我试了几个办法都不太好,有什么办法吗?
作者:
喵呜喵5
时间:
2017-10-9 15:29
自己调整窗口具体的内容、位置
module M520171009W
class Win < ::Window_Base
def initialize
super(0,0,544,416)
self.visible = false
self.z = 999
@time = ''
end
def update
if Input.press?(:R) then update_time
else self.visible = false
end
end
def update_time
self.visible = true
time = Time.now.strftime('%X')
if @time != time
@time = time
contents.clear
draw_text(0,0,544,416,@time)
end
end
end
end
class Scene_Base
alias m5_20171009_start start
def start
m5_20171009_start
@m5_20171009_win = M520171009W::Win.new
end
end
复制代码
作者:
喵呜喵5
时间:
2017-10-9 17:46
加上背景
module M520171009W
class Win < ::Window_Base
def initialize
super(0,0,544,416)
self.z = 999
@time = ''
@background = ::Sprite.new
@background.bitmap = Cache.battleback1('Castle')
@background.z = 998
update
end
def update
if Input.press?(:R) then update_time
else
self.visible = false
@background.visible = false
end
end
def update_time
self.visible = true
@background.visible = true
time = Time.now.strftime('%X')
if @time != time
@time = time
contents.clear
draw_text(0,0,544,416,@time)
end
end
def dispose
super
@background.dispose
end
end
end
class Scene_Base
alias m5_20171009_start start
def start
m5_20171009_start
@m5_20171009_win = M520171009W::Win.new
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1