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

Project1

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

[已经解决] 怎么之定义战斗边框,在战斗场景里面加角色头像图片

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
跳转到指定楼层
1
发表于 2019-10-24 15:09:34 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
比如说,和神魔幻想一样,在战斗画面里面添加头像,和自定义状态的边框

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
2
 楼主| 发表于 2019-10-24 15:10:56 | 只看该作者
我是想自己添加一些东西,比如HP和MP文字,用图片替换 还有  就是添加战斗角色头像图片
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3790
在线时间
1578 小时
注册时间
2006-5-5
帖子
2742
3
发表于 2019-10-24 16:00:41 | 只看该作者
这个不好说啊。
关键是你需要什么样的界面,总得画个简单的图让人看看吧,不同要求的话添加数据和修改地方略有不同
步兵中尉
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
4
 楼主| 发表于 2019-10-26 14:51:12 | 只看该作者
步兵中尉 发表于 2019-10-24 16:00
这个不好说啊。
关键是你需要什么样的界面,总得画个简单的图让人看看吧,不同要求的话添加数据和修改地方 ...

那就问个简单的,就添加每个角色的人物头像
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3790
在线时间
1578 小时
注册时间
2006-5-5
帖子
2742
5
发表于 2019-10-26 15:02:18 | 只看该作者
问的就是你需要什么样的战斗界面。
比如我这个,轩辕剑3的战斗界面,你如果需要你发的图那种,那么设置方法可能就完全不同


步兵中尉
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
6
 楼主| 发表于 2019-10-28 17:13:24 | 只看该作者
步兵中尉 发表于 2019-10-26 15:02
问的就是你需要什么样的战斗界面。
比如我这个,轩辕剑3的战斗界面,你如果需要你发的图那种,那么设置方法 ...

