Project1
标题:
VX版的人物介绍窗口
[打印本页]
作者:
doublehjb
时间:
2009-2-9 22:43
标题:
VX版的人物介绍窗口
请问有没有VX版的人物介绍窗口的范例啊?
谢谢~
作者:
越前リョーマ
时间:
2009-2-9 22:49
直接做成图片显示不就好了~
也可以拿任务的那个脚本来做,不过我不多说……要不然说不完……别问我怎么做……自己看注释。
作者:
doublehjb
时间:
2009-2-10 00:28
请各个范例吧-.-
作者:
doublehjb
时间:
2009-2-10 00:29
最好有个范例~
作者:
zhou317432
时间:
2009-2-10 01:04
手里正好有个 不过是写在状态栏的 自己翻译了一下
#==============================================================================
# ☆ Window_Status_profile Ver. 1.00
#------------------------------------------------------------------------------
#<追加机能>
# 用于状态画面表示各角色介绍文字追加显示
#==============================================================================
#///////////////////////////////////////////////////////////////////
#在这里,写登场人物的介绍
#数字与角色ID对应
#----能使用的御制文字---------------------------------------------
# \\V[n]:变量表示,\\N[n]:角色名,\\C[n]:文字色、\\G:现在所有的现金
#///////////////////////////////////////////////////////////////////
CHARACTORS_PROFILE={
1=>"
",
2=>"
",
3=>"
",
4=>"
"
}
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ☆ リフレッシュ <変更>
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 128, 0)
draw_actor_face(@actor, 8, 32)
draw_basic_info(128, 32)
draw_parameters(32, 140) #这里改变:默认(32,160)
draw_exp_info(288, 32)
draw_equipments(32, 240) #这里改变:默认(288,160)
draw_charactors_profile_text(240, 140,CHARACTORS_PROFILE[@actor.id].clone) #这里追加:登场人物介绍
end
#--------------------------------------------------------------------------
# ☆ キャラクターのプロフィールの描画 <追加>
# 元の関数は,Window_Message>update_message
#--------------------------------------------------------------------------
def draw_charactors_profile_text(x, y, text)
if text != nil
text.gsub!(/\n/, "\x00")
text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
text.gsub!(/\\G/) { $game_party.gold }
text.gsub!(/\\\\/) { "\\" }
#初期化
contents_x = x
contents_y = y
line_count = 0
max_line = 10
loop do
c = text.slice!(/./m) # 取得下面的文字
case c
when nil # 没有绘画文字时
break
when "\x00" # 换行
contents_x = x
contents_y += WLH
line_count += 1
when "\x01" # \C[n] (文字颜色改变)
text.sub!(/\[([0-9]+)\]/, "")
self.contents.font.color = text_color($1.to_i)
next
else # 普通文字
self.contents.draw_text(contents_x, contents_y, 40, WLH, c)
c_width = contents.text_size(c).width
contents_x += c_width
end
break if line_count >= max_line
end
end
end
end
#////////////////////////////////////////////////////////////////
#作成者:ehime
#http://www.abcoroti.com/~nekoneko/index.html
#readmeやスタッフロールの明記,使用報告は任意.
#////////////////////////////////////////////////////////////////
复制代码
作者:
doublehjb
时间:
2009-2-10 07:35
拿任务的那个脚本来做怎样该改,目的要能显示图片和文字
作者:
舒逸萝莉女皇
时间:
2009-2-10 08:04
到底要显示人物还是任务?没明白LZ的意思{/jy}
作者:
doublehjb
时间:
2009-2-11 00:27
显示人物啊-.-
作者:
njx937
时间:
2009-2-11 00:43
#==============================================================================
# ■ Scene_Task
#------------------------------------------------------------------------------
# 处理商店画面的类。
#==============================================================================
class Scene_Task < Scene_Base
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
#=============开始================
def start
super
#名称
create_menu_background
create_command_window
@name_window = Window_Base.new( 0, 0, 128, 56)
@name_window.contents = Bitmap.new( 96, 24)
@name_window.contents.draw_text( 0, 0, 96, 24, "当前任务", 1)
# 参数1 即居中 2 右对齐 默认左对齐
@name_window.active = false
# 生成主线任务窗口
@main_window = Window_MainTask.new(0,56)
@main_window.active = false
@main_window.visible = false
# 生成支线任务窗口
@branch_window = Window_BranchTask.new(0,56)
@branch_window.active = false
@branch_window.visible = false
# 生成信息窗口
@info_window = Window_TaskInfo.new(128,56)
end
#======结束====================
def terminate
super
dispose_menu_background
dispose_command_window
@name_window.dispose
@main_window.dispose
@branch_window.dispose
@info_window.dispose
end
#===========更新=================
def update
super
update_menu_background
@command_window.update
@main_window.update
@branch_window.update
@info_window.update
if @command_window.active
update_command_selection
elsif @main_window.active
update_main_selection
elsif @branch_window.active
update_branch_selection
end
end
#=========指令窗口=============
def create_command_window
s1 = Vocab::MainTask
s2 = Vocab::BranchTask
s3 = Vocab::TaskCancel
@command_window = Window_Command.new(512, [s1, s2, s3], 3)
@command_window.x = 128
@command_window.y = 0
end
#======释放===============
def dispose_command_window
@command_window.dispose
end
#=====指令更新=====================
#-------命令-------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Menu.new
elsif Input.trigger?(Input::C)
case @command_window.index
when 0 # 主线
Sound.play_decision
@command_window.active = false
@main_window.active = true
@main_window.visible = true
@main_window.refresh
# @status_window.visible = true
when 1 # 支线
Sound.play_decision
@command_window.active = false
@branch_window.active = true
@branch_window.visible = true
@branch_window.refresh
when 2 # 取消
Sound.play_decision
$scene = Scene_Menu.new
end
end
end
#---------------主线-------------------------
def update_main_selection
@info_window.item = @main_window.item
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@main_window.active = false
@main_window.visible = false
# @status_window.visible = false
@info_window.item = nil
return
end
end
#-----------------支线------------------------
def update_branch_selection
@info_window.item = @branch_window.item
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@branch_window.active = false
@branch_window.visible = false
# @status_window.visible = false
@info_window.item = nil
return
end
end
end
#==============================================================================
# ■ Window_BranchTask
#------------------------------------------------------------------------------
# 商店画面、浏览显示可以购买的商品的窗口。
#==============================================================================
class Window_BranchTask < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# shop_goods : 商品
#--------------------------------------------------------------------------
def initialize(x,y)
super( x, y, 128, 424)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● 获取物品
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
@data = []
for i in 1...6
if $game_variables[i]!=0
@data.push($task_blist[$game_variables[i] - 1])
end
end
# 如果项目数不是 0 就生成位图、描绘全部项目
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 24)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
self.contents.clear_rect(rect)
rect.width -= 4
#很重要#
self.contents.draw_text(rect,item[1], 0)
end
end
#==============================================================================
# ■ Window_MainTask
#------------------------------------------------------------------------------
# 显示主任务名的窗口。
#==============================================================================
class Window_MainTask < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# shop_goods : 商品
#--------------------------------------------------------------------------
def initialize(x,y)
super( x, y, 128, 424)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● 获取物品
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
@data = []
# 7号为主线计数
for i in 0...( $game_variables[7] + 1)/2
@data.push($task_mlist[i])
end
# 如果项目数不是 0 就生成位图、描绘全部项目
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 24)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
self.contents.clear_rect(rect)
rect.width -= 4
#输出任务名称
self.contents.draw_text(rect,$task_mlist[index][1], 0)
end
end
#==============================================================================
# ■ Window_TaskInfo
#------------------------------------------------------------------------------
# 显示任务信息的窗口。
#==============================================================================
class Window_TaskInfo < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize(x,y)
super( x, y, 512, 424)
self.contents = Bitmap.new(width - 32, height - 32)
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
# 字体颜色见window.png 的右下角颜色修改
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item == nil
return
end
self.contents.font.color = text_color(12)
self.contents.draw_text( 14, 4, 172, 24, "任务名称")
self.contents.draw_text( 14, 60, 172, 24, "任务内容")
self.contents.draw_text( 14, 200, 172, 24, "委托人&地点")
self.contents.draw_text( 14, 300, 172, 24, "任务奖励")
self.contents.font.color = text_color(0)
# 任务名称
self.contents.draw_text( 256, 30, 252, 24, @item[1], 1)
# 描述一行约46字符,第一行空4字符
# 任务内容
self.contents.draw_text( 80, 100, 400, 24, @item[2])
self.contents.draw_text( 40, 130, 440, 24, @item[3])
self.contents.draw_text( 40, 160, 440, 24, @item[4])
# 地点&委托人
self.contents.draw_text( 256, 230, 242, 24, @item[5])
#奖励物
case @item[6]
when 0
draw_currency_value(@item[7], 14, 350, 416)
when 1
item = $data_items[@item[7]]
draw_icon(item.icon_index, 364, 350, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
self.contents.draw_text( 388, 350, 128, 24, item.name)
when 2
item = $data_weapons[@item[7]]
draw_icon(item.icon_index, 364, 350, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
self.contents.draw_text( 388, 350, 128, 24, item.name)
when 3
item = $data_armors[@item[7]]
draw_icon(item.icon_index, 364, 350, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
self.contents.draw_text( 388, 350, 128, 24, item.name)
end
end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 新的物品
#--------------------------------------------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
end
复制代码
#------------------------------------------------------------------------------
# 任务
#------------------------------------------------------------------------------
#----------------------------------------------------------------------
# 格式: $task_mlist 主线 $task_blist 支线
# 0 表示主线 1 表示支线
# 任务名称“”
# 任务描述一共三行 描述一行约44字符,第一行空4字符 40个
# 任务奖励内容 0,1,2,3(金钱,物品,武器,防具)
# 物品id/ 金钱数
# 0-3(未接,ing,ed,要用到计数变量的的) 这行先排除吧。。。
#----------------------------------------------------------------------
$task_mlist = []
info_temp = [0,"no m1","no1 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",0,100]
$task_mlist.push(info_temp)
info_temp = [0,"no m2"," no2 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",1,1]
$task_mlist.push(info_temp)
info_temp = [0,"no m3"," no3 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",2,01]
$task_mlist.push(info_temp)
info_temp = [0,"no m4"," no4 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",3,01]
$task_blist = []
info_temp = [1,"no b1"," no1 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",0,010000000]
$task_blist.push(info_temp)
info_temp = [1,"no b2"," no2 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",1,01]
$task_blist.push(info_temp)
info_temp = [1,"no b3"," no3 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",2,01]
$task_blist.push(info_temp)
info_temp = [1,"no b4"," no4 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",3,01]
$task_blist.push(info_temp)
info_temp = [1,"no b5"," no5 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",3,06]
$task_blist.push(info_temp)
info_temp = [1,"no b6"," no6 bangrenmaidongxi","L2","l3","亡命酒馆:拉斯",3,02]
$task_blist.push(info_temp)
复制代码
之前改shop得的一个任务图鉴,拿来做人物的也ok。就是排版&内容改改
之后使用的数据也奉上。。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1