| 赞 | 486 |
| VIP | |
| 好人卡 | |
| 积分 | 497 |
| 经验 | |
| 最后登录 | 2026-10-3 |
| 在线时间 | 7948 小时 |
老黄鸡
- 梦石
- 4
- 星屑
- 45705
- 在线时间
- 7948 小时
- 注册时间
- 2009-7-6
- 回帖
- 13338
   
|
发表于 2018-8-8 20:11:20
|
显示全部楼层
随便照着乱糊了一个,用法和之前一样,参考脚本开头写的格式继续写就可以了。
[pre lang="ruby"]#==============================================================================
# 本脚本来自rpg.blue,转载、使用请保留此信息
#==============================================================================
module Fux2
MenuPicInfo = Struct.new(:fn,:x,:y,:opacity)
PicList = {}
# 格式 MenuPicInfo.new("图片名",x,y,opa),坐标和透明度可选
# 坐标不填默认0,不透明度不填默认255
PicList[1] = [
MenuPicInfo.new("变量1为0时文件名",100,100),
MenuPicInfo.new("变量1为1时文件名",300,100)
]
PicList[2] = [
MenuPicInfo.new("变量2为0时文件名",100,300),
MenuPicInfo.new("变量2为1时文件名",300,300,180),
MenuPicInfo.new("变量2为2时文件名",300,300)
]
end
class Scene_Menu
alias _fux_start start
def start
_fux_start
create_menu_picture
end
def create_menu_picture
@backSprites = []
Fux2::PicList.keys.sort.each do |key|
value = $game_variables[key]
next if value<0
info = Fux2::PicList[key][value]
spr = Sprite.new
spr.bitmap = Cache.picture(info.fn)
spr.x,spr.y = info.x || 0,info.y || 0
spr.opacity = info.opacity || 255
@backSprites << spr
end
end
alias _fux_terminate terminate
def terminate
_fux_terminate
@backSprites && @backSprites.each{|spr| spr.dispose}
end
end
[/pre] |
|