赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1050 |
最后登录 | 2020-5-5 |
在线时间 | 9 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 9 小时
- 注册时间
- 2007-2-23
- 帖子
- 26
|
8楼

楼主 |
发表于 2013-4-13 17:56:25
|
只看该作者
#------------------------------------------------------------------------------
# 事件薄案件详细内容场景
#------------------------------------------------------------------------------
class Scene_EventDetail < Scene_Base
def start
super
create_detailWindow
end
def create_detailWindow
@detail_window = Window_EventDetail.new()
@detail_window.set_handler(:cancel,method(:return_scene))
end
end
#------------------------------------------------------------------------------
# 事件薄案件详细内容窗口
#------------------------------------------------------------------------------
class Window_EventDetail < Window_Selectable
def initialize
super(0, 0, Graphics.width, Graphics.height)
@data = EventBookDef.getDetailData
@line = 0
create_tile
create_key_content
activate
end
def create_tile
str = @data[:case][:text]
p str
draw_text_ex((Graphics.width-text_size(str).width)/2,Font.default_size * @line,str)
@line += 1
end
def create_key_content
# 画线索的名字
chapter = @data[:chapter]
castTemp = $game_eventVar.Chapter[chapter[:context]].getCase(@data[:case][:context])
i = 0
until i >= castTemp.Keys.size
chapterIns = EventBookDef.getChapterByIndex(chapter[:context])
caseIns = chapterIns.getCase(@data[:case][:text])
keyIns = caseIns.Key(castTemp.Keys[i])
draw_text_ex(4, Font.default_size*@line,keyIns.name)
@line += 1
draw_text_ex(20,Font.default_size*@line,keyIns.detail)
@line += 1
i+=1
end
end
# 难道需要自动换行?
#--------------------------------------------------------------------------
# ● 文字的处理
# c : 文字
# text : 绘制处理中的字符串缓存(字符串可能会被修改)
# pos : 绘制位置 {:x, :y, :new_x, :height}
#--------------------------------------------------------------------------
alias parent_process_character process_character
def process_character(c, text, pos)
case c
when "\r" # 回车
return
when "\n" # 换行
return
when "\f" # 翻页
return
when "\e" # 控制符
process_escape_character(obtain_escape_code(text), text, pos)
else # 普通文字
process_normal_character(c,pos)
process_next_character(text.slice(0,1),text,pos)
end
end
def process_next_character(c,text,pos)
case c
when "\r"
return
when "\n"
return
when "\f"
return
when "\e"
return
else
next_pos = pos[:x] + text_size(c).width * 2 + self.padding
if next_pos > width
process_new_line(text,pos)
@line += 1
end
end
end
end
|
|