赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1764 |
最后登录 | 2013-9-3 |
在线时间 | 30 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 30 小时
- 注册时间
- 2012-7-8
- 帖子
- 255
|
求教下
脚本盲求救- #==============================================================================
- # ★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 = 360 # Message Width
- MOVE = true # Smooth resize of lines
- SPEED = 1 # Resize Speed
- W_OPACITY = 96 # Transparency 1~255
- #
- N_WINDOW = false # Window is not converted transparent
- #--------------------------------------------------------------------------
- # ★ エイリアス
- #--------------------------------------------------------------------------
- alias initialize_str11b initialize
- def initialize
- initialize_str11b
- self.x = 0
- self.y = 0
- self.back_opacity = 0
- self.opacity = 0
- unless N_WINDOW
- @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
- end
- alias dispose_str11b dispose
- def dispose
- dispose_str11b
- unless N_WINDOW
- @b_sprite.bitmap.dispose
- @b_sprite.dispose
- end
- end
- alias update_str11b update
- def update
- update_str11b
-
- unless N_WINDOW
- 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
复制代码
显示这张图片,该出现时就出现,消失时就消失。
|
|