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

Project1

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

[已经解决] 怎么在这个脚本加一张图片!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-6-5
帖子
312
跳转到指定楼层
1
发表于 2009-8-22 14:53:44 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 肖宋发 于 2009-8-22 17:22 编辑

怎么在这个脚本加一张图片!自己使用事件加了下!结果如图,要修改成血条显示在图片上面,要怎么修改啊??
  1. #_______________________________________________________________________________
  2. # MOG_MPW HUD Elena V2.0           
  3. #_______________________________________________________________________________
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #_______________________________________________________________________________
  7. module MOG
  8. #HUD Position.
  9. STMAPX = 350   # X Pos
  10. STMAPY = 8 # Y Pos
  11. #Disable HUD Switch ID.  
  12. STMAPVIS = 1
  13. #Windowskin name.
  14. STMAPSKIN = ""
  15. #Window Opacity.
  16. STMAPOPA = 0
  17. end
  18. $mogscript = {} if $mogscript == nil
  19. $mogscript["mpstelen"] = true
  20. ###############
  21. # Window_Base #
  22. ###############
  23. class Window_Base < Window   
  24. def draw_maphp2(actor, x, y)
  25. back = RPG::Cache.picture("BAR_Meter")   
  26. cw = back.width  
  27. ch = back.height
  28. src_rect = Rect.new(0, 0, cw, ch)   
  29. self.contents.blt(x + 65, y - ch + 30, back, src_rect)
  30. meter = RPG::Cache.picture("HP_Meter")   
  31. cw = meter.width  * actor.hp / actor.maxhp
  32. ch = meter.height
  33. src_rect = Rect.new(0, 0, cw, ch)
  34. self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
  35. text = RPG::Cache.picture("HP_Tx")   
  36. cw = text.width  
  37. ch = text.height
  38. src_rect = Rect.new(0, 0, cw, ch)
  39. self.contents.blt(x + 35, y - ch + 30, text, src_rect)
  40. self.contents.font.color = Color.new(0,0,0,255)
  41. self.contents.draw_text(x + 111, y - 1, 48, 32, actor.hp.to_s, 2)
  42. self.contents.font.color = Color.new(250,255,255,255)
  43. self.contents.draw_text(x + 110, y - 2, 48, 32, actor.hp.to_s, 2)   
  44. end  
  45. def draw_mapsp2(actor, x, y)
  46. back = RPG::Cache.picture("BAR_Meter")   
  47. cw = back.width  
  48. ch = back.height
  49. src_rect = Rect.new(0, 0, cw, ch)   
  50. self.contents.blt(x + 65, y - ch + 30, back, src_rect)
  51. meter = RPG::Cache.picture("SP_Meter")   
  52. cw = meter.width  * actor.sp / actor.maxsp
  53. ch = meter.height
  54. src_rect = Rect.new(0, 0, cw, ch)
  55. self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
  56. text = RPG::Cache.picture("SP_Tx")   
  57. cw = text.width  
  58. ch = text.height
  59. src_rect = Rect.new(0, 0, cw, ch)
  60. self.contents.blt(x + 40, y - ch + 30, text, src_rect)
  61. self.contents.font.color = Color.new(0,0,0,255)
  62. self.contents.draw_text(x + 111, y - 1, 48, 32, actor.sp.to_s, 2)   
  63. self.contents.font.color = Color.new(250,255,255,255)
  64. self.contents.draw_text(x + 110, y - 2, 48, 32, actor.sp.to_s, 2)   
  65. end
  66. def draw_mexp(actor, x, y)
  67. actor = $game_party.actors[0]
  68. bitmap2 = RPG::Cache.picture("Exp_Back")
  69. cw = bitmap2.width
  70. ch = bitmap2.height
  71. src_rect = Rect.new(0, 0, cw, ch)
  72. self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)
  73. if actor.next_exp != 0
  74. rate = actor.now_exp.to_f / actor.next_exp
  75. else
  76. rate = 1
  77. end
  78. bitmap = RPG::Cache.picture("Exp_Meter")
  79. if actor.level < 99
  80. cw = bitmap.width * rate
  81. else
  82. cw = bitmap.width
  83. end   
  84. ch = bitmap.height
  85. src_rect = Rect.new(0, 0, cw, ch)
  86. self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)
  87. self.contents.font.color = Color.new(0,0,0,255)
  88. self.contents.draw_text(x + 55, y + 1, 84, 32, "Exp",0)
  89. self.contents.font.color = Color.new(255,255,255,255)
  90. self.contents.draw_text(x + 54, y, 84, 32, "Exp",0)
  91. end
  92. def nada
  93. face = RPG::Cache.picture("")
  94. end  
  95. def draw_heroface(actor,x,y)
  96. face = RPG::Cache.picture(actor.name + "_face") rescue nada
  97. cw = face.width
  98. ch = face.height
  99. src_rect = Rect.new(0, 0, cw, ch)
  100. self.contents.blt(x , y - ch, face, src_rect)   
  101. end  
  102. def draw_actor_statemap(actor, x, y, width = 120)
  103. text = make_battler_state_text(actor, width, true)
  104. self.contents.font.color = Color.new(0,0,0,255)
  105. self.contents.draw_text(x + 1, y + 1, width, 32, text)
  106. self.contents.font.color = Color.new(250,255,255,255)
  107. self.contents.draw_text(x, y, width, 32, text)
  108. end
  109. def draw_actor_levelmap(actor, x, y)
  110. self.contents.font.color = Color.new(0,0,0,255)
  111. self.contents.draw_text(x, y, 32, 32, "Lv")
  112. self.contents.font.color = Color.new(50,255,250,255)   
  113. self.contents.draw_text(x + 1, y + 1, 32, 32, "Lv")
  114. self.contents.font.color = Color.new(0,0,0,255)
  115. self.contents.draw_text(x + 30, y, 24, 32, actor.level.to_s, 1)
  116. self.contents.font.color = Color.new(255,255,255,255)   
  117. self.contents.draw_text(x + 31, y + 1, 24, 32, actor.level.to_s, 1)   
  118. end
  119. end
  120. ##############
  121. # Game_Actor #
  122. ##############
  123. class Game_Actor < Game_Battler
  124. def now_exp
  125. return @exp - @exp_list[@level]
  126. end
  127. def next_exp
  128. return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  129. end
  130. end
  131. #####################
  132. # Window_Status_Map #
  133. #####################
  134. class Window_Sthero < Window_Base
  135. def initialize
  136. super(0, 0, 380, 120)
  137. self.contents = Bitmap.new(width - 32, height - 32)
  138. self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   
  139. self.contents.font.bold = true
  140. self.contents.font.size = 20
  141. self.contents.font.name = "Georgia"
  142. self.opacity = MOG::STMAPOPA
  143. refresh
  144. end  
  145. def refresh
  146. self.contents.clear
  147. actor = $game_party.actors[0]
  148. #self.contents.font.name = "黑体"
  149. #self.contents.font.size = 24
  150. #self.contents.draw_text(34, 4, 120, 32, actor.name)
  151. #draw_actor_graphic(actor, 13, 45)
  152. #self.contents.font.size = 22
  153. #self.contents.font.name = "Georgia"
  154. draw_maphp2(actor,  15, - 10)
  155. draw_mapsp2(actor,  15, 10)
  156. draw_heroface(actor, 15, 40)
  157. draw_actor_statemap(actor, 200, 60, 70)
  158. draw_actor_levelmap(actor, 200, 33)
  159. draw_mexp(actor, 23, 27)
  160. end
  161. end
  162. ###############
  163. # Game_Player #
  164. ###############
  165. class Game_Player < Game_Character
  166. attr_accessor :wref
  167. end
  168. #############
  169. # Scene_Map #
  170. #############
  171. class Scene_Map
  172. alias mog11_main main
  173. def main
  174. @sthero = Window_Sthero.new
  175. @sthero.x = MOG::STMAPX
  176. @sthero.y = MOG::STMAPY
  177. if $game_switches[MOG::STMAPVIS] == false
  178. @sthero.visible = true  
  179. else
  180. @sthero.visible = false  
  181. end  
  182. mog11_main
  183. @sthero.dispose
  184. end
  185. alias mog11_update update
  186. def update
  187. if $game_switches[MOG::STMAPVIS] == false
  188. @sthero.visible = true  
  189. else
  190. @sthero.visible = false  
  191. end  
  192. if $game_player.wref == true
  193. @sthero.refresh
  194. $game_player.wref = false
  195. end
  196. mog11_update
  197. end  
  198. end  
  199. ##############
  200. # Game_Party #
  201. ###############
  202. class Game_Party
  203. alias mog11_check_map_slip_damage check_map_slip_damage  
  204. def check_map_slip_damage
  205. for actor in @actors
  206. if actor.hp > 0 and actor.slip_damage?
  207. $game_player.wref = true
  208. end
  209. end
  210. mog11_check_map_slip_damage  
  211. end
  212. end
  213. ###############
  214. # Interpreter #
  215. ###############
  216. class Interpreter
  217. alias mog11_command_311 command_311
  218. def command_311
  219. mog11_command_311
  220. $game_player.wref = true   
  221. end   
  222. alias mog11_command_312 command_312
  223. def command_312
  224. mog11_command_312
  225. $game_player.wref = true   
  226. end   
  227. alias mog11_command_313 command_313
  228. def command_313
  229. mog11_command_313
  230. $game_player.wref = true   
  231. end   
  232. alias mog11_command_314 command_314
  233. def command_314
  234. mog11_command_314
  235. $game_player.wref = true   
  236. end   
  237. alias mog11_command_315 command_315
  238. def command_315
  239. mog11_command_315
  240. $game_player.wref = true   
  241. end   
  242. end   
  243. ################
  244. # Game_Battler #
  245. ################
  246. class Game_Battler
  247. alias mog11_attack_effect attack_effect
  248. def attack_effect(attacker)
  249. mog11_attack_effect(attacker)  
  250. $game_player.wref = true
  251. end
  252. alias mog11_skill_effect skill_effect
  253. def skill_effect(user, skill)
  254. mog11_skill_effect(user, skill)
  255. $game_player.wref = true  
  256. end  
  257. alias mog11_item_effect item_effect
  258. def item_effect(item)
  259. mog11_item_effect(item)
  260. $game_player.wref = true  
  261. end
  262. alias mog11_add_state add_state
  263. def add_state(state_id, force = false)
  264. mog11_add_state(state_id, force = false)
  265. $game_player.wref = true  
  266. end
  267. end
