查看: 1757|回复: 3

[已经过期] 请为这个脚本加个开关控制

[复制链接]
梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
发表于 2013-11-22 13:34:00 | 显示全部楼层 |阅读模式

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

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

×
当10号才使用这个脚本
但是要怎么添加?
  1. #==============================================================================
  2. # ★RGSS2
  3. # *STR11b_XP Battle Style #Battle Message v1.2 08/01/26
  4. # Created by star: http://otsu.cool.ne.jp/strcatyou/
  5. # Translated by Mr. Bubble
  6. #
  7. # ・Battle message appears with transparent background at
  8. #  the upper left of the screen.
  9. #
  10. #------------------------------------------------------------------------------

  11. #==============================================================================
  12. # ■ Window_BattleMessage
  13. #==============================================================================
  14. class Window_BattleMessage < Window_Message
  15.   # Gradient Background [Left, Right]
  16.   TEXT_B_COLOR = [Color.new(0,0,0,160), Color.new(0,0,0,0)]
  17.   INFO      = "信息" # String that shows at the upper left of message window
  18.   BTWIDTH   = 320       # Message Width
  19.   MOVE      = false      # Smooth resize of lines
  20.   SPEED     = 1        # Resize Speed
  21.   W_OPACITY = 96        # Transparency 1~255
  22.   #
  23.   N_WINDOW  = false     # Window is not converted transparent
  24.   #--------------------------------------------------------------------------
  25.   # ★ エイリアス
  26.   #--------------------------------------------------------------------------
  27.   alias initialize_str11b initialize
  28.   def initialize
  29.     initialize_str11b
  30.     self.x = 0
  31.     self.y = 0
  32.     self.back_opacity = 0
  33.     self.opacity = 0
  34.     unless N_WINDOW
  35.       @b_sprite = Sprite.new(self.viewport)
  36.       bitmap = Bitmap.new(BTWIDTH, 96 + 16)
  37.       bitmap.gradient_fill_rect(0, 16, BTWIDTH, 96, TEXT_B_COLOR[0], TEXT_B_COLOR[1])
  38.       bitmap.font.shadow = false
  39.       bitmap.font.size = 16
  40.       bitmap.draw_text(2, 2, BTWIDTH, 16, INFO)
  41.       @b_sprite.bitmap = bitmap
  42.       @b_sprite.x = self.x
  43.       @b_sprite.y = self.y
  44.       @b_sprite.src_rect.height = 16
  45.       @b_sprite.opacity = 0
  46.       @str11f = false
  47.     end
  48.   end
  49.   alias dispose_str11b dispose
  50.   def dispose
  51.     dispose_str11b
  52.     unless N_WINDOW
  53.       @b_sprite.bitmap.dispose
  54.       @b_sprite.dispose
  55.     end
  56.   end
  57.   alias update_str11b update
  58.   def update
  59.     update_str11b
  60.    
  61.     unless N_WINDOW
  62.       if self.visible and (@lines.size > 0 and not @str11f) or
  63.          (@text != nil or self.pause or [url=home.php?mod=space&uid=370741]@Index[/url] > -1)
  64.         @b_sprite.opacity += W_OPACITY
  65.         h = @b_sprite.src_rect.height
  66.         if @text != nil
  67.           @l = 4
  68.         else
  69.           unless self.pause or @index > -1
  70.             @l = @lines.size
  71.           else
  72.             @l = 4
  73.           end
  74.         end
  75.         if MOVE
  76.           if SPEED == 1
  77.             @b_sprite.src_rect.height = 16 + (@l * 24)
  78.           else
  79.             s = (SPEED - 1)
  80.             @b_sprite.src_rect.height = (h + ((16 + (@l * 24)) * s)) / SPEED
  81.           end
  82.         else
  83.           @b_sprite.src_rect.height = 96 + 16
  84.         end
  85.       else
  86.         @b_sprite.opacity -= W_OPACITY
  87.       end
  88.     else
  89.       if self.visible
  90.         self.back_opacity += W_OPACITY
  91.         self.opacity += W_OPACITY
  92.         self.back_opacity = 200 if self.back_opacity > 200
  93.       else
  94.         self.back_opacity -= W_OPACITY
  95.         self.opacity -= W_OPACITY
  96.       end
  97.     end
  98.   end
  99. end
复制代码
不定期回来6R玩。
↓下方广告帖,欢迎点击

狂気の月兔

