Project1

标题: 关于对话框显示头像的问题。 [打印本页]

作者: 于大为    时间: 2014-5-5 20:32
标题: 关于对话框显示头像的问题。
本帖最后由 于大为 于 2014-5-5 21:47 编辑

如题,我获得了一套1088*576的4*2脸图,如下

但是这套头像在使用过程中不能显示完整。我已经在windows-base里385行修改了。如下
rect = Rect.new(face_index % 4 * 272, face_index / 4 * 288, 272, 288)
原来是rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
但是在使用过程里虽然可以正常裁切。但是变成了这样。如下

显示头像不仅不完整,而且会导致和对话重叠。请问这样的问题要如何解决呢?另外,我已经搜索了论坛的对话框。但是那些一般需要在新的文件夹里面搁置单张脸图。这并不适用于我这里。所以希望大家可以从默认脚本方面解决。谢谢!
最后,我希望可以达成这样。如下

来自@LBQ
只要头像效果就可以,谢谢大家!
P,实在不行的话编写脚本也行哦~希望大家可以帮助我。
最后,@迷糊的安安 版主,我愿意把1VIP给帮助我的人!
作者: sh0016    时间: 2014-5-5 20:32
没怎么细测,会直接获取对话框的头像资料不需要额外设定,想让头像覆盖对话框把Z值调到高于200就行了。
基本上只是把头像绘制出来没怎么考虑原本对话框......嘛反正那个调整应该不难_(:3」∠)_
  1. #==============================================================================
  2. # ■ Window_Message
  3. #------------------------------------------------------------------------------
  4. #  显示文字信息的窗口。
  5. #==============================================================================

  6. class Window_Message < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对象
  9.   #--------------------------------------------------------------------------
  10.   alias def_initialize_message initialize
  11.   def initialize
  12.     def_initialize_message
  13.     create_face_sprite
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 更新画面
  17.   #--------------------------------------------------------------------------
  18.   alias def_update_message update
  19.   def update
  20.     def_update_message
  21.     update_face_sprite
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 创建头像精灵
  25.   #--------------------------------------------------------------------------
  26.   def create_face_sprite
  27.     @face_sprite = Sprite.new
  28.     @face_sprite.y = Graphics.height - 288
  29.     @face_sprite.z = 190
  30.     @face_sprite.bitmap = Bitmap.new(272, 288)
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 更新头像位图
  34.   #--------------------------------------------------------------------------
  35.   def update_face_sprite
  36.     if $game_message.face_name == ""
  37.       @face_sprite.bitmap.clear
  38.     else
  39.       face_name = Cache.face($game_message.face_name)
  40.       face_index = $game_message.face_index
  41.       face_rect = Rect.new(face_index % 4 * 272, face_index / 4 * 288, 272, 288)
  42.       @face_sprite.bitmap.blt(0, 0, face_name, face_rect, 255)
  43.     end
  44.   end
  45. end
复制代码

作者: sh0016    时间: 2014-5-5 20:39
不知道楼主具体写法怎么样,好像头像还在对话框里?因为这尺寸在对话框里放不下,所以还是建议用新窗口或sprite绘制。

把整张素材分开成8份单独的就能用论坛上的对话框吧?这样比写专门的脚本要快多了......




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1