赞 | 23 |
VIP | 207 |
好人卡 | 31 |
积分 | 31 |
经验 | 48797 |
最后登录 | 2024-11-30 |
在线时间 | 1535 小时 |
Lv3.寻梦者 孤独守望
- 梦石
- 0
- 星屑
- 3137
- 在线时间
- 1535 小时
- 注册时间
- 2006-10-16
- 帖子
- 4321
|
- class Window_Reader < Window_Base
- attr_accessor :text
- def initialize(text, line)
- @text = text
- @line = line
- super(50, 15, 540, 450)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 20
- refresh
- end
-
- def refresh
- self.contents.clear
- self.contents.font.size = 20
- self.contents.font.color = normal_color
- j = 0
- for i in @line..[@text.size - 1, @line + 14].min
- t = @text[i].clone
- t.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
- x = 0
- loop do
- c = t.slice!(/./m)
- case c
- when nil,""
- break
- when "\001"
- t.sub!(/\[([0-9]+)\]/, "")
- color = $1.to_i
- if color >= 0 and color <= 7
- self.contents.font.color = text_color(color)
- end
- next
- else
- r = self.contents.text_size(c)
- self.contents.draw_text(x, 28 * j, r.width, 28, c)
- x += r.width
- end
- end
-
- j += 1
- end
- self.contents.font.size = 12
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(0, 408, 540 - 32, 12, @line.to_s + "/" + (@text.size-1).to_s , 2)
- end
-
- def add_1
- @line += 1
- @line = [@text.size - 1, @line].min
- refresh
- end
-
- def minus_1
- @line -= 1
- @line = [0, @line].max
- refresh
- end
-
- def page_add
- @line += 13
- @line = [@text.size - 1, @line].min
- refresh
- end
-
- def page_back
- @line -= 13
- @line = [0, @line].max
- refresh
- end
-
- def renew(text, line)
- @text = text
- @line = line
- refresh
- end
-
-
- end
- class Window_Command < Window_Selectable
- attr_reader :commands
- end
复制代码 把这个替换掉以Window打头的脚本即可用\c[x]。
不过……我这里1.03似乎有漂亮的方框满天飞……不知道是不是原来的脚本的问题 |
|