查看: 1902|回复: 2

[已经解决] Bust Shot立绘脚本立绘位置更改的提问。

[复制链接]
梦石
0
星屑
50
在线时间
121 小时
注册时间
2014-1-24
回帖
77
发表于 2015-8-15 16:14:29 | 显示全部楼层 |阅读模式

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

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

×
搜狗截图20150815160206.png

如图,Bust Shot脚本的立绘图片底部是紧贴游戏框的,我想将图片的底部位置改变一下。
列如,将图片底部稍微提上一厘米之类的。

请问我该修改Bust Shot脚本中的哪处呢?

[pre lang="ruby"]#encoding:utf-8
#==============================================================================
# ■ 半身像对话框 by LBQ
#------------------------------------------------------------------------------
#  一个简单的半身像对话框罢了= =
#------------------------------------------------------------------------------
# ■ 用法一览
#     1:如何将半身像应用到游戏中?
#       ——如果想要把一个脸图替换成半身像,则需要找到这个脸图的编号,比如说拉尔
#           夫,就是Actor1的编号0,之后去在Graphics/Busts这个文件夹里面拷贝一个
#           叫做Actor1_0的图像,这个图像会被当做半身像替换原有图像。
#==============================================================================
# 2013.8.25 => 修复存档不能Bug (感谢小刀
#==============================================================================
$imported ||= {}
$imported[:LBQ_Bust]=true

module LBQ
  module Bust
    FOLDER="Busts"
    SUB1=[/【/,    "\\{\\c[6]-- "]
    SUB2=[/】/,    " --\\c[0]\\}"]

    TEXT_FOR_NEXT="[next]"
    TEXT_FOR_END ="[end]"

    INDENT=255 #半身像的缩进
  end
end

module Cache
  def self.busts(filename)
    load_bitmap("Graphics/#{LBQ::Bust::FOLDER}/", filename)
  end
end



class Sprite_Bust < Sprite_Base
  attr_accessor   :bust_graphics
  attr_accessor   :status

  def initialize(vp=nil)
    super(vp)
    @bust_graphics=nil
    @status=:nothing
  end

  def slide_in
    @status=:sliding_in
  end

  def slide_out
    @status=:sliding_out
    if $game_temp.do_not_slide_out
      @status=:slided_out
      set_pos
    end
  end




  def set_pos(slide_in=true)
    self.x=0 - self.bitmap.width
    self.y=Graphics.height-self.bitmap.height

    self.x=0 unless slide_in
  end


  def set_graphics(bust_graphics)
    self.bitmap=Cache.busts(bust_graphics)
  end



  def update
    super
    case @status
    when :nothing
      # Do Nothing
    when :sliding_in
      #Slide In
      self.x+=12
      if self.x>=0
        self.x=0
        @status=:slided_in
      end

    when :sliding_out
      self.x-=12
      if self.x<= -self.bitmap.width
        self.x= -self.bitmap.width
        @status=:slided_out
      end
      #Slide Out
    when :slided_in
      #Slided in
    when :slided_out
      #Sliede out
    end

  end


end



class Game_Temp
  attr_accessor   :bust_name
  attr_accessor   :bust
  attr_accessor   :have_bust
  attr_accessor   :do_not_slide_out

  alias lbq_bust_shot_game_message_init initialize
  def initialize
    lbq_bust_shot_game_message_init
    @bust_name=""
    @bust=nil
    @have_bust=false
    @do_not_slide_out=false
  end




end

class Game_Message
   #--------------------------------------------------------------------------
  # ● 添加内容
  #--------------------------------------------------------------------------
  def add(text)
    new_text=text.gsub(LBQ::Bust::SUB1[0],LBQ::Bust::SUB1[1])
    new_text2=new_text.gsub(LBQ::Bust::SUB2[0],LBQ::Bust::SUB2[1])
    if new_text2.include? LBQ::Bust::TEXT_FOR_NEXT
      new_text2.delete!(LBQ::Bust::TEXT_FOR_NEXT)
      $game_temp.do_not_slide_out=true
    end

    if new_text2.include? LBQ::Bust::TEXT_FOR_END
      new_text2.delete!(LBQ::Bust::TEXT_FOR_END)
      $game_temp.do_not_slide_out=false
    end
    @texts.push(new_text2)
  end
end


class Game_Interpreter
  alias lbq_bust_shot_command_101 command_101
  #--------------------------------------------------------------------------
  # ● 显示文字
  #--------------------------------------------------------------------------
  def command_101
    $game_temp.bust=nil
      unless @params[0].empty?
        if File.exist?("Graphics/#{LBQ::Bust::FOLDER}/#{@params[0]}_#{@params[1]}.png")
          $game_temp.have_bust=true
        else
          $game_temp.have_bust=false
          $game_temp.bust_name=""
        end
      end

    unless @params[3] == 2
      $game_temp.have_bust=false
    end

    if $game_temp.have_bust
      $game_temp.bust_name="#{@params[0]}_#{@params[1]}"
      $game_temp.bust=nil
      $game_temp.bust=Sprite_Bust.new
      $game_temp.bust.set_graphics($game_temp.bust_name)
      $game_temp.bust.z=99999
      unless $game_temp.do_not_slide_out
        $game_temp.bust.set_pos
        $game_temp.bust.slide_in
      else
        $game_temp.bust.set_pos(false)
        $game_temp.bust.slide_in
      end
    end

    lbq_bust_shot_command_101
    if $game_temp.have_bust
        $game_temp.bust.slide_out
        Fiber.yield until $game_temp.bust.status==:slided_out
    end
    $game_temp.have_bust=false
    $game_temp.bust_name=""

  end


  alias lbq_bust_int_update update
  def update
    lbq_bust_int_update
    $game_temp.bust.update unless $game_temp.bust.nil?
  end

