赞 | 5 |
VIP | 0 |
好人卡 | 2 |
积分 | 36 |
经验 | 24079 |
最后登录 | 2024-11-22 |
在线时间 | 1891 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3606
- 在线时间
- 1891 小时
- 注册时间
- 2010-6-19
- 帖子
- 1211
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
发现脚本里面显示图片太过繁琐了,如何改成类似下面这样简洁显示?
if @battler.startactive == "待机"
if Graphics.frame_count % 7 == 0
unless BattlerName_Actor[@battler.battler_name].nil?
@number = (@number + 1) % BattlerName_Actor[@battler.battler_name][@battler.startactive].size
self.bitmap = RPG::Cache.battler(BattlerName_Actor[@battler.battler_name][@battler.startactive][@number], @battler_hue)
end
module Scene_BattleName
# 移动速度
Move_Duration = 60
# 角色
BattlerName_Actor = { "友-梦灵泉(待)" => {
"待机" => ["友-梦灵泉(待)","梦灵泉/友/待/2","梦灵泉/友/待/3","梦灵泉/友/待/4","梦灵泉/友/待/5","梦灵泉/友/待/6","梦灵泉/友/待/7","梦灵泉/友/待/8","梦灵泉/友/待/9","梦灵泉/友/待/10","梦灵泉/友/待/11","梦灵泉/友/待/12"]},
}
end
class Scene_Battle
include Scene_BattleName
end
class Sprite_Battler
include Scene_BattleName
end
上面的图片显示太过繁琐如何改成下面那样,直接简化显示
class Window_BabyFace < Window_Base
def initialize
super(180-32, 20-32, 150+64, 220+64)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@bitmap_index = 0
@rect = Rect.new(0, 0, 0, 0)
end
def refresh(actor)
self.contents.clear
return if actor.nil? or BattlerName_Actor[actor.name].nil?
if @id != actor.id or @face != actor.face
@id = actor.id
@face = actor.face
@bitmap_index = 0
str = BattlerName_Actor[actor.name][actor.face]
@index = [*str.split("-")[0].to_i..str.split("-")[1].to_i]
end
bitmap = Bitmap.new("Graphics/Battlers/#{actor.name}/敌/#{actor.face}/" +
sprintf("%d",@index[@bitmap_index]))
self.contents.blt(-55, -45, bitmap, @rect.set(0, 0, bitmap.width, bitmap.height))
@bitmap_index += 1
if @bitmap_index >= @index.size
@bitmap_index = 0
if rand(100) < 10
ar = BattlerName_Actor[actor.name].keys
actor.face = ar[rand(ar.size)]
end
end
end
end
BattlerName_Actor = {
"梦灵泉"=>{"待机"=>"1-7"},
} |
|