RPG_Maker_XP脚本显示小地图.doc_第1页
RPG_Maker_XP脚本显示小地图.doc_第2页
RPG_Maker_XP脚本显示小地图.doc_第3页
RPG_Maker_XP脚本显示小地图.doc_第4页
RPG_Maker_XP脚本显示小地图.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

#=# 本脚本来自www.66RPG.com,使用和转载请保留此信息#= #=# 縮小地图的表示(ver 0.999)# by clum-sea#=#=# 前期定义#=module PLAN_Map_Window WIN_X = 0 # 地图的 X 座標 WIN_Y =0 # 地图的 Y 座標 WIN_WIDTH = 8*32 # 地图的宽度 WIN_HEIGHT = 6*32 # 地图的高度 ZOOM = 4 # 地图的放缩比例 WINDOWSKIN = # 自定义地图窗口素材,如果留空则是默认的 ON_OFF_KEY = Input:A # 打开地图的按钮,A就是键盘的Z键 SWITCH = 99 # 禁用地图功能的开关,默认这个就是打开100号开关则禁止 # 使用地图功能,关闭则可以使用地图功能 WINDOW_MOVE = false # 窗口中的地图跟随移动,(true:跟随, false:固定) OVER_X = 632 - WIN_WIDTH # 移動后的 X 座標(初期位置往復) OVER_Y = 8 # 移動后的 Y 座標(初期位置往復) OPACITY = 50 # 窗口的透明度 C_OPACITY = 200 # 地图的透明度 VISIBLE = true # 最初是否可见end #=# Game_Temp#=class Game_Temp attr_accessor :map_visible # 地图的表示状態 alias plan_map_window_initialize initialize def initialize plan_map_window_initialize map_visible = true endend#=# Scene_Map#=class Scene_Map #- # 主处理 #- alias plan_map_window_main main def main map_window = Window_Map.new map_window.visible = $game_temp.map_visible plan_map_window_main map_window.dispose end #- # 更新 #- alias plan_map_window_update update def update $game_temp.map_visible = map_window.visible plan_map_window_update unless $game_switchesPLAN_Map_Window:SWITCH if Input.trigger?(PLAN_Map_Window:ON_OFF_KEY) if map_window.visible map_window.visible = false else map_window.visible = true end end else if map_window.visible map_window.visible = false end end if map_window.visible map_window.update end end #- # 场所移动的变化 #- alias plan_map_window_transfer_player transfer_player def transfer_player visible = map_window.visible map_window.visible = false plan_map_window_transfer_player map_window.dispose map_window = Window_Map.new map_window.visible = visible endend#=# Window_Map#=class Window_Map Window_Base #- # 初始化 #- def initialize x = PLAN_Map_Window:WIN_X y = PLAN_Map_Window:WIN_Y w = PLAN_Map_Window:WIN_WIDTH h = PLAN_Map_Window:WIN_HEIGHT super(x, y, w, h) unless PLAN_Map_Window:WINDOWSKIN.empty? self.windowskin = RPG:Cache.windowskin(PLAN_Map_Window:WINDOWSKIN) end self.contents = Bitmap.new(width - 32, height - 32) self.opacity = PLAN_Map_Window:OPACITY self.contents_opacity = PLAN_Map_Window:C_OPACITY map_data = $game_map.data tileset = RPG:Cache.tileset($game_map.tileset_name) autotiles = for i in 0.6 autotile_name = $game_map.autotile_namesi autotilesi = RPG:Cache.autotile(autotile_name) end old_real_x = $game_player.real_x old_real_y = $game_player.real_y all_map = make_all_map self.visible = PLAN_Map_Window:VISIBLE refresh end #- # 缩小图做成 #- def make_all_map all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32) for y in 0.$game_map.height for x in 0.$game_map.width for z in 0.3 tile_num = map_datax, y, z next if tile_num = nil if tile_num = 48 tile_num -= 48 src_rect = Rect.new(32, 2 * 32, 32, 32) all_map.blt(x * 32, y * 32, autotilestile_num / 48, src_rect) end else tile_num -= 384 src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32) all_map.blt(x * 32, y * 32, tileset, src_rect) end end end end w = ($game_map.width / PLAN_Map_Window:ZOOM) * 32 h = ($game_map.height / PLAN_Map_Window:ZOOM) * 32 ret_bitmap = Bitmap.new(w, h) src_rect = Rect.new(0, 0, all_map.width, all_map.height) dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height) ret_bitmap.stretch_blt(dest_rect, all_map, src_rect) all_map.dispose return ret_bitmap end #- # 刷新 #- def refresh self.contents.clear one_tile_size = 32 / PLAN_Map_Window:ZOOM x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2 y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2 x = x * one_tile_size / 128 y = y * one_tile_size / 128 half_width = self.contents.width * 128 / 2 rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size rev_x = 0 if all_map.width $game_player.real_x * one_tile_size rev_x = (half_width - $game_player.real_x * one_tile_size) / 128 x += rev_x elsif half_width rest_width rev_x = -(half_width - rest_width) / 128) x += rev_x end half_height = self.contents.height * 128 / 2 rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size rev_y = 0 if all_map.height $game_player.real_y * one_tile_size rev_y = (half_height - $game_player.real_y * one_tile_size) / 128 y += rev_y elsif half_height rest_height rev_y = -(half_height - rest_height) / 128) y += rev_y end src_rect = Rect.new(x, y, self.contents.width, self.contents.height) self.contents.blt(0, 0, all_map, src_rect) if PLAN_Map_Window:WINDOW_MOVE = true w = self.x.self.x + self.width h = self.y.self.y + self.height if w = $game_player.screen_x and h = $game_player.screen_y if self.x = PLAN_Map_Window:WIN_X and self.y = PLAN_Map_Window:WIN_Y self.x = PLAN_Map_Window:OVER_X self.y = PLAN_Map_Window:OVER_Y else self.x = PLAN_Map_Window:WIN_X self.y = PLAN_Map_Window:WIN_Y end end end if $game_party.actors.size 0 for i in 2, 1, 0 tile = map_data$game_player.x, $game_player.y, i next if tile = 0 return if $game_map.prioritiestile 0 end actor = $game_party.actors0 bitmap = RPG:Cache.character(actor.character_name, actor.character_hue) width = bitmap.width / 4 height = bitmap.height / 4 src_rect = Rect.new(0, 0, width, height) w = width / PLAN_Map_Window:ZOOM h = height / PLAN_Map_Window:ZOOM x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x y = self.contents.height / 2 - h / 2 - rev_y dest_rect = Rect.new(x, y, w, h) self.contents.stretch_blt(dest_rect, bitmap, src_rect)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论