复制代码

Lv3.寻梦者

小柯的徒弟

梦石
0
星屑
1535
在线时间
1157 小时
注册时间
2008-5-24
帖子
3085

贵宾

7
发表于 2009-8-26 17:19:04 | 只看该作者
私下解决了N*10的问题……包括这个。

楼上的应该用Sprite精灵才可以。窗口太小了。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
579
在线时间
169 小时
注册时间
2008-10-29
帖子
431
6
发表于 2009-8-26 17:08:07 | 只看该作者
#####################

# Window_Status_Map #

#####################

class Window_Sthero < Window_Base

def initialize

super(0, 0, 380, 120)

self.contents = Bitmap.new(width - 32, height - 32)

self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   

self.contents.font.bold = true

self.contents.font.size = 20

self.contents.font.name = "Georgia"

self.opacity = MOG::STMAPOPA

refresh

end  

def refresh

self.contents.clear

actor = $game_party.actors[0]

#self.contents.font.name = "黑体"

#self.contents.font.size = 24

#self.contents.draw_text(34, 4, 120, 32, actor.name)

#draw_actor_graphic(actor, 13, 45)

#self.contents.font.size = 22

#self.contents.font.name = "Georgia"

draw_maphp2(actor,  15, - 10)

draw_mapsp2(actor,  15, 10)

