Project1

标题: 请教脚本修改.战斗开始时和战斗结束时.(外:血量脚本) [打印本页]

作者: jhhuang    时间: 2007-8-24 16:59
标题: 请教脚本修改.战斗开始时和战斗结束时.(外:血量脚本)
(PS:以下三个全是战斗中的问题.可以把脚本复制到你的游戏试一下}
我想在战斗开始时,当人物数为1时显示一张---图片---"战斗界面1"
当人物数为2时显示一张---图片---"战斗界面2"
当人物数为3时显示一张---图片---"战斗界面3"
当人物数为4时显示一张---图片---"战斗界面4"
和战斗结束时消除---图片---.

问题2:
血量显示脚本显示"HP字"/"SP字"/"HP量字"/"SP量字"/"HP图"/"SP图"/"根据名字显示战斗图",这些图全部是显示在---图片---下面的.
我想把"根据名字显示战斗图"显示在---图片---上面.

最大问题3:
我想在SP显示的下面再加"EXP图",
同样,经验百分比图显示在---图片---下面.

下面是血量脚本:
  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.     # ↓Full-Viewの場合は下二行の # を消してください。
  26.     #self.opacity = 0
  27.     #self.back_opacity = 0
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● リフレッシュ
  31.   #--------------------------------------------------------------------------
  32.   alias xrxs_bp7_refresh refresh
  33.   def refresh
  34.     # CPメーターの更新のみ の場合
  35.     if @update_cp_only
  36.       xrxs_bp7_refresh
  37.       return
  38.     end
  39.     # 変更するものがない場合、飛ばす
  40.     @item_max = $game_party.actors.size
  41.     bool = false
  42.     for i in 0...@item_max
  43.       actor = $game_party.actors[i]
  44.       if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  45.         bool = true
  46.       end
  47.     end
  48.     return if bool == false
  49.     # 描写を開始
  50.     self.contents.clear
  51.     for i in 0...@item_max
  52.       actor = $game_party.actors[i]
  53.       actor_x = i * 160 + 35
  54.       # HP/SPメーターの描写
  55.       draw_actor_hp_meter_line(actor, actor_x, 62, 96, 10)
  56.       draw_actor_sp_meter_line(actor, actor_x, 80, 96, 10)
  57.       # HP数値の描写
  58.       self.contents.font.size = 12 # HP/SP数値の文字の大きさ
  59.       self.contents.font.color = Color.new(0,0,0,192)
  60.       self.contents.draw_text(actor_x-2, 56, 96, 24, actor.hp.to_s, 2)
  61.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  62.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  63.       self.contents.draw_text(actor_x-4, 54, 96, 24, actor.hp.to_s, 2)
  64.       # SP数値の描写
  65.       self.contents.font.color = Color.new(0,0,0,192)
  66.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.sp.to_s, 2)
  67.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  68.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  69.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.sp.to_s, 2)
  70.       # 用語「HP」と用語「SP」の描写
  71.       self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
  72.       self.contents.font.color = Color.new(0,0,0,0)
  73.       self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
  74.       self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
  75.       self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  76.       self.contents.draw_text(actor_x - 10, 62, 196, 24, $data_system.words.hp)
  77.       self.contents.draw_text(actor_x - 10, 62, 196, 24, $data_system.words.sp)
  78.       # ステートの描写
  79.       draw_actor_state(actor, actor_x, 100)
  80.       # 値を更新
  81.       @previous_hp[i] = actor.hp
  82.       @previous_hp[i] = actor.hp
  83.     end
  84.   end
  85. end
  86. #==============================================================================
  87. # ■ Window_Base
  88. #==============================================================================
  89. class Window_Base < Window
  90.   #--------------------------------------------------------------------------
  91.   # ● HPメーター の描画
  92.   #--------------------------------------------------------------------------
  93.   def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  94.     w = width * actor.hp / [actor.maxhp,1].max
  95.     hp_color_1 = Color.new(255, 255, 0, 192)
  96.     hp_color_2 = Color.new(255, 0, 0, 192)
  97.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  98.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  99.     x -= 1
  100.     y += (height/4).floor
  101.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  102.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  103.     x -= 1
  104.     y += (height/4).ceil
  105.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  106.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  107.     x -= 1
  108.     y += (height/4).ceil
  109.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  110.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● SPメーター の描画
  114.   #--------------------------------------------------------------------------
  115.   def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  116.     w = width * actor.sp / [actor.maxsp,1].max
  117.     hp_color_1 = Color.new( 0, 255, 255, 192)
  118.     hp_color_2 = Color.new( 0, 0, 255, 192)
  119.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  120.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  121.     x -= 1
  122.     y += (height/4).floor
  123.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  124.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  125.     x -= 1
  126.     y += (height/4).ceil
  127.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  128.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  129.     x -= 1
  130.     y += (height/4).ceil
  131.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  132.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● 名前の描画
  136.   #--------------------------------------------------------------------------
  137.   alias xrxs_bp7_draw_actor_name draw_actor_name
  138.   def draw_actor_name(actor, x, y)
  139.     xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● ステートの描画
  143.   #--------------------------------------------------------------------------
  144.   alias xrxs_bp7_draw_actor_state draw_actor_state
  145.   def draw_actor_state(actor, x, y, width = 120)
  146.     xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● HP の描画
  150.   #--------------------------------------------------------------------------
  151.   alias xrxs_bp7_draw_actor_hp draw_actor_hp
  152.   def draw_actor_hp(actor, x, y, width = 144)
  153.     xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● SP の描画
  157.   #--------------------------------------------------------------------------
  158.   alias xrxs_bp7_draw_actor_sp draw_actor_sp
  159.   def draw_actor_sp(actor, x, y, width = 144)
  160.     xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  161.   end
  162. end
  163. #==============================================================================
  164. # ■ Scene_Battle
  165. #==============================================================================
  166. class Scene_Battle
  167.   #--------------------------------------------------------------------------
  168.   # ● フレーム更新
  169.   #--------------------------------------------------------------------------
  170.   alias xrxs_bp7_update update
  171.   def update
  172.     xrxs_bp7_update
  173.     # メッセージウィンドウ表示中の場合
  174.     if $game_temp.message_window_showing
  175.       @status_window.update_cp_only = true      
  176.     else
  177.       @status_window.update_cp_only = false
  178.     end
  179.   end
  180. end
  181. #==============================================================================
  182. # ◇ 外部ライブラリ
  183. #==============================================================================
  184. class Window_Base
  185.   #--------------------------------------------------------------------------
  186.   # ● ライン描画 軽量版 by 桜雅 在土
  187.   #--------------------------------------------------------------------------
  188.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  189.     # 描写距離の計算。大きめに直角時の長さ。
  190.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  191.     # 描写開始
  192.     for i in 1..distance
  193.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  194.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  195.       self.contents.set_pixel(x, y, start_color)
  196.     end
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● ライン描画 by 桜雅 在土
  200.   #--------------------------------------------------------------------------
  201.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  202.     # 描写距離の計算。大きめに直角時の長さ。
  203.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  204.     # 描写開始
  205.     if end_color == start_color
  206.       for i in 1..distance
  207.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  208.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  209.         if width == 1
  210.           self.contents.set_pixel(x, y, start_color)
  211.         else
  212.           self.contents.fill_rect(x, y, width, width, start_color)
  213.         end
  214.       end
  215.     else
  216.       for i in 1..distance
  217.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  218.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  219.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  220.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  221.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  222.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  223.         if width == 1
  224.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  225.         else
  226.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  227.         end
  228.       end
  229.     end
  230.   end
  231. end


  232. #==============================================================================
  233. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  234. #==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: jhhuang    时间: 2007-8-24 16:59
