| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2015-1-15 |
| 在线时间 | 13 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 13 小时
- 注册时间
- 2014-11-12
- 回帖
- 38
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
我想创建一个窗口
显示位置是屏幕中央 高度为100
文字内容为自定义 脚本里是输入$tip="";$tip_imformation="";
也就是在事件编辑中输入脚本进行调用 但是每次调用3秒之后让窗口消失不太会
[pre lang="ruby" line="1"]
class Window_Tip < Window_Base
def initialize
if $tip_information.is_a?(String) and $tip_information!=""
@temptext = $tip_information.gsub(/(\r\n)|\n/,"")
i = 1
p = 0
insert_list = []
while p+i<= @temptext.size
w = tb.text_size(@temptext[p,i]).width
if w > window_width
insert_list << p+i-2
p = p+i-2
i = 1
end
i+=1
end
insert_list.reverse!
insert_list.each{|k| @temptext.insert(k,"\n")}
tb.dispose
addheight = (insert_list.size+2) * 24
end
super(0,416/2+50, window_width, window_height)
refresh
end
def window_width
return 544
end
def window_height
return 100
end
def refresh
contents.clear
if $tip.nil? or $tip==""
$tip=""
$tip_information=""
end
draw_text_ex(0,0,"\\c[1]#{$tip}")
text_color(2)
draw_text_ex(0,24,@temptext)
end
def tip
$tip
end
def open
refresh
super
end
end
[/pre] |
|