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

Project1

 找回密码
 注册会员
搜索

关于对话框显示头像的问题。

查看数: 2476 | 评论数: 2 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2014-5-5 20:32

正文摘要:

本帖最后由 于大为 于 2014-5-5 21:47 编辑 如题,我获得了一套1088*576的4*2脸图,如下 来自@LBQ 只要头像效果就可以,谢谢大家! P,实在不行的话编写脚本也行哦~希望大家可以帮助我。 最后,@迷糊的安安 版 ...

回复

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

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

点评

请问,如果使用新的窗口绘制应该怎么处理呢?另外,如果使用论坛的窗口绘制的话,源文件拆分有419张,相对可能还是用脚本会好一些。  发表于 2014-5-5 20:42
sh0016 发表于 2014-5-5 20:32:29
没怎么细测,会直接获取对话框的头像资料不需要额外设定,想让头像覆盖对话框把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
复制代码

点评

完美,非常感谢啦~这次的vip奉上!  发表于 2014-5-5 23:10

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 完美,非常感谢啦

查看全部评分

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

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

GMT+8, 2024-9-25 11:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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