标题: 请教脚本修改.战斗开始时和战斗结束时.(外:血量脚本)
(PS:以下三个全是战斗中的问题.可以把脚本复制到你的游戏试一下}
我想在战斗开始时,当人物数为1时显示一张---图片---"战斗界面1"
当人物数为2时显示一张---图片---"战斗界面2"
当人物数为3时显示一张---图片---"战斗界面3"
当人物数为4时显示一张---图片---"战斗界面4"
和战斗结束时消除---图片---.

问题2:
血量显示脚本显示"HP字"/"SP字"/"HP量字"/"SP量字"/"HP图"/"SP图"/"根据名字显示战斗图",这些图全部是显示在---图片---下面的.
我想把"根据名字显示战斗图"显示在---图片---上面.

最大问题3:
我想在SP显示的下面再加"EXP图",
同样,经验百分比图显示在---图片---下面.

下面是血量脚本:
  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.     # ↓Full-Viewの場合は下二行の # を消してください。
  26.     #self.opacity = 0
  27.     #self.back_opacity = 0
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● リフレッシュ
  31.   #--------------------------------------------------------------------------
  32.   alias xrxs_bp7_refresh refresh
  33.   def refresh
  34.     # CPメーターの更新のみ の場合
  35.     if @update_cp_only
  36.       xrxs_bp7_refresh
  37.       return
  38.     end
  39.     # 変更するものがない場合、飛ばす
  40.     @item_max = $game_party.actors.size
  41.     bool = false
  42.     for i in 0...@item_max
  43.       actor = $game_party.actors[i]
  44.       if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
  45.         bool = true
  46.       end
  47.     end
  48.     return if bool == false
  49.     # 描写を開始
  50.     self.contents.clear
  51.     for i in 0...@item_max
  52.       actor = $game_party.actors[i]
  53.       actor_x = i * 160 + 35
  54.       # HP/SPメーターの描写
  55.       draw_actor_hp_meter_line(actor, actor_x, 62, 96, 10)
  56.       draw_actor_sp_meter_line(actor, actor_x, 80, 96, 10)
  57.       # HP数値の描写
  58.       self.contents.font.size = 12 # HP/SP数値の文字の大きさ
  59.       self.contents.font.color = Color.new(0,0,0,192)
  60.       self.contents.draw_text(actor_x-2, 56, 96, 24, actor.hp.to_s, 2)
  61.       self.contents.font.color = actor.hp == 0 ? knockout_color :
  62.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  63.       self.contents.draw_text(actor_x-4, 54, 96, 24, actor.hp.to_s, 2)
  64.       # SP数値の描写
  65.       self.contents.font.color = Color.new(0,0,0,192)
  66.       self.contents.draw_text(actor_x-2, 74, 96, 24, actor.sp.to_s, 2)
  67.       self.contents.font.color = actor.sp == 0 ? knockout_color :
  68.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  69.       self.contents.draw_text(actor_x-4, 72, 96, 24, actor.sp.to_s, 2)
  70.       # 用語「HP」と用語「SP」の描写
  71.       self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
  72.       self.contents.font.color = Color.new(0,0,0,0)
  73.       self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
  74.       self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
  75.       self.contents.font.color = system_color # 用語「HP/SP」の文字の色
  76.       self.contents.draw_text(actor_x - 10, 62, 196, 24, $data_system.words.hp)
  77.       self.contents.draw_text(actor_x - 10, 62, 196, 24, $data_system.words.sp)
  78.       # ステートの描写
  79.       draw_actor_state(actor, actor_x, 100)
  80.       # 値を更新
  81.       @previous_hp[i] = actor.hp
  82.       @previous_hp[i] = actor.hp
  83.     end
  84.   end
  85. end
  86. #==============================================================================
  87. # ■ Window_Base
  88. #==============================================================================
  89. class Window_Base < Window
  90.   #--------------------------------------------------------------------------
  91.   # ● HPメーター の描画
  92.   #--------------------------------------------------------------------------
  93.   def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
  94.     w = width * actor.hp / [actor.maxhp,1].max
  95.     hp_color_1 = Color.new(255, 255, 0, 192)
  96.     hp_color_2 = Color.new(255, 0, 0, 192)
  97.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  98.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  99.     x -= 1
  100.     y += (height/4).floor
  101.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  102.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  103.     x -= 1
  104.     y += (height/4).ceil
  105.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  106.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  107.     x -= 1
  108.     y += (height/4).ceil
  109.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  110.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● SPメーター の描画
  114.   #--------------------------------------------------------------------------
  115.   def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
  116.     w = width * actor.sp / [actor.maxsp,1].max
  117.     hp_color_1 = Color.new( 0, 255, 255, 192)
  118.     hp_color_2 = Color.new( 0, 0, 255, 192)
  119.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  120.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  121.     x -= 1
  122.     y += (height/4).floor
  123.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  124.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  125.     x -= 1
  126.     y += (height/4).ceil
  127.     self.contents.fill_rect(x, y, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  128.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  129.     x -= 1
  130.     y += (height/4).ceil
  131.     self.contents.fill_rect(x, y, width, (height/4).floor, Color.new(0, 0, 0, 128))
  132.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● 名前の描画
  136.   #--------------------------------------------------------------------------
  137.   alias xrxs_bp7_draw_actor_name draw_actor_name
  138.   def draw_actor_name(actor, x, y)
  139.     xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● ステートの描画
  143.   #--------------------------------------------------------------------------
  144.   alias xrxs_bp7_draw_actor_state draw_actor_state
  145.   def draw_actor_state(actor, x, y, width = 120)
  146.     xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● HP の描画
  150.   #--------------------------------------------------------------------------
  151.   alias xrxs_bp7_draw_actor_hp draw_actor_hp
  152.   def draw_actor_hp(actor, x, y, width = 144)
  153.     xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● SP の描画
  157.   #--------------------------------------------------------------------------
  158.   alias xrxs_bp7_draw_actor_sp draw_actor_sp
  159.   def draw_actor_sp(actor, x, y, width = 144)
  160.     xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  161.   end
  162. end
  163. #==============================================================================
  164. # ■ Scene_Battle
  165. #==============================================================================
  166. class Scene_Battle
  167.   #--------------------------------------------------------------------------
  168.   # ● フレーム更新
  169.   #--------------------------------------------------------------------------
  170.   alias xrxs_bp7_update update
  171.   def update
  172.     xrxs_bp7_update
  173.     # メッセージウィンドウ表示中の場合
  174.     if $game_temp.message_window_showing
  175.       @status_window.update_cp_only = true      
  176.     else
  177.       @status_window.update_cp_only = false
  178.     end
  179.   end
  180. end
  181. #==============================================================================
  182. # ◇ 外部ライブラリ
  183. #==============================================================================
  184. class Window_Base
  185.   #--------------------------------------------------------------------------
  186.   # ● ライン描画 軽量版 by 桜雅 在土
  187.   #--------------------------------------------------------------------------
  188.   def draw_lineght(start_x, start_y, end_x, end_y, start_color)
  189.     # 描写距離の計算。大きめに直角時の長さ。
  190.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  191.     # 描写開始
  192.     for i in 1..distance
  193.       x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  194.       y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  195.       self.contents.set_pixel(x, y, start_color)
  196.     end
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # ● ライン描画 by 桜雅 在土
  200.   #--------------------------------------------------------------------------
  201.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  202.     # 描写距離の計算。大きめに直角時の長さ。
  203.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  204.     # 描写開始
  205.     if end_color == start_color
  206.       for i in 1..distance
  207.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  208.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  209.         if width == 1
  210.           self.contents.set_pixel(x, y, start_color)
  211.         else
  212.           self.contents.fill_rect(x, y, width, width, start_color)
  213.         end
  214.       end
  215.     else
  216.       for i in 1..distance
  217.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  218.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  219.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  220.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  221.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  222.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  223.         if width == 1
  224.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  225.         else
  226.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  227.         end
  228.       end
  229.     end
  230.   end
  231. end


  232. #==============================================================================
  233. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  234. #==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: jhhuang    时间: 2007-8-24 20:41
汗...三个问题没一个有人会吗??
第一个问题很重要,而且应该不难....
战斗开始时和战斗结束时加东西而已,应该怎么加?
作者: 索尔迦·蓝    时间: 2007-8-24 20:59
提示: 作者被禁止或删除 内容自动屏蔽
作者: jhhuang    时间: 2007-8-24 21:30
OK....但是....为什么图片显示在下面-.-?图片一般是默认最前置的吧-.-


以下引用索尔迦·蓝于2007-8-24 12:59:49的发言:

SceneBattle1
   # 执行过渡(46行)
上面加入
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("战斗界面" + $game_party.actors.size.to_s)
然后
   # 释放窗口(72行)
下面加入
@sprite.bitmap.dispose
@sprite.dispose


作者: jhhuang    时间: 2007-8-24 21:45
汗.....算了,还是不用改了...我把这个脚本稍微改改的话...你就等于解决我全部问题了..
不过能分开解决是更好了..




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