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
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