end


class Window_Message
  #--------------------------------------------------------------------------
  # ● 获取换行位置
  #--------------------------------------------------------------------------
  def new_line_x
    # 如果有头像
    unless $game_message.face_name.empty?
      value=112
      value=LBQ::Bust::INDENT unless $game_temp.bust_name.empty?
    # 木有
    else
      value=0
    end
    return value
  end
end


class Window_Message
  #--------------------------------------------------------------------------
  # ● 翻页处理
  #--------------------------------------------------------------------------
  def new_page(text, pos)
    contents.clear
    draw_face($game_message.face_name, $game_message.face_index, 0, 0) if $game_temp.bust_name.empty?
    reset_font_settings
    pos[:x] = new_line_x
    pos[:y] = 0
    pos[:new_x] = new_line_x
    pos[:height] = calc_line_height(text)
    clear_flags
  end
end
[/pre]
*^ヮ^)♪.,#,.♪♪.,#,.♪(+´∀`+)
梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
回帖
1057
发表于 2015-8-15 16:46:26 | 显示全部楼层
66行
    self.y=Graphics.height-self.bitmap.height
提高就在后面减一个数值 降低就加一个数值

点评

现在明白了!非常感谢!  发表于 2015-8-15 17:40
可以演示一下吗QAQ  发表于 2015-8-15 17:21

评分

参与人数 1星屑 +200 收起 理由
taroxd + 200 认可答案

查看全部评分

RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。
回复

使用道具 举报

