| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2013-6-25 |
| 在线时间 | 687 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 687 小时
- 注册时间
- 2012-10-29
- 回帖
- 1526
|
发表于 2013-3-13 17:54:34
|
显示全部楼层
本帖最后由 j433463 于 2013-3-13 18:35 编辑
呃,有个月姬(姬公主)的图标气球脚本,看了网站的使用条款没有提到禁止转贴,只有保持原脚本和脚本上方的说明,所以我就贴出了,若有疑义,请说一声,我好及时删除。
脚本需要配合一张气球图:

图片请放到 Graphics/System 内。
下面这是脚本:
[pre lang="ruby" line="1"]=begin
#==============================================================================
** Icon Balloon
Author: Tsukihime
Date: Sep 3, 2012
------------------------------------------------------------------------------
** Change log
Sep 3
- updated with more method aliasing
- initial release
------------------------------------------------------------------------------
Similar to the emotion balloons, except it uses an icon instead.
You will need a copy of the Icon-Balloon.png file, which is basically
one row of balloon frames copied from the Balloon.png file.
Script call:
show_icon_balloon(char_id, icon_index, wait?)
`char_id` is the character on the map
(-1 = player, 0 = this event, 1+ is specific event ID)
`icon_index` is the index of the icon
`wait` is a boolean representing whether the game should wait until the balloon disappears
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_IconBalloons"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
module Icon_Balloon
end
end
#==============================================================================
# ** Rest of script
#==============================================================================
class Game_Interpreter
def show_icon_balloon(char_id, icon_index, need_wait=false)
character = get_character(char_id)
if character
character.icon_balloon_id = icon_index
Fiber.yield while character.icon_balloon_id > 0 if need_wait
end
end
end
class Game_CharacterBase
attr_accessor :icon_balloon_id
alias :th_icon_balloon_init_public :init_public_members
def init_public_members
th_icon_balloon_init_public
@icon_balloon_id = 0
end
end
class Sprite_Character
alias :th_icon_balloon_initialize :initialize
def initialize(viewport, character = nil)
@icon_balloon_duration = 0
th_icon_balloon_initialize(viewport, character)
end
alias :th_icon_balloon_dispose :dispose
def dispose
th_icon_balloon_dispose
end_icon_balloon
end
alias :th_icon_balloon_update :update
def update
th_icon_balloon_update
update_icon_balloon #new
end
alias :th_icon_balloon_setup_new :setup_new_effect
def setup_new_effect
th_icon_balloon_setup_new
if !@icon_balloon_sprite && @character.icon_balloon_id > 0
@icon_balloon_id = @character.icon_balloon_id
start_icon_balloon
end
end
# new icon balloon methods
def start_icon_balloon
dispose_icon_balloon
@icon_balloon_duration = 8 * balloon_speed + balloon_wait
@icon_balloon_sprite = ::Sprite.new(viewport)
@icon_balloon_sprite.bitmap = Cache.system("Icon-Balloon")
@icon_balloon_sprite.ox = 16
@icon_balloon_sprite.oy = 32
@icon = Cache.system("Iconset")
@icon_rect = Rect.new(@icon_balloon_id % 16 * 24, @icon_balloon_id / 16 * 24, 24, 24)
@icon_balloon_sprite.bitmap.blt(4, 2, @icon, @icon_rect, 255)
update_icon_balloon
end
#--------------------------------------------------------------------------
# * Free Balloon Icon
#--------------------------------------------------------------------------
def dispose_icon_balloon
if @icon_balloon_sprite
@icon_balloon_sprite.dispose
@icon_balloon_sprite = nil
end
end
#--------------------------------------------------------------------------
# * Update Balloon Icon
#--------------------------------------------------------------------------
def update_icon_balloon
if @icon_balloon_duration > 0
@icon_balloon_duration -= 1
if @icon_balloon_duration > 0
@icon_balloon_sprite.x = x
@icon_balloon_sprite.y = y - height
@icon_balloon_sprite.z = z + 200
sx = balloon_frame_index * 32
sy = 0
@icon_balloon_sprite.src_rect.set(sx, sy, 32, 32)
@icon_balloon_sprite.bitmap.blt(sx+4, sy+2, @icon, @icon_rect, 255)
else
end_icon_balloon
end
end
end
#--------------------------------------------------------------------------
# * End Balloon Icon
#--------------------------------------------------------------------------
def end_icon_balloon
dispose_icon_balloon
@character.icon_balloon_id = 0
end
#--------------------------------------------------------------------------
# * Balloon Icon Display Speed
#--------------------------------------------------------------------------
def balloon_speed
return 8
end
#--------------------------------------------------------------------------
# * Wait Time for Last Frame of Balloon
#--------------------------------------------------------------------------
def balloon_wait
return 12
end
#--------------------------------------------------------------------------
# * Frame Number of Balloon Icon
#--------------------------------------------------------------------------
def balloon_frame_index
return 7 - [(@icon_balloon_duration - balloon_wait) / balloon_speed, 0].max
end
end[/pre]
调用方法是:
[pre lang="ruby" line="1"]show_icon_balloon(角色 id, 图标 id, 保持几帧时间)[/pre]
角色 id 可以是 -1 玩家, 0 本事件, 1 或以上为指定的事件 id
好像还有一个 tomoaky 写的 icon 脚本也是做类似的效果,脚本名是 RGSS3_アイコンポップ ver 1.2,
日文脚本请自己下载吧:
http://hikimoki.sakura.ne.jp/rgss3/script_map/tmicpop.rb
|
评分
-
查看全部评分
|