就是类似这种的
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3790
在线时间
1578 小时
注册时间
2006-5-5
帖子
2742
7
发表于 2019-10-28 22:45:22 | 只看该作者
试试这个
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. # ————————————————————————————————————
  5. # ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
  6. # by 桜雅 在土
  7. #==============================================================================
  8. # ■ Window_BattleStatus
  9. #==============================================================================
  10. class Window_BattleStatus < Window_Base
  11. #--------------------------------------------------------------------------
  12. # ● 公開インスタンス変数
  13. #--------------------------------------------------------------------------
  14. attr_accessor :update_cp_only # CPメーターのみの更新
  15. #--------------------------------------------------------------------------
  16. # ● オブジェクト初期化
  17. #--------------------------------------------------------------------------
  18. alias xrxs_bp7_initialize initialize
  19. def initialize
  20. # 初期化
  21. @previous_hp = []
  22. @previous_sp = []
  23. # 呼び戻す
  24. xrxs_bp7_initialize
  25. ##############################修改############################################
  26. @sta_back = []
  27. for actor_index in 1..$game_party.actors.size
  28.   actor = $game_party.actors[actor_index - 1]
  29. @sta_back[actor_index] = Sprite.new
  30. @sta_back[actor_index].bitmap = Bitmap.new("Graphics/Characters/Heads/"+ actor.name + ".png")
  31. @sta_back[actor_index].x = (actor_index- 1)* 160 - 5 #在这里调整图片x坐标
  32. @sta_back[actor_index].y = 343#在这里调整图片y坐标
  33. @sta_back[actor_index].z = self.z+1#在这里调整图片优先级
  34. end
  35. ##############################修改############################################
  36. # ↓Full-Viewの場合は下二行の # を消してください。
  37. #self.opacity = 0
  38. #self.back_opacity = 0
  39. ##############################修改############################################
  40. refresh
  41. ##############################修改############################################
  42. end
  43. ##############################修改############################################
  44. def dispose
  45.    super  
  46.    for actor_index in 1..$game_party.actors.size
  47.       @sta_back[actor_index].bitmap.dispose
  48.       @sta_back[actor_index].dispose
  49.    end
  50. end
  51. ##############################修改############################################
  52. #--------------------------------------------------------------------------
  53. # ● リフレッシュ
  54. #--------------------------------------------------------------------------
  55. alias xrxs_bp7_refresh refresh
  56. def refresh
  57. # CPメーターの更新のみ の場合
  58. if @update_cp_only
  59. xrxs_bp7_refresh
  60. return
  61. end
  62. # 変更するものがない場合、飛ばす
  63. @item_max = $game_party.actors.size
  64. bool = false
  65. for i in 0...@item_max
  66. actor = $game_party.actors[i]
  67. if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  68. bool = true
  69. end
  70. end
  71. return if bool == false
  72. # 描写を開始
  73. self.contents.clear
  74. for i in 0...@item_max
  75. actor = $game_party.actors[i]
  76. actor_x = i * 160 + 29
  77. # 歩行キャラグラフィックの描写
  78. #draw_actor_graphic(actor, actor_x - 9, 116)

  79. # HP/SPメーターの描写
  80. draw_actor_hp_meter_line(actor, actor_x, 47, 96, 12)
  81. draw_actor_sp_meter_line(actor, actor_x, 79, 96, 12)
  82. # HP数値の描写
  83. self.contents.font.size = 24 # HP/SP数値の文字の大きさ
  84. self.contents.font.color = Color.new(0,0,0,192)
  85. self.contents.draw_text(actor_x, 35, 96, 24, actor.hp.to_s, 2)
  86. self.contents.font.color = actor.hp == 0 ? knockout_color :
  87. actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  88. self.contents.draw_text(actor_x-2, 33, 96, 24, actor.hp.to_s, 2)
  89. # SP数値の描写
  90. self.contents.font.color = Color.new(0,0,0,192)
  91. self.contents.draw_text(actor_x, 72, 96, 24, actor.sp.to_s, 2)
  92. self.contents.font.color = actor.sp == 0 ? knockout_color :
  93. actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  94. self.contents.draw_text(actor_x-2, 70, 96, 24, actor.sp.to_s, 2)
  95. # 用語「HP」と用語「SP」の描写
  96. self.contents.font.size = 20 # 用語「HP/SP」の文字の大きさ
  97. draw_actor_name(actor, actor_x ,3 )

  98. self.contents.font.color = Color.new(0,0,0,192)
  99. self.contents.draw_text(actor_x+2, 27, 196, 24, $data_system.words.hp)
  100. self.contents.draw_text(actor_x+2, 59, 196, 24, $data_system.words.sp)
  101. self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  102. self.contents.draw_text(actor_x, 25, 196, 24, $data_system.words.hp)
  103. self.contents.draw_text(actor_x, 57, 196, 24, $data_system.words.sp)
  104. draw_actor_state(actor, actor_x, 100)
  105. # 値を更新
  106. @previous_hp[i] = actor.hp
  107. @previous_hp[i] = actor.hp
  108. end
  109. end
  110. end
  111. #==============================================================================
  112. # ■ Window_Base
  113. #==============================================================================
  114. class Window_Base < Window
  115. #--------------------------------------------------------------------------
  116. # ● HPメーター の描画
  117. #--------------------------------------------------------------------------
  118. def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  119. w = width * actor.hp / [actor.maxhp,1].max
  120. hp_color_1 = Color.new(255, 0, 0, 192)
  121. hp_color_2 = Color.new(255, 255, 0, 192)
  122. self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  123. draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  124. x -= 1
  125. y += (height/4).floor
  126. self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  127. draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  128. x -= 1
  129. y += (height/4).ceil
  130. self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  131. draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  132. x -= 1
  133. y += (height/4).ceil
  134. self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  135. draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  136. end
  137. #--------------------------------------------------------------------------
  138. # ● SPメーター の描画
  139. #--------------------------------------------------------------------------
  140. def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  141. w = width * actor.sp / [actor.maxsp,1].max
  142. hp_color_1 = Color.new( 0, 0, 255, 192)
  143. hp_color_2 = Color.new( 0, 255, 255, 192)
  144. self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  145. draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  146. x -= 1
  147. y += (height/4).floor
  148. self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  149. draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  150. x -= 1
  151. y += (height/4).ceil
  152. self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  153. draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  154. x -= 1
  155. y += (height/4).ceil
  156. self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  157. draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  158. end
  159. #--------------------------------------------------------------------------
  160. # ● 名前の描画
  161. #--------------------------------------------------------------------------
  162. alias xrxs_bp7_draw_actor_name draw_actor_name
  163. def draw_actor_name(actor, x, y)
  164. xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  165. end
  166. #--------------------------------------------------------------------------
  167. # ● ステートの描画
  168. #--------------------------------------------------------------------------
  169. alias xrxs_bp7_draw_actor_state draw_actor_state
  170. def draw_actor_state(actor, x, y, width = 120)  
  171. xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  172. end
  173. #--------------------------------------------------------------------------
  174. # ● HP の描画
  175. #--------------------------------------------------------------------------
  176. alias xrxs_bp7_draw_actor_hp draw_actor_hp
  177. def draw_actor_hp(actor, x, y, width = 144)
  178. xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  179. end
  180. #--------------------------------------------------------------------------
  181. # ● SP の描画
  182. #--------------------------------------------------------------------------
  183. alias xrxs_bp7_draw_actor_sp draw_actor_sp
  184. def draw_actor_sp(actor, x, y, width = 144)
  185. xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  186. end
  187. end
  188. #==============================================================================
  189. # ■ Scene_Battle
  190. #==============================================================================
  191. class Scene_Battle
  192. #--------------------------------------------------------------------------
  193. # ● フレーム更新
  194. #--------------------------------------------------------------------------
  195. alias xrxs_bp7_update update
  196. def update
  197. xrxs_bp7_update
  198. # メッセージウィンドウ表示中の場合
  199. if $game_temp.message_window_showing
  200. @status_window.update_cp_only = true
  201. else
  202. @status_window.update_cp_only = false
  203. end
  204. end
  205. end
  206. #==============================================================================
  207. # ◇ 外部ライブラリ
  208. #==============================================================================
  209. class Window_Base
  210. #--------------------------------------------------------------------------
  211. # ● ライン描画 軽量版 by 桜雅 在土
  212. #--------------------------------------------------------------------------
  213. def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  214. # 描写距離の計算。大きめに直角時の長さ。
  215. distance = (start_x - end_x).abs + (start_y - end_y).abs
  216. # 描写開始
  217. for i in 1..distance
  218. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  219. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  220. self.contents.set_pixel(x, y, start_color)
  221. end
  222. end
  223. #--------------------------------------------------------------------------
  224. # ● ライン描画 by 桜雅 在土
  225. #--------------------------------------------------------------------------
  226. def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  227. # 描写距離の計算。大きめに直角時の長さ。
  228. distance = (start_x - end_x).abs + (start_y - end_y).abs
  229. # 描写開始
  230. if end_color == start_color
  231. for i in 1..distance
  232. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  233. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  234. if width == 1
  235. self.contents.set_pixel(x, y, start_color)
  236. else
  237. self.contents.fill_rect(x, y, width, width, start_color)
  238. end
  239. end
  240. else
  241. for i in 1..distance
  242. x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  243. y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  244. r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  245. g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  246. b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  247. a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  248. if width == 1
  249. self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  250. else
  251. self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  252. end
  253. end
  254. end
  255. end
  256. end

  257. #==============================================================================
  258. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  259. #==============================================================================
复制代码
步兵中尉
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
8
 楼主| 发表于 2019-10-29 11:53:46 | 只看该作者

是这个没错但是,我只需要头像 血条不需要
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1237
在线时间
163 小时
注册时间
2019-10-4
帖子
217
9
 楼主| 发表于 2019-10-29 22:35:45 | 只看该作者
论坛里面有人弄出来了,想做和我一样的效果的可以自行搜索,标题如下:
[推荐问答] 【自问答】如何在战斗画面的状态框加入人物头像,
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 03:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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