梦石
0
星屑
189
在线时间
1452 小时
注册时间
2010-9-23
回帖
492
发表于 2015-8-15 17:29:43 | 显示全部楼层
按照墨凌羽大大说的,帮楼主改了一下。
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 半身像对话框 by LBQ
  4. #------------------------------------------------------------------------------
  5. #  一个简单的半身像对话框罢了= =
  6. #------------------------------------------------------------------------------
  7. # ■ 用法一览
  8. #     1:如何将半身像应用到游戏中?
  9. #       ——如果想要把一个脸图替换成半身像,则需要找到这个脸图的编号,比如说拉尔
  10. #           夫,就是Actor1的编号0,之后去在Graphics/Busts这个文件夹里面拷贝一个
  11. #           叫做Actor1_0的图像,这个图像会被当做半身像替换原有图像。
  12. #==============================================================================
  13. # 2013.8.25 => 修复存档不能Bug (感谢小刀
  14. #==============================================================================
  15. $imported ||= {}
  16. $imported[:LBQ_Bust]=true

  17. module LBQ
  18.   module Bust
  19.     FOLDER="Busts"
  20.     SUB1=[/【/,    "\\{\\c[6]-- "]
  21.     SUB2=[/】/,    " --\\c[0]\\}"]

  22.     TEXT_FOR_NEXT="[next]"
  23.     TEXT_FOR_END ="[end]"

  24.     INDENT=255 #半身像的缩进
  25.   end
  26. end

  27. module Cache
  28.   def self.busts(filename)
  29.     load_bitmap("Graphics/#{LBQ::Bust::FOLDER}/", filename)
  30.   end
  31. end



  32. class Sprite_Bust < Sprite_Base
  33.   attr_accessor   :bust_graphics
  34.   attr_accessor   :status

  35.   def initialize(vp=nil)
  36.     super(vp)
  37.     @bust_graphics=nil
  38.     @status=:nothing
  39.   end

  40.   def slide_in
  41.     @status=:sliding_in
  42.   end

  43.   def slide_out
  44.     @status=:sliding_out
  45.     if $game_temp.do_not_slide_out
  46.       @status=:slided_out
  47.       set_pos
  48.     end
  49.   end




  50.   def set_pos(slide_in=true)
  51.     self.x=0 - self.bitmap.width
  52.     self.y=Graphics.height-self.bitmap.height-6

  53.     self.x=0 unless slide_in
  54.   end


  55.   def set_graphics(bust_graphics)
  56.     self.bitmap=Cache.busts(bust_graphics)
  57.   end



  58.   def update
  59.     super
  60.     case @status
  61.     when :nothing
  62.       # Do Nothing
  63.     when :sliding_in
  64.       #Slide In
  65.       self.x+=12
  66.       if self.x>=0
  67.         self.x=0
  68.         @status=:slided_in
  69.       end

  70.     when :sliding_out
  71.       self.x-=12
  72.       if self.x<= -self.bitmap.width
  73.         self.x= -self.bitmap.width
  74.         @status=:slided_out
  75.       end
  76.       #Slide Out
  77.     when :slided_in
  78.       #Slided in
  79.     when :slided_out
  80.       #Sliede out
  81.     end

  82.   end


  83. end



  84. class Game_Temp
  85.   attr_accessor   :bust_name
  86.   attr_accessor   :bust
  87.   attr_accessor   :have_bust
  88.   attr_accessor   :do_not_slide_out

  89.   alias lbq_bust_shot_game_message_init initialize
  90.   def initialize
  91.     lbq_bust_shot_game_message_init
  92.     @bust_name=""
  93.     @bust=nil
  94.     @have_bust=false
  95.     @do_not_slide_out=false
  96.   end




  97. end

  98. class Game_Message
  99.    #--------------------------------------------------------------------------
  100.   # ● 添加内容
  101.   #--------------------------------------------------------------------------
  102.   def add(text)
  103.     new_text=text.gsub(LBQ::Bust::SUB1[0],LBQ::Bust::SUB1[1])
  104.     new_text2=new_text.gsub(LBQ::Bust::SUB2[0],LBQ::Bust::SUB2[1])
  105.     if new_text2.include? LBQ::Bust::TEXT_FOR_NEXT
  106.       new_text2.delete!(LBQ::Bust::TEXT_FOR_NEXT)
  107.       $game_temp.do_not_slide_out=true
  108.     end

  109.     if new_text2.include? LBQ::Bust::TEXT_FOR_END
  110.       new_text2.delete!(LBQ::Bust::TEXT_FOR_END)
  111.       $game_temp.do_not_slide_out=false
  112.     end
  113.     @texts.push(new_text2)
  114.   end
  115. end


  116. class Game_Interpreter
  117.   alias lbq_bust_shot_command_101 command_101
  118.   #--------------------------------------------------------------------------
  119.   # ● 显示文字
  120.   #--------------------------------------------------------------------------
  121.   def command_101
  122.     $game_temp.bust=nil
  123.       unless @params[0].empty?
  124.         if File.exist?("Graphics/#{LBQ::Bust::FOLDER}/#{@params[0]}_#{@params[1]}.png")
  125.           $game_temp.have_bust=true
  126.         else
  127.           $game_temp.have_bust=false
  128.           $game_temp.bust_name=""
  129.         end
  130.       end

  131.     unless @params[3] == 2
  132.       $game_temp.have_bust=false
  133.     end

  134.     if $game_temp.have_bust
  135.       $game_temp.bust_name="#{@params[0]}_#{@params[1]}"
  136.       $game_temp.bust=nil
  137.       $game_temp.bust=Sprite_Bust.new
  138.       $game_temp.bust.set_graphics($game_temp.bust_name)
  139.       $game_temp.bust.z=99999
  140.       unless $game_temp.do_not_slide_out
  141.         $game_temp.bust.set_pos
  142.         $game_temp.bust.slide_in
  143.       else
  144.         $game_temp.bust.set_pos(false)
  145.         $game_temp.bust.slide_in
  146.       end
  147.     end

  148.     lbq_bust_shot_command_101
  149.     if $game_temp.have_bust
  150.         $game_temp.bust.slide_out
  151.         Fiber.yield until $game_temp.bust.status==:slided_out
  152.     end
  153.     $game_temp.have_bust=false
  154.     $game_temp.bust_name=""

  155.   end


  156.   alias lbq_bust_int_update update
  157.   def update
  158.     lbq_bust_int_update
  159.     $game_temp.bust.update unless $game_temp.bust.nil?
  160.   end

  161. end


  162. class Window_Message
  163.   #--------------------------------------------------------------------------
  164.   # ● 获取换行位置
  165.   #--------------------------------------------------------------------------
  166.   def new_line_x
  167.     # 如果有头像
  168.     unless $game_message.face_name.empty?
  169.       value=112
  170.       value=LBQ::Bust::INDENT unless $game_temp.bust_name.empty?
  171.     # 木有
  172.     else
  173.       value=0
  174.     end
  175.     return value
  176.   end
  177. end


  178. class Window_Message
  179.   #--------------------------------------------------------------------------
  180.   # ● 翻页处理
  181.   #--------------------------------------------------------------------------
  182.   def new_page(text, pos)
  183.     contents.clear
  184.     draw_face($game_message.face_name, $game_message.face_index, 0, 0) if $game_temp.bust_name.empty?
  185.     reset_font_settings
  186.     pos[:x] = new_line_x
  187.     pos[:y] = 0
  188.     pos[:new_x] = new_line_x
  189.     pos[:height] = calc_line_height(text)
  190.     clear_flags
  191.   end
  192. end
复制代码

点评

楼主还是感谢墨凌羽大大吧,我不懂脚本的。 = =  发表于 2015-8-15 17:41
非常感谢!  发表于 2015-8-15 17:39

评分

参与人数 2星屑 +220 收起 理由
taroxd + 200 认可答案
墨凌羽 + 20 我很赞同

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部