Project1

标题: 关于画血槽的问题 [打印本页]

作者: 天猴    时间: 2009-3-6 04:11
提示: 作者被禁止或删除 内容自动屏蔽
作者: jhlv0650    时间: 2009-3-6 04:11
天干宝典庚卷里面有教学的
作者: 天猴    时间: 2009-3-6 04:13
提示: 作者被禁止或删除 内容自动屏蔽
作者: redant    时间: 2009-3-6 05:05
  1. #图片血槽显示Ver 1.0(清爽版)
  2. #              by逐月

  3. #描画HP槽
  4. def HP (actor,x,y)         
  5. @bitmap3 = Bitmap.new("Graphics/Pictures/底")
  6. @src_rect3 = Rect.new(0,0,@bitmap3.width, @bitmap3.height)
  7. self.contents.blt(x,y, @bitmap3, @src_rect3)
  8. #HP显示
  9. @bitmap3 = Bitmap.new("Graphics/Pictures/hp")
  10. w3 = @bitmap3.width * actor.hp/actor.maxhp
  11. @src_rect3 = Rect.new(0,0,w3, @bitmap3.height)
  12. self.contents.blt(x+4,y+2, @bitmap3, @src_rect3)
  13. end
  14. #描画SP槽
  15. def SP (actor,x,y)
  16. @bitmap1 = Bitmap.new("Graphics/Pictures/底")
  17. @src_rect1 = Rect.new(0,0,@bitmap1.width, @bitmap1.height)
  18. self.contents.blt(x,y, @bitmap1, @src_rect1)
  19. #SP显示           
  20. @bitmap1 = Bitmap.new("Graphics/Pictures/sp")
  21. w1 = @bitmap1.width * actor.sp/actor.maxsp
  22. @src_rect1 = Rect.new(0,0,w1, @bitmap1.height)
  23. self.contents.blt(x+4,y+2, @bitmap1, @src_rect1)
  24. end

  25. #==============================================================================
  26. # ■ Window_BattleStatus
  27. #==============================================================================
  28. class Window_BattleStatus < Window_Base
  29. #--------------------------------------------------------------------------
  30. # ● 初始化
  31. #--------------------------------------------------------------------------
  32. alias xrxs_bp3_refresh refresh
  33. def refresh
  34.    xrxs_bp3_refresh
  35.    @item_max = $game_party.actors.size
  36.     for i in 0...$game_party.actors.size
  37.      actor = $game_party.actors[i]
  38.         bitmap = Bitmap.new("Graphics/system/menu/back/" + actor.name + "_name.png")
  39.       src_rect = Rect.new(0, 0, 120, 66)
  40.      case i
  41.        when 0
  42.         x = 145
  43.         y = 259
  44.           #draw_actor_name(actor, 400 - 40,420-5)
  45.       
  46.       self.contents.blt(345, 405 , bitmap, src_rect)
  47.       
  48.       when 1
  49.         x = 145
  50.         y = 339
  51.          # draw_actor_name(actor, 470 - 40,350-15 )
  52.            self.contents.blt(420, 330 , bitmap, src_rect)
  53.        when 2
  54.         x = 145
  55.         y = 419
  56.          # draw_actor_name(actor, 540 - 30,280-20)
  57.            self.contents.blt(500, 255 , bitmap, src_rect)
  58.        when 3
  59.         x = 145
  60.         y = 499
  61.           #draw_actor_name(actor, 610 - 40 ,210 )
  62.             self.contents.blt(560, 190 , bitmap, src_rect)
  63.           end
  64.       ###########################一切自改##############################
  65.      HP(actor, x-10, y)
  66.      SP(actor, x-10, y + 18)
  67.      # draw_actor_name(actor, x ,y )
  68.   
  69.      #######################################一切自改###############
  70.    end
  71. end

  72. end
复制代码



作者: 后知后觉    时间: 2009-3-6 05:58
帮你上传了一个
http://www.uushare.com/user/yk67602298/file/1351609 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: jhlv0650    时间: 2009-3-6 19:51
按F1看帮助里面的RGSS参考》游戏库》内部类,
再看看Bitmap、rect、Sprite里面定义的方法。




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