赞 | 0 |
VIP | 1 |
好人卡 | 1 |
积分 | 1 |
经验 | 5112 |
最后登录 | 2017-9-18 |
在线时间 | 244 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 244 小时
- 注册时间
- 2010-6-19
- 帖子
- 95
|
- #==============================================================================
- # ■ 华丽镜头移动脚本 by 黑暗之神Kaiser.DS
- #------------------------------------------------------------------------------
- # 1-插入此段脚本到Main前面
- # 2-功能
- # a-[镜头平滑移动到事件/角色]
- # 在事件里的[设置移动路线]里选择需要镜头转向的角色输入脚本kds即可
- # b-[镜头跟随事件]
- # 在事件里的[设置移动路线]选择好需要跟随的事件后输入脚本kds_move_start开
- # 始跟随,当不想跟随时再输入kds_move_over
- #==============================================================================
- $平滑移动 = nil
- class Scene_Map
- alias kds_update update
- def update
- kds_update
- if $平滑移动 != nil
- cen_x = (320 - 16) * 4
- cen_y = (240 - 16) * 4
- max_x = ($game_map.width - 20) * 128
- max_y = ($game_map.height - 15) * 128
- display_x = [0, [$平滑移动.x * 128 - cen_x, max_x].min].max
- display_y = [0, [$平滑移动.y * 128 - cen_y, max_y].min].max
- if $game_map.display_x != display_x
- if ($game_map.display_x - display_x).abs < 22
- $game_map.display_x = display_x
- else
- $game_map.display_x += (display_x - $平滑移动.old_display_x)/8
- end
- end
- if $game_map.display_y != display_y
- if ($game_map.display_y - display_y).abs <= 22
- $game_map.display_y = display_y
- else
- $game_map.display_y += (display_y - $平滑移动.old_display_y)/8
- end
- end
- if $game_map.display_x == display_x and $game_map.display_y == display_y
- $平滑移动.center($平滑移动.x, $平滑移动.y)
- $平滑移动 = nil
- end
- return
- end
- end
- end
- class Game_Character
- CENTER_X = (320 - 16) * 4
- CENTER_Y = (240 - 16) * 4
- attr_accessor :old_display_x
- attr_accessor :old_display_y
- attr_accessor :kds_move
- def center(x, y)
- max_x = ($game_map.width - 20) * 128
- max_y = ($game_map.height - 15) * 128
- $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
- $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
- end
- def kds
- @old_display_x = $game_map.display_x
- @old_display_y = $game_map.display_y
- case @id
- when 0
- $平滑移动 = $game_player
- else
- $平滑移动 = $game_map.events[@id]
- end
- end
- def kds_move_start
- @kds_move = ""
- end
- def kds_move_over
- @kds_move = nil
- end
- alias kds_update update
- def update
- last_real_x = @real_x
- last_real_y = @real_y
- kds_update
- if @kds_move != nil
- if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
- $game_map.scroll_down(@real_y - last_real_y)
- end
- if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
- $game_map.scroll_left(last_real_x - @real_x)
- end
- if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
- $game_map.scroll_right(@real_x - last_real_x)
- end
- if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
- $game_map.scroll_up(last_real_y - @real_y)
- end
- end
- end
- end
- #==============================================================================
复制代码 用这个脚本。然后在事件页写上[attachimg]16**5[/attachimg]
就可以了 |
评分
-
查看全部评分
|