设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3956|回复: 10
打印 上一主题 下一主题

[已经解决] 求RPGXP的地图名字显示脚本以及半身人物显示脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
跳转到指定楼层
1
发表于 2015-7-9 12:07:14 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
可能标题写不清楚.......我就在这里说一下
我求是脚本有两个
1:地图名称显示脚本
2:人物半身头像显示脚本【也就可以显示一半的身体..不会只显示头像】
我知道这里的各位大大们都很好人心而且很厉害的{:2_277:}
所以......求各位大大们协助我吧{:2_271:}

点评

主楼不是有个 标记为以解决?  发表于 2015-7-9 21:39

Lv1.梦旅人

梦石
0
星屑
211
在线时间
845 小时
注册时间
2014-5-5
帖子
944
2
发表于 2015-7-9 12:25:58 | 只看该作者


地图名字显示
  1. #将地图名称设置成两部分,以“#”隔开,前面的部分显示在上面,后面的部分显示在下面。
  2. #顺便补充一下,好像和“字体描边”配合一下才好看一点
  3. # ————————————————————————————————————
  4. # 本脚本来自[url]http://www.66rpg.com/[/url],转载自[url]http://www.phylomortis.com/[/url],转载请保留此信息
  5. # ————————————————————————————————————

  6. #==============================================================================
  7. # ■ Window_MapName
  8. #------------------------------------------------------------------------------
  9. #  显示地图名字的窗口。
  10. #==============================================================================

  11. class Window_MapName < Window_Base
  12.   #--------------------------------------------------------------------------
  13.   # ● 类常量定义
  14.   #--------------------------------------------------------------------------

  15.   # 窗口位置设定
  16.   NAME_X = 210                  # 矩形左上顶点X坐标
  17.   NAME_Y = 180             # 矩形左上顶点Y坐标
  18.   NAME_W = 220          # 矩形宽
  19.   NAME_H = 80           # 矩形高
  20.   
  21.   # 显示时间设置
  22.   SHOW_TIME_0 = 10  # 地图名出现前等待的帧数
  23.   SHOW_TIME_1 = 10  # 地图名从不可见变成可见的帧数
  24.   SHOW_TIME_2 = 34  # 地图名完全可见的帧数
  25.   SHOW_TIME_3 = 16  # 地图名从可见变成不可见的帧数
  26.   
  27.   # 完全可见时的透明度设置
  28.   OPACITY_1 = 0   # 边框
  29.   OPACITY_2 = 0   # 背景
  30.   OPACITY_3 = 255   # 文字
  31.   
  32.   # 地图名字的颜色
  33.   TEXT_COLOR = Color.new(255, 255, 255, 255)
  34.    
  35.   #--------------------------------------------------------------------------
  36.   # ● 初始化状态
  37.   #--------------------------------------------------------------------------
  38.   def initialize
  39.     super(NAME_X , NAME_Y, NAME_W, NAME_H)
  40.     # 初始化窗口透明度
  41.     self.opacity = 0
  42.     self.back_opacity = 0
  43.     self.contents_opacity = 0
  44.     self.contents = Bitmap.new(width - 32, height - 32)
  45.     # 剩余帧数初始化
  46.     @show_time = 0
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 输出文字
  50.   #--------------------------------------------------------------------------
  51.   def setname

  52.     # 获取地图ID
  53.     newid = $game_map.map_id
  54.     time = SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3

  55.     # 如果现在的地图的ID不是刚才显示的地图ID则开始显示
  56.     if newid != @id
  57.       @id = newid
  58.       @show_time = SHOW_TIME_0 + SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3
  59.     # 剩余帧数为0是时,全部窗口透明
  60.     elsif @show_time < 1
  61.       self.opacity = 0
  62.       self.back_opacity = 0
  63.       self.contents_opacity = 0
  64.       return
  65.     end
  66.    
  67.     self.contents.clear
  68.     self.contents.font.color = TEXT_COLOR
  69.     # 描绘地图名

  70.    
  71.     self.contents.font.size = 22
  72.     self.contents.draw_text(4, 0 , width - 40, 32, $data_mapinfos[@id].name.split(/#/)[0], 1)
  73.     self.contents.font.size = 15
  74.     self.contents.draw_text(4, 0 , width - 40, 62, "------------------------", 1)
  75.     self.contents.draw_text(4, 0 , width - 40, 81, $data_mapinfos[@id].name.split(/#/)[1], 1)
  76.    
  77.     # 根本帧数设定窗口透明度
  78.     if @show_time > (SHOW_TIME_2 + SHOW_TIME_3)
  79.       self.opacity = @show_time < time ? (((OPACITY_1 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
  80.       self.back_opacity = @show_time < time ? (((OPACITY_2 / SHOW_TIME_1 )* (time - @show_time)).to_i) : 0
  81.       self.contents_opacity = @show_time < time ? (((OPACITY_3 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
  82.     else
  83.       self.opacity = @show_time < (SHOW_TIME_3 / 16 * 14) ? ((OPACITY_1 / SHOW_TIME_3) * @show_time).to_i : OPACITY_1
  84.       self.back_opacity = @show_time < (SHOW_TIME_3 / 16 * 9) ? ((OPACITY_2 / SHOW_TIME_3) * @show_time).to_i : OPACITY_2
  85.       self.contents_opacity = @show_time < SHOW_TIME_3 ? ((OPACITY_3 / SHOW_TIME_3)* @show_time).to_i : OPACITY_3
  86.     end
  87.    
  88.     @show_time -= 1
  89.   end
  90. end

  91. #==============================================================================
  92. # ■ Scene_Map
  93. #------------------------------------------------------------------------------
  94. #  处理地图画面的类。(追加定义)
  95. #==============================================================================

  96. class Scene_Map
  97.   alias smn_main main
  98.   def main
  99.     @mapname = Window_MapName.new
  100.     smn_main
  101.     @mapname.dispose
  102.   end
  103.   
  104.   alias smn_update update
  105.   def update
  106.     @mapname.setname
  107.     smn_update
  108.   end
  109. end

  110. #==============================================================================
  111. # ■ Scene_Title
  112. #------------------------------------------------------------------------------
  113. #  处理标题画面的类。(追加定义)
  114. #==============================================================================

  115. class Scene_Title
  116.   alias smn_main main
  117.   def main
  118.     # 读取地图信息文件
  119.     $data_mapinfos = load_data("Data/MapInfos.rxdata")
  120.     smn_main
  121.   end
  122. end
复制代码
第二个是是战斗时显示?还是对话时显示?还是状态栏显示?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
3
 楼主| 发表于 2015-7-9 12:27:39 | 只看该作者
邪月长啸 发表于 2015-7-9 12:25
地图名字显示第二个是是战斗时显示?还是对话时显示?还是状态栏显示? ...

第二个是平时对话显示的...
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
211
在线时间
845 小时
注册时间
2014-5-5
帖子
944
4
发表于 2015-7-9 12:31:15 | 只看该作者
  1. #==============================================================================
  2. #
  3. #    呼出对话框 ver. 1.31 By パラ犬(日)
  4. #  来自 http://rpg.para.s3p.net/
  5. #
  6. #  汉化修改 66RPG bbschat(2006.1.5)
  7. #    来自 http://www.66RPG.com/
  8. #
  9. #    脚本更新:by KKME◎66RPG.com,2007年2月
  10. #
  11. #==============================================================================
  12. #    ●准备工作-窗口Skin
  13. #
  14. #    首先,确认自己使用的对话框窗口Skin,(数据库-系统-窗口外观图形)
  15. #    然后根据该窗口Skin制作对话框尾部使用的两个箭头图形
  16. #    尾部箭头图形命名方式:“窗口skin名-top”,“窗口skin名-under”
  17. #    将该图形文件存放在“Graphics/Windowskins”文件夹下。
  18. #
  19. #    本演示游戏内置2套窗口和箭头图形,
  20. #    一套是游戏默认的“001-Blue01”,一套是定制的“fk”
  21. #    玩家可以根据自己的需要参照样本定制自己的呼出对话框窗口Skin。
  22. #
  23. #  ★●使用方法 edit by KKME◎66RPG.com
  24. #
  25. #    方法一:传统方法:输入脚本:chat(事件编号, "角色姓名")。这样就可以正常显示。
  26. #            这种方法虽然使用麻烦,但是有时候也会用到(比如不显示姓名的对话)。这种方法比方法二优先度高。
  27. #            当不需要这种对话功能时候,直接输入一个脚本:chat,就能全部清空。
  28. #
  29. #    方法二:新方法:直接输入对话,会自动读取人名。
  30. #            举例:首先将事件NPC命名,比如命名为“王小二”
  31. #            则输入对话:
  32. #               王小二:
  33. #               今天天气真好啊。
  34. #    这样就能直接将对话显示在这个NPC头上。如果姓名是我方队员则可自动显示在主角头上。
  35. #    这种方法对于我方队员的情况支持 \n[1]这样的效果。如
  36. #               \n[1]:
  37. #               明天听说要下雨。
  38. #    也能正确显示。对于一般的游戏制作这样已经足够了,如果还有特殊需求——小生是
  39. #    知道有可能需要什么特殊需求的:),其实也设置了接口可以满足,不过需要你自己研究一下。
  40. #            
  41. #
  42. #  ★●角色名字窗口使用角色图片的方法(汉化特别追加功能,原脚本只能使用文字)
  43. #   
  44. #    如果能在对应文件夹中找到文件名和角色名字相同的图片,   
  45. #    则角色名字窗口显示角色头像图片,角色图片最好能包括角色的名字。
  46. #    默认头像图片保存目录为“Graphics/Heads/”,玩家可自行修改。
  47. #
  48. #    如果不想使用角色名字直接作为头像文件名。可以使用下面在 Game_Temp 类里增加的namebmp属性。
  49. #    重新设定角色名字与文件名的对应关系。
  50. #
  51. #  KKME注:这里修改了原有算法,可以支持中文名。小生以为不再需要Game_Temp类了。
  52. #          这里小生知道也会有特殊需求,也是设置好接口了的。如果需要再自己研究或问我吧。不然说多了容易误导。  
  53. #
  54. #    ●信息表示速度的变更方法
  55. #
  56. #    在事件命令行使用[脚本]将数值代入[$mes_speed]
  57. #    速度为 0 即瞬间显示全部信息,数字越大,信息表示速度越慢。
  58. #   (举例:$mes_speed=1)
  59. #
  60. #    ●其他设置
  61. #
  62. #    请参照下面的注释
  63. #==============================================================================

  64. module FUKI

  65.   # 头像图片保存目录的设定
  66.   HEAD_PIC_DIR = "Graphics/Heads/"

  67.   # 是否显示尾部图标
  68.   TAIL_SHOW = true
  69.   
  70.   # Skin的设定
  71.   # 使用数据库默认窗口Skin情况下这里使用[""]
  72.   FUKI_SKIN_NAME = "001-Blue01"   # 呼出对话框用Skin
  73.   NAME_SKIN_NAME = "001-Blue01"   # 角色名字窗口用Skin
  74.   
  75.   # 字体大小
  76.   MES_FONT_SIZE = 22    # 呼出对话框
  77.   NAME_FONT_SIZE = 14   # 角色名字窗口
  78.   
  79.   # 字体颜色
  80.   #(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  81.   FUKI_COLOR = Color.new(255, 255, 255, 255)  # 呼出对话框
  82.   NAME_COLOR = Color.new(255, 255, 255, 255)  # 角色名字窗口
  83.   
  84.   # 窗口透明度
  85.   # 如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  86.   FUKI_OPACITY = 255    # 呼出对话框
  87.   MES_OPACITY = 255     # 默认信息窗口
  88.   NAME_OPACITY = 255    # 角色名字窗口
  89.   
  90.   # 角色名字窗口的相对位置
  91.   NAME_SHIFT_X = 0      # 横坐标
  92.   NAME_SHIFT_Y = 16     # 纵坐标
  93.   
  94.   # 窗口表示时是否根据画面大小自动检查窗口出现的位置,
  95.   # 自动改变位置( true / false )
  96.   # 设置成 true 在某些变态情况下可能出现箭头图标颠倒的问题 <- bbschat <= KKME
  97.   POS_FIX = true

  98.   # 在画面最边缘表示时的稍微挪动
  99.   # 使用圆形Skin的角和方框的角重合的情况下为 true
  100.   CORNER_SHIFT = false
  101.   SHIFT_PIXEL = 4   # true 时挪动的象素
  102.   
  103.   # 角色高度尺寸
  104.   CHARACTOR_HEIGHT = 48
  105.   # 呼出对话框的相对位置(纵坐标)
  106.   POP_SHIFT_TOP = 0         # 表示位置为上的时候
  107.   POP_SHIFT_UNDER = 0       # 表示位置为下的时候
  108.   
  109.   # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  110.   # 游戏中 可随时用数字代入 $mes_speed 来改变消息表示速度。
  111.   MES_SPEED = 1

  112. end


  113. #==============================================================================
  114. # 初始化两个变量,不要动(by KKME◎66RPG.com)
  115. #==============================================================================
  116. $mes_name = ""
  117. $mes_id   = nil


  118. #==============================================================================
  119. # 方便用户同时设置2个常用参数而使用的函数
  120. #==============================================================================
  121. def chat(id = nil,name = "")
  122.   $mes_id = id
  123.   $mes_name = name
  124. end

  125. #==============================================================================
  126. # □ Game_Temp
  127. #==============================================================================

  128. class Game_Temp
  129.   attr_accessor  :namebmp              #保存头像图片的Hash表
  130.   alias initialize_fuki initialize
  131.   def initialize
  132.     initialize_fuki
  133.     # 如果不想使用角色名字直接作为头像文件名
  134.     # 可在这里重新设定角色名字与文件名的对应关系
  135.     @namebmp ={"玩家"=>"维斯特"}
  136.   end
  137. end

  138. #==============================================================================
  139. # □ Window_Message
  140. #==============================================================================

  141. class Window_Message < Window_Selectable

  142.   #--------------------------------------------------------------------------
  143.   # ● 初始化状态
  144.   #--------------------------------------------------------------------------
  145.   def initialize
  146.     super(80, 304, 480, 160)
  147.     self.contents = Bitmap.new(width - 32, height - 32)
  148.     self.visible = false
  149.     self.z = 9998
  150.     @fade_in = false
  151.     @fade_out = false
  152.     @contents_showing = false
  153.     @cursor_width = 0
  154.     @kkme_name = ""
  155.     self.active = false
  156.     self.index = -1
  157.     @w = 0
  158.     @h = 0
  159.     @wait = 0
  160.     @dx = 0
  161.     @dy = 0
  162.     $mes_speed = FUKI::MES_SPEED
  163.   end
  164.   
  165.   #--------------------------------------------------------------------------
  166.   # ○ 决定窗口尺寸并生成窗口
  167.   #--------------------------------------------------------------------------
  168.   def refresh_create
  169.     @kkme_name = ""
  170.     begin
  171.       @kkme_name = $game_temp.message_text.split(":")[0] if $game_temp.message_text.split(":")[1] != nil
  172.       $game_temp.message_text = $game_temp.message_text[@kkme_name.size + 4,$game_temp.message_text.size] if @kkme_name != ""
  173.     rescue
  174.     end
  175.     self.contents.clear
  176.     self.contents.font.color = normal_color
  177.     self.contents.font.size = FUKI::MES_FONT_SIZE
  178.     # 取得窗口尺寸
  179.     get_windowsize
  180.     w = @w + 32 + 8
  181.     h = @h * (self.contents.font.size + 10) + 26
  182.     # 生成呼出窗口
  183.     set_fukidasi(self.x, self.y, w, h)
  184.     # 生成角色名字窗口
  185.     set_namewindow
  186.     # 初始化信息表示使用的变量
  187.     @dx = @dy = 0
  188.     @cursor_width = 0
  189.     @contents_drawing = true
  190.     # 瞬间表示的情况下
  191.     if $mes_speed == 0
  192.       # 循环信息描绘处理
  193.       while $game_temp.message_text != ""
  194.         draw_massage
  195.       end
  196.       draw_opt_text
  197.       @contents_showing_end = true
  198.       @contents_drawing = false
  199.     else
  200.       # 一个一个描绘文字
  201.       refresh_drawtext
  202.     end
  203.   end
  204.   
  205.   #--------------------------------------------------------------------------
  206.   # ○ 一个一个描绘文字
  207.   #--------------------------------------------------------------------------
  208.   def refresh_drawtext
  209.     if $game_temp.message_text != nil
  210.       if @wait > 0
  211.         @wait -= 1
  212.       elsif @wait == 0
  213.         # 描绘处理
  214.         draw_massage
  215.         @wait = $mes_speed
  216.       end
  217.     end
  218.     # 描绘结束
  219.     if $game_temp.message_text == ""
  220.       draw_opt_text
  221.       @contents_showing_end = true
  222.       @contents_drawing = false
  223.     end
  224.   end
  225.   
  226.   #--------------------------------------------------------------------------
  227.   # ○ 取得窗口尺寸
  228.   #--------------------------------------------------------------------------
  229.   def get_windowsize
  230.     x = y = 0
  231.     @h = @w = 0
  232.     @cursor_width = 0
  233.     # 有选择项的话,处理字的缩进
  234.     if $game_temp.choice_start == 0
  235.       x = 16
  236.     end
  237.     # 有等待显示的文字的情况下
  238.     if $game_temp.message_text != nil
  239.     text = $game_temp.message_text.clone
  240.       # 限制文字处理
  241.       begin
  242.         last_text = text.clone
  243.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  244.       end until text == last_text
  245.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  246.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  247.       end
  248.       # 为了方便、将 "\\\\" 变换为 "\000"
  249.       text.gsub!(/\\\\/) { "\000" }
  250.       # "\\C" 变为 "\001" 、"\\G" 变为 "\002"
  251.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001" }
  252.       text.gsub!(/\\[Gg]/) { "\002" }
  253.       # c 获取 1 个字 (如果不能取得文字就循环)
  254.       while ((c = text.slice!(/./m)) != nil)
  255.         # \\ 的情况下
  256.         if c == "\000"
  257.           # 还原为本来的文字
  258.           c = "\\"
  259.         end
  260.         # \C[n] 或者 \G 的情况下
  261.         if c == "\001" or c == "\002"
  262.           # 下面的文字
  263.           next
  264.         end
  265.         # 另起一行文字的情况下
  266.         if c == "\n"
  267.           # y 累加 1
  268.           y += 1
  269.           # 取得纵横尺寸
  270.           @h = y
  271.           @w = x > @w ? x : @w
  272.           if y >= $game_temp.choice_start
  273.             @w = x + 8 > @w ? x + 8 : @w
  274.           end
  275.           x = 0
  276.           # 移动到选择项的下一行
  277.           if y >= $game_temp.choice_start
  278.             x = 8
  279.           end
  280.           # 下面的文字
  281.           next
  282.         end
  283.         # x 为要描绘文字的宽度加法运算
  284.         x += self.contents.text_size(c).width
  285.       end
  286.     end
  287.     # 输入数值的情况
  288.     if $game_temp.num_input_variable_id > 0
  289.       digits_max = $game_temp.num_input_digits_max
  290.       number = $game_variables[$game_temp.num_input_variable_id]
  291.       @h += 1
  292.       x = digits_max * self.contents.font.size + 16
  293.       @w = x > @w ? x : @w
  294.     end
  295.   end
  296.   
  297.   #--------------------------------------------------------------------------
  298.   # ○ 描绘信息处理
  299.   #--------------------------------------------------------------------------
  300.   def draw_massage
  301.     # 有等待显示的文字的情况下
  302.     if $game_temp.message_text != nil
  303.       text = $game_temp.message_text
  304.       # 限制文字处理
  305.       begin
  306.         last_text = text.clone
  307.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  308.       end until text == last_text
  309.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  310.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  311.       end
  312.       # 为了方便、将 "\\\\" 变换为 "\000"
  313.       text.gsub!(/\\\\/) { "\000" }
  314.       # "\\C" 变为 "\001"、"\\G" 变为 "\002"
  315.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  316.       text.gsub!(/\\[Gg]/) { "\002" }
  317.       # c 获取 1 个字
  318.       if ((c = text.slice!(/./m)) != nil)
  319.         # 选择项的情况
  320.         if @dy >= $game_temp.choice_start
  321.           # 处理字的缩进
  322.           @dx = 8
  323.           # 描绘文字
  324.           self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  325.           # x 为要描绘文字宽度的加法运算
  326.           @dx += self.contents.text_size(c).width
  327.           # 循环
  328.           while ((c = text.slice!(/./m)) != "\n")
  329.             # 描绘文字
  330.             self.contents.draw_text(4 + @dx, 32 * @dy, 40, 32, c)
  331.             # x 为要描绘文字宽度的加法运算
  332.             @dx += self.contents.text_size(c).width
  333.           end
  334.           if c == "\n"
  335.             # 更新光标宽度
  336.             @cursor_width = [@cursor_width, @dx].max
  337.             # dy 累加 1
  338.             @dy += 1
  339.             @dx = 0
  340.           end
  341.           return
  342.         end
  343.         # \\ 的情况下
  344.         if c == "\000"
  345.           # 还原为本来的文字
  346.           c = "\\"
  347.         end
  348.         #\C[n] 的情况下
  349.         if c == "\001"
  350.           # 更改文字色
  351.           text.sub!(/\[([0-9]+)\]/, "")
  352.           color = $1.to_i
  353.           if color >= 0 and color <= 7
  354.             self.contents.font.color = text_color(color)
  355.           end
  356.         end
  357.         # \G 的情况下
  358.         if c == "\002"
  359.           # 生成金钱窗口
  360.           if @gold_window == nil
  361.             @gold_window = Window_Gold.new
  362.             @gold_window.x = 560 - @gold_window.width
  363.             if $game_temp.in_battle
  364.               @gold_window.y = 192
  365.             else
  366.               @gold_window.y = self.y >= 128 ? 32 : 384
  367.             end
  368.             @gold_window.opacity = self.opacity
  369.             @gold_window.back_opacity = self.back_opacity
  370.           end
  371.         end
  372.         # 另起一行文字的情况下
  373.         if c == "\n"
  374.           # dy 累加 1
  375.           @dy += 1
  376.           @dx = 0
  377.         end
  378.         # 描绘文字
  379.         self.contents.font.size = FUKI::MES_FONT_SIZE
  380.         font_size = self.contents.font.size
  381.         self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c)
  382.         # dx 为要描绘文字的宽度加法运算
  383.         @dx += self.contents.text_size(c).width
  384.       end
  385.     end
  386.   end
  387.   
  388.   #--------------------------------------------------------------------------
  389.   # ○ 选择项和输入数值的情况下
  390.   #--------------------------------------------------------------------------
  391.   def draw_opt_text
  392.     # 选择项的情况下
  393.     if $game_temp.choice_max > 0
  394.       @item_max = $game_temp.choice_max
  395.       self.active = true
  396.       self.index = 0
  397.     end
  398.     # 输入数值的情况下
  399.     if $game_temp.num_input_variable_id > 0
  400.       digits_max = $game_temp.num_input_digits_max
  401.       number = $game_variables[$game_temp.num_input_variable_id]
  402.       @input_number_window = Window_InputNumber.new(digits_max)
  403.       @input_number_window.number = number
  404.       @input_number_window.x = self.x + 8
  405.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  406.     end
  407.   end
  408.   
  409.   #--------------------------------------------------------------------------
  410.   # ○ 设置呼出对话框
  411.   #--------------------------------------------------------------------------
  412.   def set_fukidasi(x, y, width, height)
  413.     begin
  414.       # 不显示暂停标志
  415.       self.pause = false
  416.       # 取得对话框位置
  417.       pos = get_fuki_pos(width, height)
  418.       x = pos[0]
  419.       y = pos[1]
  420.       skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name
  421.       # 生成呼出对话框
  422.       self.windowskin = RPG::Cache.windowskin(skin)
  423.       self.x = x
  424.       self.y = y
  425.       self.height = height
  426.       self.width = width
  427.       self.contents.dispose
  428.       self.contents = Bitmap.new(width - 32, height - 32)
  429.       self.back_opacity = FUKI::FUKI_OPACITY
  430.       self.contents.clear
  431.       self.contents.font.color = normal_color
  432.       self.contents.font.size = FUKI::MES_FONT_SIZE
  433.       # 描绘尾部图标
  434.       if $game_system.message_frame == 0
  435.         # 取得位置
  436.         tale_pos = get_tale_pos
  437.         @tale = Sprite.new
  438.         # 是否显示尾部图标 <- bbschat
  439.         if FUKI::TAIL_SHOW == true
  440.           case @message_position
  441.             when 0  # 上
  442.               @tale.bitmap = RPG::Cache.windowskin(skin + "-top")
  443.               @tale.x = tale_pos[0]
  444.               @tale.y = tale_pos[1]
  445.               @tale.z = self.z + 1
  446.             when 1  # 中
  447.               @tale.dispose
  448.               @tale = nil
  449.             when 2  # 下
  450.               @tale.bitmap = RPG::Cache.windowskin(skin + "-under")
  451.               @tale.x = tale_pos[0]
  452.               @tale.y = tale_pos[1]
  453.               @tale.z = self.z + 1
  454.           end
  455.         end
  456.       end
  457.     rescue
  458.       del_fukidasi
  459.       reset_window(width, height)
  460.     end
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ○ 新功能:根据输入文章计算呼出对话框的位置
  464.   #--------------------------------------------------------------------------
  465.   def get_character_KKME
  466.     if @kkme_name == "" or @kkme_name == nil
  467.       return nil
  468.     else
  469.       @kkme_name.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  470.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  471.       end
  472.       $mes_name = @kkme_name
  473.       for ev in $game_map.events.values
  474.         if ev.name == @kkme_name
  475.           return ev
  476.         end
  477.       end
  478.       for actor in $game_party.actors
  479.         if actor.name == @kkme_name
  480.           return $game_player
  481.         end
  482.       end
  483.       return nil
  484.     end
  485.   end
  486.    
  487.   
  488.   #--------------------------------------------------------------------------
  489.   # ○ 计算呼出对话框的位置
  490.   #--------------------------------------------------------------------------
  491.   def get_fuki_pos(width, height)
  492.    
  493.     # 取得角色
  494.     if $mes_id != nil
  495.       @character = get_character($mes_id)
  496.     else
  497.       @character = get_character_KKME
  498.     end
  499.     if @character == nil
  500.       # 角色不存在的情况下使用默认信息框
  501.       del_fukidasi
  502.       reset_window(width, height)
  503.       return
  504.     end
  505.     # 处理坐标
  506.     x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2)
  507.     # 为尽量显示在画面内而移动横坐标
  508.     if x + width > 640
  509.       x = 640 - width
  510.     elsif x < 0
  511.       x = 0
  512.     end
  513.     # 决定窗口位置
  514.     case $game_system.message_position
  515.       when 0  # 上
  516.         y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  517.       when 1  # 中
  518.         y = (480 - height) / 2
  519.         x = (640 - width) / 2
  520.       when 2  # 下
  521.         y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  522.     end
  523.     # 纪录文章显示位置
  524.     @message_position = $game_system.message_position
  525.     # 如果选择自动修正,则如果文章会显示到画面外则自动改变窗口的尺寸(高度)
  526.     if FUKI::POS_FIX
  527.       case @message_position
  528.         when 0  # 上
  529.           if y <= 0
  530.             @message_position = 2
  531.             y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER
  532.           end
  533.         when 2  # 下
  534.           if y + height >= 480
  535.             @message_position = 0
  536.             y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP
  537.           end
  538.       end
  539.     end
  540.     return [x,y]
  541.    
  542.   end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # ○ 计算尾部图标的位置
  546.   #--------------------------------------------------------------------------
  547.   def get_tale_pos
  548.     case @message_position
  549.       when 0  # 上
  550.         # 处理坐标
  551.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  552.         # 画面边缘的话则移动位置
  553.         if FUKI::CORNER_SHIFT
  554.           if x == 0
  555.             x = FUKI::SHIFT_PIXEL
  556.           elsif x == 640 - 32
  557.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  558.           end
  559.         end
  560.         y = self.y + self.height - 16
  561.       when 1  # 中
  562.         x = nil
  563.         y = nil
  564.       when 2  # 下
  565.         # 处理坐标
  566.         x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  567.         # 画面边缘的话则移动位置
  568.         if FUKI::CORNER_SHIFT
  569.           if x == 0
  570.             x = FUKI::SHIFT_PIXEL
  571.           elsif @tale.x == 640 - 32
  572.             x = 640 - 32 - FUKI::SHIFT_PIXEL
  573.           end
  574.         end
  575.         y = self.y - 16
  576.     end
  577.     return [x,y]
  578.   end

  579.   #--------------------------------------------------------------------------
  580.   # ○ 计算名字窗口的位置
  581.   #--------------------------------------------------------------------------
  582.   def get_name_pos
  583.     case @face_pic_txt
  584.       when 0  # 文字
  585.         x = self.x + FUKI::NAME_SHIFT_X
  586.         y = self.y - FUKI::NAME_FONT_SIZE - 16 + FUKI::NAME_SHIFT_Y
  587.       when 1  # 图片
  588.         if self.x >= @pic_width + 5
  589.           # 默认头像显示在对话框左边
  590.           x = self.x-@pic_width-5
  591.         else
  592.           # 对话框左边放不下时头像显示在右边
  593.           x = self.x + self.width
  594.         end
  595.         y = self.y+self.height/2 - (@pic_height + 5)/2
  596.       end

  597.     return [x,y]
  598.   end
  599.   
  600.   #--------------------------------------------------------------------------
  601.   # ○ 设置角色名字窗口
  602.   #--------------------------------------------------------------------------
  603.   def set_namewindow
  604.    
  605.     # $mes_name为空时不显示角色名字窗口
  606.     if $mes_name == nil or $mes_name == ""
  607.       return
  608.     else
  609.       # 设定变量
  610.       mes_name = $mes_name
  611.       skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name
  612.       
  613.       #判断名称是否有对应的图片"Graphics/heads/" +
  614.       if $game_temp.namebmp[mes_name] == nil then
  615.         sFile = "Graphics/heads/" + mes_name + ".png"
  616.       else
  617.         sFile = "Graphics/heads/" + $game_temp.namebmp[mes_name] + ".png"
  618.       end
  619.       
  620.       #if FileTest.exist?(sFile) == true then
  621.       begin
  622.         
  623.         @face_pic_txt = 1                       #名字窗口使用头像<- bbschat
  624.         
  625.         # 生成头像
  626.         bmp = Bitmap.new(sFile)
  627.         @pic_width = bmp.width
  628.         @pic_height = bmp.height
  629.         
  630.         if self.x >= @pic_width + 5
  631.           # 默认头像显示在对话框左边
  632.           name_x = self.x-@pic_width-5
  633.         else
  634.           # 对话框左边放不下时头像显示在右边
  635.           name_x = self.x + self.width
  636.         end
  637.         name_y = self.y+self.height/2 - (@pic_height + 5)/2
  638.         
  639.         # 生成角色头像窗口
  640.         @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  641.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  642.         @name_win.back_opacity =0     
  643.         @name_win.z = self.z + 1
  644.         
  645.         @name_contents = Sprite.new
  646.         @name_contents.x = name_x + 2
  647.         @name_contents.y = name_y + 2
  648.         @name_contents.bitmap = bmp
  649.         #@name_contents.z = @name_win.z + 2     #这个用了似乎效果不好<- bbschat
  650.         
  651.       rescue
  652.         
  653.         @face_pic_txt = 0                       #名字窗口使用文字<- bbschat

  654.         # 生成名字
  655.         name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE
  656.         name_height = FUKI::NAME_FONT_SIZE
  657.         name_x = self.x + FUKI::NAME_SHIFT_X
  658.         name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y

  659.         # 生成角色名字窗口(只有边框)
  660.         @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16)
  661.         @name_win.windowskin = RPG::Cache.windowskin(skin)
  662.         @name_win.back_opacity = FUKI::NAME_OPACITY
  663.         @name_win.z = self.z + 1
  664.         
  665.         # 为了使空白比Windows类限定的更小使用双重结构
  666.         @name_contents = Sprite.new
  667.         @name_contents.x = name_x + 12
  668.         @name_contents.y = name_y + 8
  669.         @name_contents.bitmap = Bitmap.new(name_width, name_height)
  670.         @name_contents.z = @name_win.z + 2
  671.         
  672.         # 设定文字色
  673.         nil_color = Color.new(0,0,0,0)
  674.         if FUKI::NAME_COLOR != nil_color
  675.           @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  676.         else
  677.           @name_contents.bitmap.font.color = normal_color
  678.         end
  679.         @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  680.         # 调整窗口尺寸
  681.         rect = @name_contents.bitmap.text_size(mes_name)
  682.         @name_win.width = rect.width + 32
  683.         # 描画名字
  684.         @name_contents.bitmap.draw_text(rect, mes_name)
  685.       end
  686.     end

  687.   end
  688.   
  689.   #--------------------------------------------------------------------------
  690.   # ○ 释放呼出对话框和角色名字窗口
  691.   #--------------------------------------------------------------------------
  692.   def del_fukidasi
  693.     if @tale != nil
  694.       @tale.dispose
  695.       @tale = nil
  696.     end
  697.     if @name_win != nil
  698.       @name_win.dispose
  699.       @name_win = nil
  700.       @name_contents.dispose
  701.       @name_contents = nil
  702.     end
  703.     self.opacity = 0
  704.     self.x = 80
  705.     self.width = 480
  706.     self.height = 160
  707.     self.contents.dispose
  708.     self.contents = Bitmap.new(width - 32, height - 32)
  709.     self.pause = true
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # ○ 取得角色
  714.   #     parameter : 参数
  715.   #--------------------------------------------------------------------------
  716.   def get_character(parameter)
  717.     # 参数分歧
  718.     case parameter
  719.     when -1  # 玩家
  720.       return $game_player
  721.     when 0   # 该事件
  722.       events = $game_map.events
  723.       return events == nil ? nil : events[$active_event_id]
  724.     else     # 特定事件
  725.       events = $game_map.events
  726.       return events == nil ? nil : events[parameter]
  727.     end
  728.   end
  729.   
  730.   #--------------------------------------------------------------------------
  731.   # ● 设定窗口位置和不透明度
  732.   #--------------------------------------------------------------------------
  733.   def reset_window(width = nil, height = nil)
  734.     if $game_temp.in_battle
  735.       self.y = 16
  736.     else
  737.       case $game_system.message_position
  738.       when 0  # 上
  739.         self.y = 16
  740.       when 1  # 中
  741.         if height != nil and width != nil
  742.           self.y = (480 - height) / 2 - 32
  743.           self.x = (640 - width) / 2
  744.           self.width = width
  745.           self.height = height
  746.           self.contents.dispose
  747.           self.contents = Bitmap.new(width - 32, height - 32)
  748.         else
  749.           self.y = 160
  750.         end
  751.       when 2  # 下
  752.         self.y = 304
  753.       end
  754.     end
  755.     if $game_system.message_frame == 0
  756.       self.opacity = 255
  757.     else
  758.       self.opacity = 0
  759.     end
  760.     self.back_opacity = FUKI::MES_OPACITY
  761.   end
  762.   
  763.   #--------------------------------------------------------------------------
  764.   # ● 刷新画面
  765.   #--------------------------------------------------------------------------
  766.   def update
  767.     super
  768.     # 呼出模式下跟随事件移动
  769.     if @tale != nil
  770.       pos = get_fuki_pos(self.width, self.height)
  771.       self.x = pos[0]
  772.       self.y = pos[1]

  773.       tale_pos = get_tale_pos
  774.       @tale.x = tale_pos[0]
  775.       @tale.y = tale_pos[1]
  776.       
  777.       if @name_win != nil
  778.         name_pos = get_name_pos
  779.         @name_win.x = name_pos[0]
  780.         @name_win.y = name_pos[1]
  781.         case @face_pic_txt
  782.           when 0  # 文字
  783.             @name_contents.x = @name_win.x + 12
  784.             @name_contents.y = @name_win.y + 8
  785.           when 1  # 图片
  786.             @name_contents.x = @name_win.x + 2
  787.             @name_contents.y = @name_win.y + 2
  788.           end
  789.       end
  790.     end
  791.    
  792.     # 渐变的情况下
  793.     if @fade_in
  794.       self.contents_opacity += 24
  795.       if @name_win != nil
  796.         @name_win.opacity += 24
  797.       end
  798.       if @tale != nil
  799.         @tale.opacity += 24
  800.       end
  801.       if @input_number_window != nil
  802.         @input_number_window.contents_opacity += 24
  803.       end
  804.       if self.contents_opacity == 255
  805.         @fade_in = false
  806.       end
  807.       return
  808.     end
  809.     # 显示信息中的情况下
  810.     if @contents_drawing
  811.       refresh_drawtext
  812.       return
  813.     end
  814.     # 输入数值的情况下
  815.     if @input_number_window != nil
  816.       @input_number_window.update
  817.       # 确定
  818.       if Input.trigger?(Input::C)
  819.         $game_system.se_play($data_system.decision_se)
  820.         $game_variables[$game_temp.num_input_variable_id] =
  821.           @input_number_window.number
  822.         $game_map.need_refresh = true
  823.         # 释放输入数值窗口
  824.         @input_number_window.dispose
  825.         @input_number_window = nil
  826.         terminate_message
  827.       end
  828.       return
  829.     end
  830.     # 显示信息结束的情况下
  831.     if @contents_showing_end
  832.       # 不是显示选择项且不是呼出对话模式则显示暂停标志
  833.       if $game_temp.choice_max == 0 and @tale == nil
  834.         self.pause = true
  835.       else
  836.         self.pause = false
  837.       end
  838.       # 取消
  839.       if Input.trigger?(Input::B)
  840.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  841.           $game_system.se_play($data_system.cancel_se)
  842.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  843.           terminate_message
  844.         end
  845.       end
  846.       # 确定
  847.       if Input.trigger?(Input::C)
  848.         if $game_temp.choice_max > 0
  849.           $game_system.se_play($data_system.decision_se)
  850.           $game_temp.choice_proc.call(self.index)
  851.         end
  852.         terminate_message
  853.         # 释放呼出窗口
  854.         del_fukidasi
  855.       end
  856.       return
  857.     end
  858.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  859.     if @fade_out == false and $game_temp.message_text != nil
  860.       @contents_showing = true
  861.       $game_temp.message_window_showing = true
  862.       reset_window
  863.       refresh_create
  864.       if @name_win != nil
  865.         @name_win.opacity = 0
  866.       end
  867.       if @tale != nil
  868.         @tale.opacity = 0
  869.       end
  870.       Graphics.frame_reset
  871.       self.visible = true
  872.       self.contents_opacity = 0
  873.       if @input_number_window != nil
  874.         @input_number_window.contents_opacity = 0
  875.       end
  876.       @fade_in = true
  877.       return
  878.     end
  879.     # 没有可以显示的信息、但是窗口为可见的情况下
  880.     if self.visible
  881.       @fade_out = true
  882.       self.opacity -= 48
  883.       if @name_win != nil
  884.         @name_win.opacity -= 48
  885.       end
  886.       if @tale != nil
  887.         @tale.opacity -= 48
  888.       end
  889.       if self.opacity == 0
  890.         self.visible = false
  891.         @fade_out = false
  892.         $game_temp.message_window_showing = false
  893.         del_fukidasi
  894.       end
  895.       return
  896.     end
  897.   end
  898.   
  899.   #--------------------------------------------------------------------------
  900.   # ● 释放
  901.   #--------------------------------------------------------------------------
  902.   def dispose
  903.     terminate_message
  904.     $game_temp.message_window_showing = false
  905.     if @input_number_window != nil
  906.       @input_number_window.dispose
  907.     end
  908.     super
  909.   end
  910.   
  911.   #--------------------------------------------------------------------------
  912.   # ● 信息结束处理
  913.   #--------------------------------------------------------------------------
  914.   def terminate_message
  915.     self.active = false
  916.     self.pause = false
  917.     self.index = -1
  918.     self.contents.clear
  919.     # 清除显示中标志
  920.     @contents_showing = false
  921.     @contents_showing_end = false
  922.     unless @kkme_name == "" or @kkme_name == nil
  923.       $mes_name = ""
  924.       @kkme_name = ""
  925.     end
  926.     # 呼叫信息调用
  927.     if $game_temp.message_proc != nil
  928.       $game_temp.message_proc.call
  929.     end
  930.     # 清除文章、选择项、输入数值的相关变量
  931.     $game_temp.message_text = nil
  932.     $game_temp.message_proc = nil
  933.     $game_temp.choice_start = 99
  934.     $game_temp.choice_max = 0
  935.     $game_temp.choice_cancel_type = 0
  936.     $game_temp.choice_proc = nil
  937.     $game_temp.num_input_start = 99
  938.     $game_temp.num_input_variable_id = 0
  939.     $game_temp.num_input_digits_max = 0
  940.     # 释放金钱窗口
  941.     if @gold_window != nil
  942.       @gold_window.dispose
  943.       @gold_window = nil
  944.     end
  945.   end
  946.   
  947.   #--------------------------------------------------------------------------
  948.   # ● 刷新光标矩形
  949.   #--------------------------------------------------------------------------
  950.   def update_cursor_rect
  951.     if @index >= 0
  952.       n = $game_temp.choice_start + @index
  953.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  954.     else
  955.       self.cursor_rect.empty
  956.     end
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● 取得普通文字色
  960.   #--------------------------------------------------------------------------
  961.   def normal_color
  962.     nil_color = Color.new(0,0,0,0)
  963.     if FUKI::FUKI_COLOR != nil_color
  964.       color = FUKI::FUKI_COLOR
  965.     else
  966.       color = super
  967.     end
  968.     return color
  969.   end
  970. end


  971. #==============================================================================
  972. # ■ Window_InputNumber
  973. #==============================================================================

  974. class Window_InputNumber < Window_Base
  975.   #--------------------------------------------------------------------------
  976.   # ● 初始化对像
  977.   #     digits_max : 位数
  978.   #--------------------------------------------------------------------------
  979.   def initialize(digits_max)
  980.     @digits_max = digits_max
  981.     @number = 0
  982.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  983.     dummy_bitmap = Bitmap.new(32, 32)
  984.     dummy_bitmap.font.size = FUKI::MES_FONT_SIZE
  985.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  986.     dummy_bitmap.dispose
  987.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  988.     self.contents = Bitmap.new(width - 32, height - 32)
  989.     self.contents.font.size = FUKI::MES_FONT_SIZE
  990.     self.z += 9999
  991.     self.opacity = 0
  992.     @index = 0
  993.     refresh
  994.     update_cursor_rect
  995.   end
  996. end

  997. #===========================================================================
  998. # Game_Map,把events变量公开
  999. #===========================================================================
  1000. class Game_Map
  1001.   attr_reader   :events
  1002. end

  1003. #===========================================================================
  1004. # 便于返回姓名
  1005. #===========================================================================
  1006. class Game_Event < Game_Character
  1007.   def name
  1008.     return @event.name
  1009.   end
  1010.   def name=(na)
  1011.     @event.name = na
  1012.   end
  1013. end

  1014. #===========================================================================
  1015. # 增加变量$active_event_id,用于在“本事件”显示对话
  1016. #===========================================================================
  1017. class Interpreter
  1018. #--------------------------------------------------------------------------
  1019. # ● 设置事件
  1020. #     event_id : 事件 ID
  1021. #--------------------------------------------------------------------------
  1022. alias setup_fuki setup
  1023. def setup(list, event_id)
  1024.    setup_fuki(list, event_id)
  1025.    # 如果不是战斗中
  1026.    if !($game_temp.in_battle)
  1027.      # 记录事件 ID
  1028.      $active_event_id = event_id
  1029.    end
  1030. end
  1031. end
复制代码
其实半身像显示我都是事件的,直接使用显示图片。。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
5
 楼主| 发表于 2015-7-9 12:32:11 | 只看该作者
邪月长啸 发表于 2015-7-9 12:25
地图名字显示第二个是是战斗时显示?还是对话时显示?还是状态栏显示? ...

呃...怎么回事...出了这样的错误
脚本 地图名字显示的13行发生了TypeError。undefined superclass Window _Base
是什么意思??

点评

把地图的名字改下,例如 苍月岛#牛魔洞  发表于 2015-7-9 12:35
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
6
 楼主| 发表于 2015-7-9 12:48:55 | 只看该作者
邪月长啸 发表于 2015-7-9 12:31
其实半身像显示我都是事件的,直接使用显示图片。。。。

这个好像很麻烦那样…具体是怎么使用的..简单说明下吧..
PS:地图名称显示的问题已经解决了...多谢
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
211
在线时间
845 小时
注册时间
2014-5-5
帖子
944
7
发表于 2015-7-9 13:12:53 | 只看该作者
雨中显露的隐士 发表于 2015-7-9 12:48
这个好像很麻烦那样…具体是怎么使用的..简单说明下吧..
PS:地图名称显示的问题已经解决了...多谢 ...

需要素材的支持~ fanli.rar (427.85 KB, 下载次数: 120)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
8
 楼主| 发表于 2015-7-9 13:58:44 | 只看该作者
邪月长啸 发表于 2015-7-9 13:12
需要素材的支持~

#==============================================================================
# 半身像对话框功能版 v 1.01 by 沉影不器
#------------------------------------------------------------------------------
# 使用说明:
#   ① 此脚本可代替默认 Window_Message 全脚本
#
#   ② 对话框第一行输入引号内文字"名称:",脚本会把名称提取出来美化显示
#
#   ③ 默认半身像在左边显示
#      当您需要右边显示时,在第一行输入的名称之后加"@r"(大小写不限)
#      例: "拉尔夫@r:"
#          请注意此时半身像将进行左右翻转显示
#
#   ④ 在对话中更改字体的方法:
#       \f[sX]:更改字号为X
#       \f[nX]:更改字体名称为预设字体组第X号字体 (预设字体组请看参数设定)
#       \f[cX]:更改字色为第X号颜色 (text_color中的定义)
#
#   ⑤ 在对话中显示(技能 物品 武器 防具)图标和名称的方法:
#       \s[X]: 显示第X号技能图标和名称
#       \i[X]: 显示第X号物品图标和名称
#       \w[X]: 显示第X号武器图标和名称
#       \a[X]: 显示第X号防具图标和名称
#
#   ⑥ 在对话中更改文字不透明度的方法:
#       \o[X]: 把文字不透明度更改为X (取值范围在0~255)
#
#   ⑦ 指定时间后自动关闭对话框的方法:
#       \x[X]: 对话框将在X帧后自动关闭
#       \x:    省略参数时,将在AUTO_CLOSE帧后自动关闭 (AUTO_CLOSE在参数设定中)
#
#   ⑧ 由于半身像占据文字显示宽度,您在设定文章时每行字数将减少
#
#   ⑨ 参数设定在脚本第37~66行
#
# 素材要求:
#   ① 按vx默认头像像素材(Graphics\Faces)的格式
#      要求所有半身像朝向一致(默认是正面偏右)
#==============================================================================
# ■ Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # ○ 参数设定
  #--------------------------------------------------------------------------
  # 预设字体组
  FONT_ARRAY = ["黑体", "宋体", "仿宋_GB2312"]
  
  # 名称条参数
  NAME_FONT_NAME = 0            # 名称文字字体在预设字体组中的序号
  NAME_FONT_SIZE = 20           # 名称文字字号
  NAME_FONT_COLOR = 16          # 名称文字颜色
  NAME_X_ADJ = 6                # 名称条宽度缩进值
  NAME_Y_ADJ = 6                # 名称与对话内容之间的附加距离
  NAME_BAR_COLOR = 0            # 名称背景条颜色
  NAME_BAR_OPACITY = 72         # 名称背景条透明度
  AUTO_ADD = true               # 是否自动添加名称修饰符
  SYMBOL = "【】"               # AUTO_ADD有效时为名称添加的修饰符(一对)
  # 半身像参数
  FACE_X_ADJ = 6                # 半身像横坐标微调
  FACE_Y_ADJ = -6               # 半身像纵坐标微调
  # 对话框参数
  MSG_FONT_NAME = 1             # 对话文字字体在预设字体组中的序号
  MSG_FONT_SIZE = 18            # 对话文字字号
  MSG_FONT_COLOR = 0            # 对话文字颜色
  # 自动关闭
  AUTO_CLOSE = 80               # 默认自动关闭时间(以帧计时)
  
  #--------------------------------------------------------------------------
  # ● 常量
  #--------------------------------------------------------------------------
  MAX_LINE = 4                            # 最大行数
  #--------------------------------------------------------------------------
  # ◎ 初始化对象
  #--------------------------------------------------------------------------
  def initialize
    height = [NAME_FONT_SIZE, MSG_FONT_SIZE].max + 2 +
             ( MSG_FONT_SIZE + 2) * 3 + NAME_Y_ADJ + 32
    y = Graphics.height - height
    super(0, y, Graphics.width, height)
    self.z = 200
    self.active = false
    self.index = -1
    self.openness = 0
    @opening = false            # 窗口正在打开的标志
    @closing = false            # 窗口正在关闭的标志
    @text = nil                 # 已经没有可显示的文章
    @contents_x = 0             # 下一条文字描绘的 X 坐标
    @contents_y = 0             # 下一条文字描绘的 Y 坐标
    @line_count = 0             # 现在描绘的行数
    @wait_count = 0             # 等待计数
    @background = 0             # 背景类型
    @position = 2               # 显示位置
    @show_fast = false          # 快速显示标志
    @line_show_fast = false     # 以行为单位快速显示
    @pause_skip = false         # 省略等待输入标志
    create_gold_window
    create_number_input_window
    create_back_sprite
    # 半身像左右判断
    @show_right = false
    # 半身像宽度
    @face_width = 0
    # 生成名称背景条
    create_namebar_sprite
    # 生成半身像
    create_face_sprite
    # 修改默认字体
    contents.font = get_font(1)
  end
  #--------------------------------------------------------------------------
  # ● 释放
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_gold_window
    dispose_number_input_window
    dispose_back_sprite
  end
  #--------------------------------------------------------------------------
  # ◎ 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    update_gold_window
    update_number_input_window
    update_back_sprite
    update_show_fast
    unless @opening or @closing             # 除窗口关闭以外
      if @wait_count > 0                    # 文章内等待中
        @wait_count -= 1
      elsif self.pause                      # 等待文章翻页待机中
        input_pause
      elsif self.active                     # 正在输入选择项
        input_choice
      elsif @number_input_window.visible    # 正在输入数值
        input_number
      elsif @text != nil                    # 还有剩余的文章
        update_message                        # 更新消息
      elsif continue?                       # 继续的情况
        start_message                         # 开始消息
        open                                  # 打开窗口
        $game_message.visible = true
      else                                  # 不继续的情况
        close                                 # 关闭窗口
        $game_message.visible = @closing
      end
    end
    # 自动关闭对话框
    if @auto_close != nil
      if @auto_close > 0
        @auto_close -= 1
      else
        @auto_close = nil
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 生成所持金窗口
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new(384, 0)
    @gold_window.openness = 0
    # 统一字体
    @gold_window.contents.font = get_font(1)
  end
  #--------------------------------------------------------------------------
  # ◎ 生成数值输入窗口
  #--------------------------------------------------------------------------
  def create_number_input_window
    @number_input_window = Window_NumberInput.new
    @number_input_window.visible = false
    # 统一字体
    @number_input_window.contents.font = get_font(1)
  end
  #--------------------------------------------------------------------------
  # ● 生成背景活动块
  #--------------------------------------------------------------------------
  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = Cache.system("MessageBack")
    @back_sprite.visible = (@background == 1)
    @back_sprite.z = 190
  end
  #--------------------------------------------------------------------------
  # ● 释放所持金窗口
  #--------------------------------------------------------------------------
  def dispose_gold_window
    @gold_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放数值输入窗口
  #--------------------------------------------------------------------------
  def dispose_number_input_window
    @number_input_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 释放背景活动块
  #--------------------------------------------------------------------------
  def dispose_back_sprite
    @back_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 更新所持金窗口
  #--------------------------------------------------------------------------
  def update_gold_window
    @gold_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新数值输入窗口
  #--------------------------------------------------------------------------
  def update_number_input_window
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # ● 更新背景活动块
  #--------------------------------------------------------------------------
  def update_back_sprite
    @back_sprite.visible = (@background == 1)
    @back_sprite.y = y - 16
    @back_sprite.opacity = openness
    @back_sprite.update
  end
  #--------------------------------------------------------------------------
  # ● 更新快速显示标志
  #--------------------------------------------------------------------------
  def update_show_fast
    if self.pause or self.openness < 255
      @show_fast = false
    elsif Input.trigger?(Input::C) and @wait_count < 2
      @show_fast = true
    elsif not Input.press?(Input::C)
      @show_fast = false
    end
    if @show_fast and @wait_count > 0
      @wait_count -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 判断下一消息继续显示
  #--------------------------------------------------------------------------
  def continue?
    return true if $game_message.num_input_variable_id > 0
    return false if $game_message.texts.empty?
    if self.openness > 0 and not $game_temp.in_battle
      return false if @background != $game_message.background
      return false if @position != $game_message.position
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ◎ 开始显示消息
  #--------------------------------------------------------------------------
  def start_message
    # 重设窗口背景与位置
    reset_window
    # 还原半身像左右判断
    @show_right = false
    # 暂存消息
    temp_texts = []
    $game_message.texts.each {|text| temp_texts.push(text.clone)}
    if temp_texts[0] != nil and temp_texts[0].include?(":")
      # 半身像左右判断
      if temp_texts[0].split(/@/)[1] =~ /[Rr]/
        @show_right = true
        temp_texts[0] = temp_texts[0].split(/@/)[0]
      end
      # 去冒号加修饰符(可选)
      if AUTO_ADD
        temp_texts[0].sub!(/\:/) { "" }
        temp_texts[0] = SYMBOL[0,SYMBOL.size/2] +
        temp_texts[0] + SYMBOL[SYMBOL.size/2,SYMBOL.size/2]
      end
      # 设定文字颜色
      temp_texts[0] = "\\C[#{NAME_FONT_COLOR}]" +
      temp_texts[0] + "\\C[#{MSG_FONT_COLOR}]"
      # 设定文字字体
      temp_texts[0] = "\\F[N#{NAME_FONT_NAME}]" +
      temp_texts[0] + "\\F[N#{MSG_FONT_NAME}]"
      # 显示名称背景条
      show_namebar_sprite
    end
    @text = ""
    for i in 0...temp_texts.size
      @text += "  " if i >= $game_message.choice_start
      @text += temp_texts.clone + "\x00"
    end
    @item_max = $game_message.choice_max
    convert_special_characters
    ##reset_window
    new_page
  end
  #--------------------------------------------------------------------------
  # ◎ 更换页面处理
  #--------------------------------------------------------------------------
  def new_page
    contents.clear
    # 初始化文字描绘起点
    @contents_x = 0
    # 除名称外文字右移1字符
    @contents_x += MSG_FONT_SIZE+2 unless show_name?
    if $game_message.face_name.empty?
      @face_sprite.bitmap.clear
    else
      name = $game_message.face_name
      index = $game_message.face_index
      # 获取半身像宽度
      get_face_width(name)
      # 计算文字横坐标起始
      @contents_x += @face_width-16 unless @show_right
      draw_msg_face(name, index)
      # 设定半身像坐标
      set_face_pos
    end
    @contents_y = 0
    @line_count = 0
    @show_fast = false
    @line_show_fast = false
    @pause_skip = false
    contents.font.color = text_color(0)
  end
  #--------------------------------------------------------------------------
  # ◎ 换行处理
  #--------------------------------------------------------------------------
  def new_line
    @contents_x = 0
    unless $game_message.face_name.empty?
      # 半身像显示在左时
      @contents_x = @face_width-16 unless @show_right
    end
    # 除名称外文字右移1字符
    @contents_x += (MSG_FONT_SIZE+2)
    # 显示名称之后,对话内容下移 NAME_Y_ADJ
    @contents_y += NAME_Y_ADJ if @line_count == 0 and show_name?
    # 以字号为新间距
    @contents_y += (MSG_FONT_SIZE+2)
    @line_count += 1
    @line_show_fast = false
  end
  #--------------------------------------------------------------------------
  # ◎ 特殊文字变换
  #--------------------------------------------------------------------------
  def convert_special_characters
    @text.gsub!(/\\V\[(\d+)\]/i)  { $game_variables[$1.to_i] }
    @text.gsub!(/\\V\[(\d+)\]/i)  { $game_variables[$1.to_i] }
    @text.gsub!(/\\N\[(\d+)\]/i)  { $game_actors[$1.to_i].name }
    @text.gsub!(/\\C\[(\d+)\]/i)  { "\x01[#{$1}]" }
    @text.gsub!(/\\G/)            { "\x02" }
    @text.gsub!(/\\\./)           { "\x03" }
    @text.gsub!(/\\\|/)           { "\x04" }
    @text.gsub!(/\\!/)            { "\x05" }
    @text.gsub!(/\\>/)            { "\x06" }
    @text.gsub!(/\\</)            { "\x07" }
    @text.gsub!(/\\\^/)           { "\x08" }
    @text.gsub!(/\\\\/)           { "\\" }
    # 更改不透明度
    @text.gsub!(/\\O\[(\d+)\]/i)  { "\x09[#{$1}]" }
    # 显示数据库元素
    @text.gsub!(/\\S\[(\d+)\]/i)  { "\x10[#{$1}]" + $data_skills[$1.to_i].name }
    @text.gsub!(/\\I\[(\d+)\]/i)  { "\x11[#{$1}]" + $data_items[$1.to_i].name }
    @text.gsub!(/\\W\[(\d+)\]/i)  { "\x12[#{$1}]" + $data_weapons[$1.to_i].name }
    @text.gsub!(/\\A\[(\d+)\]/i)  { "\x13[#{$1}]" + $data_armors[$1.to_i].name }
    # 更改字体
    @text.gsub!(/\\F\[S(\d+)\]/i) { "\x14[#{$1}]" }
    @text.gsub!(/\\F\[N(\d+)\]/i) { "\x15[#{$1}]" }
    @text.gsub!(/\\F\[C(\d+)\]/i) { "\x16[#{$1}]" }
    # 自动关闭
    @text.gsub!(/\\X\[(\d+)\]/i)  { "\x17[#{$1}]" }
    @text.gsub!(/\\X/i)            { "\x18" }
  end
  #--------------------------------------------------------------------------
  # ◎ 设置窗口背景与位置
  #--------------------------------------------------------------------------
  def reset_window
    @background = $game_message.background
    @position = $game_message.position
    if @background == 0   # 普通窗口
      self.opacity = 255
    else                  # 背景变暗、透明
      self.opacity = 0
    end
    case @position
    when 0  # 上
      self.y = 0
      @gold_window.y = 360
    when 1  # 中
      # 通过计算获取
      self.y = (Graphics.height-self.height)/2
      @gold_window.y = 0
    when 2  # 下
      # 通过计算获取
      self.y = Graphics.height-self.height
      @gold_window.y = 0
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 消息结束
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    self.pause = false
    self.index = -1
    @gold_window.close
    @number_input_window.active = false
    @number_input_window.visible = false
    $game_message.main_proc.call if $game_message.main_proc != nil
    $game_message.clear
    # 处理名称背景条和半身像
    @namebar_sprite.visible = false
    @face_sprite.visible = false
    @face_sprite.bitmap.clear
  end
  #--------------------------------------------------------------------------
  # ◎ 更新消息
  #--------------------------------------------------------------------------
  def update_message
    loop do
      c = @text.slice!(/./m)            # 获取下一条文字
      case c
      when nil                          # 没有可以显示的文字
        finish_message                  # 更新结束
        break
      when "\x00"                       # 换行
        new_line
        if @line_count >= MAX_LINE      # 行数为最大时
          unless @text.empty?           # 如果还有增加则继续
            self.pause = true           # 等待输入
            break
          end
        end
      when "\x01"                       # \C[n]  (更改文字色)
        @text.sub!(/\[([0-9]+)\]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "\x02"                       # \G  (显示所持金)
        @gold_window.refresh
        @gold_window.open
      when "\x03"                       # \.  (等待 1/4 秒)
        @wait_count = 15
        break
      when "\x04"                       # \|  (等待 1 秒)
        @wait_count = 60
        break
      when "\x05"                       # \!  (等待输入)
        self.pause = true
        break
      when "\x06"                       # \>  (瞬间显示 ON)
        @line_show_fast = true
      when "\x07"                       # \<  (瞬间显示 OFF)
        @line_show_fast = false
      when "\x08"                       # \^  (不等待输入)
        @pause_skip = true
      # 更改不透明度的情况下
      when "\x09"
        @text.sub!(/\[(\d+)\]/, "")
        contents.font.color.alpha = $1.to_i
      # 显示技能情况下
      when "\x10"
        @text.sub!(/\[(\d+)\]/, "")
        draw_icon($data_skills[$1.to_i].icon_index, @contents_x, @contents_y)
        # 纵坐标增加图标宽度
        @contents_x += 24
      # 显示物品情况下
      when "\x11"
        @text.sub!(/\[(\d+)\]/, "")
        draw_icon($data_items[$1.to_i].icon_index, @contents_x, @contents_y)
        # 纵坐标增加图标宽度
        @contents_x += 24
      # 显示武器情况下
      when "\x12"
        @text.sub!(/\[(\d+)\]/, "")
        draw_icon($data_weapons[$1.to_i].icon_index, @contents_x, @contents_y)
        # 纵坐标增加图标宽度
        @contents_x += 24
      # 显示防具情况下
      when "\x13"
        @text.sub!(/\[(\d+)\]/, "")
        draw_icon($data_armors[$1.to_i].icon_index, @contents_x, @contents_y)
        # 纵坐标增加图标宽度
        @contents_x += 24
      # 更改字体的情况下
      when "\x14"
        @text.sub!(/\[(\d+)\]/, "")
        contents.font.size = $1.to_i
      when "\x15"
        @text.sub!(/\[(\d+)\]/, "")
        contents.font.name = FONT_ARRAY[$1.to_i]
      when "\x16"
        @text.sub!(/\[(\d+)\]/, "")
        contents.font.color = text_color($1.to_i)
      # 自动关闭对话框的情况下
      when "\x17"
        @text.sub!(/\[(\d+)\]/, "")
        @auto_close = $1.to_i
      when "\x18"
        @auto_close = AUTO_CLOSE
      # 普通文字的情况下
      else
        font_height = contents.font.size + 2
        contents.draw_text(@contents_x, @contents_y, 40, font_height, c)
        c_width = contents.text_size(c).width
        @contents_x += c_width
      end
      break unless @show_fast or @line_show_fast
    end
  end
  #--------------------------------------------------------------------------
  # ◎ 消息更新结束
  #--------------------------------------------------------------------------
  def finish_message
    if $game_message.choice_max > 0
      start_choice
    elsif $game_message.num_input_variable_id > 0
      start_number_input
    elsif @pause_skip
      terminate_message
    else
      self.pause = true
    end
    @wait_count = 10
    @text = nil
  end
  #--------------------------------------------------------------------------
  # ● 开始选择项
  #--------------------------------------------------------------------------
  def start_choice
    self.active = true
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # ◎ 开始输入数值
  #--------------------------------------------------------------------------
  def start_number_input
    digits_max = $game_message.num_input_digits_max
    number = $game_variables[$game_message.num_input_variable_id]
    @number_input_window.digits_max = digits_max
    @number_input_window.number = number
    if $game_message.face_name.empty?
      @number_input_window.x = x
    else
      # 代入半身像宽度
      @number_input_window.x = x + @face_width
    end
    @number_input_window.y = y + @contents_y
    @number_input_window.active = true
    @number_input_window.visible = true
    @number_input_window.update
  end
  #--------------------------------------------------------------------------
  # ◎ 更新光标 #可能仍须增加判断
  #--------------------------------------------------------------------------
  def update_cursor
    if @index >= 0
      if $game_message.face_name.empty?
        x = 0
        y = ($game_message.choice_start+@index)*(MSG_FONT_SIZE+2)
        width = contents.width
      else
        x = @show_right ? 0 : @face_width
        y = ($game_message.choice_start+@index)*(MSG_FONT_SIZE+2) + NAME_Y_ADJ
        width = contents.width - @face_width
      end
      self.cursor_rect.set(x, y, width, (MSG_FONT_SIZE+2))
    else
      self.cursor_rect.empty
    end
  end
  #--------------------------------------------------------------------------
  # ● 文章显示输入处理
  #--------------------------------------------------------------------------
  def input_pause
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      self.pause = false
      if @text != nil and not @text.empty?
        new_page if @line_count >= MAX_LINE
      else
        terminate_message
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 选择项输入处理
  #--------------------------------------------------------------------------
  def input_choice
    if Input.trigger?(Input::B)
      if $game_message.choice_cancel_type > 0
        Sound.play_cancel
        $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
        terminate_message
      end
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      $game_message.choice_proc.call(self.index)
      terminate_message
    end
  end
  #--------------------------------------------------------------------------
  # ● 数值输入处理
  #--------------------------------------------------------------------------
  def input_number
    if Input.trigger?(Input::C)
      Sound.play_decision
      $game_variables[$game_message.num_input_variable_id] =
        @number_input_window.number
      $game_map.need_refresh = true
      terminate_message
    end
  end
  #--------------------------------------------------------------------------
  # ○ 生成名称背景条
  #--------------------------------------------------------------------------
  def create_namebar_sprite
    @namebar_sprite = Sprite.new
    @namebar_sprite.bitmap = Bitmap.new(Graphics.width-NAME_X_ADJ, NAME_FONT_SIZE+4)
    # 可视性
    @namebar_sprite.visible = false
    # 准备参数
    rect = Rect.new(NAME_X_ADJ, 0, @namebar_sprite.width, @namebar_sprite.height)
    color1 = text_color(NAME_BAR_COLOR)
    color2 = text_color(NAME_BAR_COLOR)
    color1.alpha = NAME_BAR_OPACITY
    color2.alpha = 0
    # 描绘渐变条
    @namebar_sprite.bitmap.gradient_fill_rect(rect, color1, color2)
  end
  #--------------------------------------------------------------------------
  # ○ 生成半身像
  #--------------------------------------------------------------------------
  def create_face_sprite
    @face_sprite = Sprite.new
    @face_sprite.bitmap = Bitmap.new(1,1)
    @face_sprite.z = self.z + 2
    @face_sprite.visible = false
    @old_name = ""                        # 判断头像是否改变
    @old_index = 0                        # 判断头像是否改变
  end
  #--------------------------------------------------------------------------
  # ○ 显示名称背景条
  #--------------------------------------------------------------------------
  def show_namebar_sprite
    # 坐标跟随
    @namebar_sprite.x = self.x
    @namebar_sprite.y = self.y + 16 - 1
    @namebar_sprite.z = self.z + 1
    # 可视性
    @namebar_sprite.visible = true
  end
  #--------------------------------------------------------------------------
  # ○ 描绘半身像
  #     face_name  : 半身像图像文件名
  #     face_index : 半身像图像索引
  #--------------------------------------------------------------------------
  def draw_msg_face(face_name, face_index)
    bitmap = Cache.face(face_name)
    width = bitmap.width / 4
    height = bitmap.height / 2
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * width
    rect.y = face_index / 4 * height
    rect.width = width
    rect.height = height
    @face_sprite.bitmap = Bitmap.new(width, height)
    @face_sprite.bitmap.blt(0, 0, bitmap, rect)
    @face_sprite.mirror = @show_right
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 是否显示名称
  #--------------------------------------------------------------------------
  def show_name?
    return @namebar_sprite.visible
  end
  #--------------------------------------------------------------------------
  # ○ 返回字体
  #     index       : 编号
  #--------------------------------------------------------------------------
  def get_font(index)
    case index
    when 0
      return Font.new(FONT_ARRAY[NAME_FONT_NAME], NAME_FONT_SIZE)
    when 1
      return Font.new(FONT_ARRAY[MSG_FONT_NAME], MSG_FONT_SIZE)
    end
  end
  #--------------------------------------------------------------------------
  # ○ 获取半身像宽度
  #     face_name  : 半身像图像文件名
  #--------------------------------------------------------------------------
  def get_face_width(face_name)
    bitmap = Cache.face(face_name)
    @face_width = bitmap.width / 4
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # ○ 设定半身像位置
  #--------------------------------------------------------------------------
  def set_face_pos
    @face_sprite.y = self.y + (self.height-@face_sprite.height) + FACE_Y_ADJ
    if @show_right
      @face_sprite.x = self.width - @face_sprite.width - FACE_X_ADJ
    else
      @face_sprite.x = self.x + FACE_X_ADJ
    end
    # 可视性
    @face_sprite.visible = true
  end
end

你的那个范例我试了一下...有各种的问题出现...我找到了另外的半身像显示的脚本..然而我看不懂要把头像放哪里....

评分

参与人数 1星屑 +150 收起 理由
RyanBern + 150 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
9
 楼主| 发表于 2015-7-9 14:01:28 | 只看该作者
@邪月长啸 我想要的效果类似于这样的【图片是我随便找到的..不是我的】

132554xfulx1wl8lgj1f5f.png (306.14 KB, 下载次数: 3)

132554xfulx1wl8lgj1f5f.png
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
109 小时
注册时间
2014-1-18
帖子
75
10
 楼主| 发表于 2015-7-9 18:58:16 | 只看该作者
邪月长啸 发表于 2015-7-9 12:31
其实半身像显示我都是事件的,直接使用显示图片。。。。

谢谢了..已经全部解决了..
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-23 05:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表