| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-5-5 |
| 在线时间 | 182 小时 |
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 182 小时
- 注册时间
- 2009-4-22
- 回帖
- 153
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 gz29767562 于 2014-1-8 12:54 编辑
[pre lang="ruby" line="1"]#==============================================================================
# ★ ExMap_AutoPlane
#------------------------------------------------------------------------------
# 设定云、雾等显示在特定地图的脚本素材。
#==============================================================================
# 地图设定。
# 请按照 地图ID、文件名、横向回圈、纵向回圈、Z 坐标、
# 不透明度(0 ~ 255)、合成方式 (0:通常 1:加算 2:減算)的顺序填写
# 例如: 地图ID为、将图片「fog.png」半透明并且显示在一般图片下面
# 向左5向下2的速度回圈,那么就填写 => [5, "fog", 5, -2, 50, 128, 0]
EXMAP_ATPLN_MAPS = [
[0, "fog", -2, -1, 50, 30, 0],
[15,"fog",-1,-1,50,55,2],
[16,"fog",-1,-1,50,55,2],
[17,"fog",-1,-1,50,55,2],
[18,"fog",-1,-1,50,55,2],
# 设定文件目录。
# 指定雾图形文件位置 (Graphic/xxx/)
# 0:System 1:Parallaxes 2:Pictures 3:Animations
EXMAP_ATPLN_FOLDER = 1
#------------------------------------------------------------------------------
class Game_Map
alias _exmapln_setup setup
alias _exmapln_update update
alias _exmapln_set_display_pos set_display_pos
alias _exmapln_scroll_down scroll_down
alias _exmapln_scroll_left scroll_left
alias _exmapln_scroll_right scroll_right
alias _exmapln_scroll_up scroll_up
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数 (追加定義)
#--------------------------------------------------------------------------
attr_reader :fog # フォグデータ
#--------------------------------------------------------------------------
# ○ セットアップ (追加定義)
# map_id : マップ ID
#--------------------------------------------------------------------------
def setup(map_id)
_exmapln_setup(map_id)
setup_fog
end
#--------------------------------------------------------------------------
# ☆ フォグのセットアップ
#--------------------------------------------------------------------------
def setup_fog
@fog = [0, "", 0, 0, 50, 0, 0]
@fog_sx = 0
@fog_sy = 0
@fog_x = 0
@fog_y = 0
for data in EXMAP_ATPLN_MAPS
if @map_id == data[0]
@fog = data
@fog_sx = data[2]
@fog_sy = data[3]
break
end
end
end
#--------------------------------------------------------------------------
# ○ フレーム更新 (追加定義)
#--------------------------------------------------------------------------
def update
_exmapln_update
update_fog
end
#--------------------------------------------------------------------------
# ○ 表示位置の設定 (追加定義)
# x : 新しい表示 X 座標 (*256)
# y : 新しい表示 Y 座標 (*256)
#--------------------------------------------------------------------------
def set_display_pos(x, y)
_exmapln_set_display_pos(x, y)
@fog_x = x
@fog_y = y
end
#--------------------------------------------------------------------------
# ☆ フォグ表示 X 座標の計算
# bitmap : フォグビットマップ
#--------------------------------------------------------------------------
def calc_fog_x(bitmap)
return bitmap == nil ? 0 : @fog_x / 8
end
#--------------------------------------------------------------------------
# ☆ フォグ表示 Y 座標の計算
# bitmap : フォグビットマップ
#--------------------------------------------------------------------------
def calc_fog_y(bitmap)
return bitmap == nil ? 0 : @fog_y / 8
end
#--------------------------------------------------------------------------
# ○ 下にスクロール (追加定義)
# distance : スクロールする距離
#--------------------------------------------------------------------------
def scroll_down(distance)
last_y = @display_y
_exmapln_scroll_down(distance)
if loop_vertical?
@fog_y += distance
else
@fog_y += @display_y - last_y
end
end
#--------------------------------------------------------------------------
# ○ 左にスクロール (追加定義)
# distance : スクロールする距離
#--------------------------------------------------------------------------
def scroll_left(distance)
last_x = @display_x
_exmapln_scroll_left(distance)
if loop_horizontal?
@fog_x -= distance
else
@fog_x += @display_x - last_x
end
end
#--------------------------------------------------------------------------
# ○ 右にスクロール (追加定義)
# distance : スクロールする距離
#--------------------------------------------------------------------------
def scroll_right(distance)
last_x = @display_x
_exmapln_scroll_right(distance)
if loop_horizontal?
@fog_x += distance
else
@fog_x += @display_x - last_x
end
end
#--------------------------------------------------------------------------
# ○ 上にスクロール (追加定義)
# distance : スクロールする距離
#--------------------------------------------------------------------------
def scroll_up(distance)
last_y = @display_y
_exmapln_scroll_up(distance)
if @fog != nil
if loop_vertical?
@fog_y -= distance
else
@fog_y += @display_y - last_y
end
end
end
#--------------------------------------------------------------------------
# ☆ フォグの更新
#--------------------------------------------------------------------------
def update_fog
@fog_x += @fog_sx * 2
@fog_y += @fog_sy * 2
end
end
class Spriteset_Map
alias _exmapln_initialize initialize
alias _exmapln_dispose dispose
alias _exmapln_update update
#--------------------------------------------------------------------------
# ○ オブジェクト初期化 (追加定義)
#--------------------------------------------------------------------------
def initialize
create_fog
_exmapln_initialize
end
#--------------------------------------------------------------------------
# ☆ フォグの作成
#--------------------------------------------------------------------------
def create_fog
@fog = Plane.new
if $game_map.fog != nil
@fog.z = $game_map.fog[4]
@fog.opacity = $game_map.fog[5]
@fog.blend_type = $game_map.fog[6]
end
end
#--------------------------------------------------------------------------
# ○ 解放 (追加定義)
#--------------------------------------------------------------------------
def dispose
_exmapln_dispose
@fog.dispose
end
#--------------------------------------------------------------------------
# ○ フレーム更新 (追加定義)
#--------------------------------------------------------------------------
def update
_exmapln_update
update_fog
end
#--------------------------------------------------------------------------
# ☆ フォグの更新
#--------------------------------------------------------------------------
def update_fog
if @fog_name != $game_map.fog[1]
@fog_name = $game_map.fog[1]
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
case EXMAP_ATPLN_FOLDER
when 0
@fog.bitmap = Cache.system(@fog_name)
when 1
@fog.bitmap = Cache.parallax(@fog_name)
when 2
@fog.bitmap = Cache.picture(@fog_name)
when 3
@fog.bitmap = Cache.animation(@fog_name, 0)
end
end
Graphics.frame_reset
end
@fog.ox = $game_map.calc_fog_x(@fog.bitmap)
@fog.oy = $game_map.calc_fog_y(@fog.bitmap)
end
end
[/pre]
脚本我不会,觉得是不是改76行的啊?
谁能帮忙把这个脚本改成适合于1024X768分辨率的,谢谢
|
评分
-
查看全部评分
|