draw_heroface(actor, 15, 40)

draw_actor_statemap(actor, 200, 60, 70)

draw_actor_levelmap(actor, 200, 33)

draw_mexp(actor, 23, 27)

end

end

#######################
看了一下 应该 改这个部分

def refresh

self.contents.clear
后面 加上 如下语句
bitmap=Bitmap.new("Graphics/pictures/XXXX")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)  
其中("Graphics/pictures/XXXX")是你的图片路径
x,y是图片的坐标
试一试吧
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
579
在线时间
169 小时
注册时间
2008-10-29
帖子
431
5
发表于 2009-8-26 17:08:00 | 只看该作者
#####################

# Window_Status_Map #

#####################

class Window_Sthero < Window_Base

def initialize

super(0, 0, 380, 120)

self.contents = Bitmap.new(width - 32, height - 32)

self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   

self.contents.font.bold = true

self.contents.font.size = 20

self.contents.font.name = "Georgia"

self.opacity = MOG::STMAPOPA

refresh

end  

def refresh

self.contents.clear

actor = $game_party.actors[0]

#self.contents.font.name = "黑体"

#self.contents.font.size = 24

#self.contents.draw_text(34, 4, 120, 32, actor.name)

#draw_actor_graphic(actor, 13, 45)

#self.contents.font.size = 22

#self.contents.font.name = "Georgia"

draw_maphp2(actor,  15, - 10)

draw_mapsp2(actor,  15, 10)

draw_heroface(actor, 15, 40)

draw_actor_statemap(actor, 200, 60, 70)

draw_actor_levelmap(actor, 200, 33)

draw_mexp(actor, 23, 27)

end

end

#######################
看了一下 应该 改这个部分

def refresh

self.contents.clear
后面 加上 如下语句
bitmap=Bitmap.new("Graphics/pictures/XXXX")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)  
其中("Graphics/pictures/XXXX")是你的图片路径
x,y是图片的坐标
试一试吧
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2009-7-24
帖子
338
4
发表于 2009-8-24 09:10:14 | 只看该作者
图片看不到
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-6-5
帖子
312
3
 楼主| 发表于 2009-8-23 13:24:12 | 只看该作者
{:3_50:}没有人吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-6-5
帖子
312
2
 楼主| 发表于 2009-8-22 18:49:05 | 只看该作者
也没有人会啊?????????????
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-1-10 17:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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