梦石
0
星屑
421
在线时间
1245 小时
注册时间
2009-4-7
回帖
866

贵宾

发表于 2013-11-22 18:39:39 | 显示全部楼层
[pre lang="ruby" line="1"]#==============================================================================
# ★RGSS2
# *STR11b_XP Battle Style #Battle Message v1.2 08/01/26
# Created by star: http://otsu.cool.ne.jp/strcatyou/
# Translated by Mr. Bubble
#
# ・Battle message appears with transparent background at
#  the upper left of the screen.
#
#------------------------------------------------------------------------------

#==============================================================================
# ■ Window_BattleMessage
#==============================================================================
class Window_BattleMessage < Window_Message
  # Gradient Background [Left, Right]
  TEXT_B_COLOR = [Color.new(0,0,0,160), Color.new(0,0,0,0)]
  INFO      = "信息" # String that shows at the upper left of message window
  BTWIDTH   = 320       # Message Width
  MOVE      = false      # Smooth resize of lines
  SPEED     = 1        # Resize Speed
  W_OPACITY = 96        # Transparency 1~255
  #
  N_WINDOW  = false     # Window is not converted transparent
  
  SwitchesID = 10
  #--------------------------------------------------------------------------
  # ★ エイリアス
  #--------------------------------------------------------------------------
  alias initialize_str11b initialize
  def initialize
    initialize_str11b
    self.x = 0
    self.y = 0
    self.back_opacity = 0
    self.opacity = 0
    @b_sprite = Sprite.new(self.viewport)
    bitmap = Bitmap.new(BTWIDTH, 96 + 16)
    bitmap.gradient_fill_rect(0, 16, BTWIDTH, 96, TEXT_B_COLOR[0], TEXT_B_COLOR[1])
    bitmap.font.shadow = false
    bitmap.font.size = 16
    bitmap.draw_text(2, 2, BTWIDTH, 16, INFO)
    @b_sprite.bitmap = bitmap
    @b_sprite.x = self.x
    @b_sprite.y = self.y
    @b_sprite.src_rect.height = 16
    @b_sprite.opacity = 0
    @str11f = false
  end
  
  alias dispose_str11b dispose
  def dispose
    dispose_str11b
    @b_sprite.bitmap.dispose
    @b_sprite.dispose
  end
  
  alias update_str11b update
  def update
    update_str11b
    @b_sprite.visible = $game_switches[SwitchesID]
    if $game_switches[SwitchesID]
      if self.visible and (@lines.size > 0 and not @str11f) or
         (@text != nil or self.pause or @Index > -1)
        @b_sprite.opacity += W_OPACITY
        h = @b_sprite.src_rect.height
        if @text != nil
          @l = 4
        else
          unless self.pause or @index > -1
            @l = @lines.size
          else
            @l = 4
          end
        end
        if MOVE
          if SPEED == 1
            @b_sprite.src_rect.height = 16 + (@l * 24)
          else
            s = (SPEED - 1)
            @b_sprite.src_rect.height = (h + ((16 + (@l * 24)) * s)) / SPEED
          end
        else
          @b_sprite.src_rect.height = 96 + 16
        end
      else
        @b_sprite.opacity -= W_OPACITY
      end
    else
      if self.visible
        self.back_opacity += W_OPACITY
        self.opacity += W_OPACITY
        self.back_opacity = 200 if self.back_opacity > 200
      else
        self.back_opacity -= W_OPACITY
        self.opacity -= W_OPACITY
      end
    end
  end
end
[/pre]

未测试

评分

参与人数 1星屑 +120 收起 理由
怪蜀黍 + 120 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
 楼主| 发表于 2013-11-22 23:45:58 | 显示全部楼层
铃仙·优昙华院·因幡 发表于 2013-11-22 18:39
#==============================================================================
# ★RGSS2
# *STR11b ...

多谢,可是跟默认的效果还是有些冲突啊

点评

这个无能为力  发表于 2013-11-23 12:27
不定期回来6R玩。
↓下方广告帖,欢迎点击
回复

使用道具 举报

梦石
0
星屑
381
在线时间
238 小时
注册时间
2013-8-20
回帖
410
 楼主| 发表于 2013-11-24 23:18:53 | 显示全部楼层
铃仙·优昙华院·因幡 发表于 2013-11-22 18:39
#==============================================================================
# ★RGSS2
# *STR11b ...

米事,实现基本的效果就可以啦
不定期回来6R玩。
↓下方广告帖,欢迎点击
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部