Project1
标题:
关于画面震动
[打印本页]
作者:
andyho777
时间:
2009-10-3 18:21
标题:
关于画面震动
RM里的画面震动效果都是横向震动的,
不知能不能将这修改成垂直...?
作者:
waya
时间:
2009-10-3 19:07
#==============================================================================
# ■ 真·地震 BY 亿万星辰@2005
#==============================================================================
# ■ Spriteset_Map
#------------------------------------------------------------------------------
# 处理地图画面活动块和元件的类。本类在
# Scene_Map 类的内部使用。
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 如果远景与当前情况不同
if @panorama_name != $game_map.panorama_name or
@panorama_hue != $game_map.panorama_hue
@panorama_name = $game_map.panorama_name
@panorama_hue = $game_map.panorama_hue
if @panorama.bitmap != nil
@panorama.bitmap.dispose
@panorama.bitmap = nil
end
if @panorama_name != ""
@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
end
Graphics.frame_reset
end
# 如果雾与当前的情况不同
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
# 刷新元件地图
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
# 刷新远景平面
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
# 刷新雾平面
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
# 刷新角色精灵光标
for sprite in @character_sprites
sprite.update
end
# 刷新天候图形
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.ox = $game_map.display_x / 4
@weather.oy = $game_map.display_y / 4
@weather.update
# 刷新图片
for sprite in @picture_sprites
sprite.update
end
# 刷新计时器精灵光标
@timer_sprite.update
# 设置画面的色调与震动位置
# @viewport1.tone = $game_screen.tone
# @viewport1.ox = (-1) ** rand(2) * $game_screen.shake
# @viewport1.oy = (-1) ** rand(2) * $game_screen.shake
#让图片也可以震动
@viewport2.tone = $game_screen.tone
@viewport2.ox = (-1) ** rand(2) * $game_screen.shake
@viewport2.oy = (-1) ** rand(2) * $game_screen.shake
# 设置画面的闪烁色
@viewport3.color = $game_screen.flash_color
# 刷新视图
@viewport1.update
@viewport2.update
@viewport3.update
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的活动块的类。本类在 Scene_Battle 类
# 的内部使用。
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新角色的活动块 (对应角色的替换)
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
# 如果战斗背景文件名与当下不同
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
# 刷新战斗者的精灵光标
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# 刷新天气图形
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# 刷新图片精灵光标
for sprite in @picture_sprites
sprite.update
end
# 刷新计时器精灵光标
@timer_sprite.update
# 设置画面的色调与震动位置
# @viewport1.tone = $game_screen.tone
# @viewport1.ox = (-1) ** rand(2) * $game_screen.shake
# @viewport1.oy = (-1) ** rand(2) * $game_screen.shake
#让图片也可以震动
@viewport2.tone = $game_screen.tone
@viewport2.ox = (-1) ** rand(2) * $game_screen.shake
@viewport2.oy = (-1) ** rand(2) * $game_screen.shake
# 设置画面的闪烁色
@viewport4.color = $game_screen.flash_color
# 刷新视图
@viewport1.update
@viewport2.update
@viewport4.update
end
end
复制代码
用这个更真实
作者:
andyho777
时间:
2009-10-3 21:49
请问这个是怎用的? :(
作者:
zjx2005
时间:
2009-10-3 22:30
这东西修改的MS那S什么什么来着...显示有关的...
应该插在Main前面后事件里调用画面震动就行了....
可能.........................
作者:
enter9009
时间:
2009-10-4 00:19
对....可能....
爱打架
作者:
andyho777
时间:
2009-10-4 22:16
这个真的很棒 @@
但与我的RTAB战斗系统发生冲突了....
:'(:'(:'(:'(
作者:
waya
时间:
2009-10-5 01:49
把冲突地方写上来看看
作者:
andyho777
时间:
2009-10-5 17:10
他说跟我的RTAB战斗系统发生了 TypeError,nil can’t be coerced into Fixnum
应该是这里的问题....
#--------------------------------------------------------------------------
# ● スクリーンが画面外に出た時の補正処理
#--------------------------------------------------------------------------
def screen_over
width = @battleback_sprite.bitmap.width * @base_zoom * @target_zoom / 2
unless 324 + @target_x > width and 324 - @target_x > width
if 324 + @target_x > width
@target_x = width - 324
elsif 324 - @target_x > width
@target_x = 324 - width
end
end
height = @battleback_sprite.bitmap.height * @base_zoom * @target_zoom / 4
unless @target_y > height - 4 and 484 - @target_y > 3 * height
if @target_y > height - 4
@target_y = height - 4
elsif 484 - @target_y > 3 * height
@target_y = 484 - 3 * height
end
end
end
end
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1