Últimos temas
» [MV] ¿Cómo mover un sprite?
por Frägarach Hoy a las 2:19 am

» Como cambio esto?...
por Shy_Cream Hoy a las 2:09 am

» El Dia Z - Demo
por EdwarPlay Ayer a las 8:08 pm

» Pokemon Destiny
por Greninja555 Ayer a las 5:46 pm

» Animación Habilidad de Enemigos RPGMAKER VX ACE
por Metatron Ayer a las 3:16 am

» [VX] Cambio de Resolución
por luistop12 Vie Sep 13, 2019 6:51 am

» ¿Como Mover al jugador mientras hay una conversación?
por Zachy Vie Sep 13, 2019 2:05 am

» ¿Como hacer un menú/Galería de imágenes? (RPG VxAce)
por ZororoWhite Jue Sep 12, 2019 7:57 pm

» Inherited Sins [Juego Completo] [Definitive Edition]
por Nina Jue Sep 12, 2019 7:47 pm

» Zaza no konpasu (La Brújula de Zaza) [VXACE]
por Pocari Sáb Sep 07, 2019 12:28 pm

» Ayuda con el ABS
por DarkarPro0102 Sáb Sep 07, 2019 8:32 am

» Pop! Horror City Complementos
por EdwarPlay Jue Sep 05, 2019 10:59 pm


[VX] Mini Mapa

Ir abajo

[VX] Mini Mapa Empty [VX] Mini Mapa

Mensaje por KRiZaLiD el Lun Mar 10, 2014 2:46 pm

Script de mini mapa.
Si quieren que el  "mini mapa" se vea en varios de sus mapas lo escriben en la linea 27:
OnMap = [13,30,31]
siendo 13, 30 y 31 los ID de sus mapas.

IMAGEN:
[VX] Mini Mapa HlQDVLV

Código:
=begin ************************************************************************
Ÿ ƒtƒB[ƒ‹ƒhƒ}ƒbƒv‚Ì•\Ž¦ Ver1.61
--------------------------------------------------------------------------
<Žg—p•û–@> ¨ ¥ Ý’è ‚Ìu•\Ž¦‚·‚éƒ}ƒbƒvIDv‚Öƒ}ƒbƒvID‚ð‹L“ü‚·‚é
<ƒ|ƒCƒ“ƒg> ¨ ƒCƒxƒ“ƒg‚̃XƒNƒŠƒvƒg‚Ö‰ºƒRƒ}ƒ“ƒh‚ð‹L“ü

FiMark.add_mark(XÀ•W, YÀ•W, ƒ}ƒbƒvID) # ƒ|ƒCƒ“ƒg’ljÁ
FiMark.add_mark(XÀ•W, YÀ•W) # V (Œ»Ý‚̃}ƒbƒv)
FiMark.add_mark # V (Œ»Ý’n)

FiMark.remove_mark(XÀ•W, YÀ•W, ƒ}ƒbƒvID) # ƒ|ƒCƒ“ƒgíœ
FiMark.remove_mark(XÀ•W, YÀ•W) # V (Œ»Ý‚̃}ƒbƒv)
FiMark.remove_mark # V (Œ»Ý’n)

FiMark.clear_mark(ƒ}ƒbƒvID) # ƒ}ƒbƒv“àíœ
FiMark.clear_mark # V (Œ»Ý‚̃}ƒbƒv)

¦ ƒ}ƒbƒv‚ցuŠX‚̈ʒu‚Ì–Úˆó‚ð‚‚¯‚év‚È‚Ç‚ª‚Å‚«‚Ü‚·
¦ ˆ—‚ªd‚­‚Ȃ邽‚߁A•À—ñˆ—‚É‚æ‚è•t‚¯‚½‚èÁ‚µ‚½‚肵‚È‚¢‚Å‚­‚¾‚³‚¢

—á) ƒ}ƒbƒvID 2AXÀ•W 9AYÀ•W32 ‚ð’ljÁ ¨ FiMark.add_mark(9, 32, 2)
=end # ************************************************************************

module FiMark

# ¥ Ý’è
OnMap = [13,30,31] # "el interruptor numero 1 es el que se debe activar para ver el mapa "
NZoom = 1.5 # zoom del mapa
OnSwi = 0 # •\Ž¦Ø‚è‘Ö‚¦ƒXƒCƒbƒ`ID (0‚ŏí‚É•\Ž¦)
CX , CY = 544 , 416 #posicion del mapa en la pantalla
Spa = 4 # —]”’ (’[‚̂͂ݏo‚µ‚ð‹­§‚·‚é”͈Í)

# ¥ F ( Ô , —Î , Â , “§–¾“x ) 0 ` 255 ‚͈̔͂Őݒè
Land = Color.new(160, 160, 160, 144) # —¤’n
Sea = Color.new( 0, 0, 0, 144) # ŠC
OffS = Color.new( 32, 32, 32, 144) # ŠC (ó)
Mtn = Color.new( 96, 96, 96, 144) # ŽR
Now = Color.new(255, 128, 0, 255) # Œ»Ý’n

# ¤ Ú×Ý’è (’†‹‰)
LoMap = [] # ‚ ‚ç‚©‚¶‚ߓǂݍž‚Þƒ}ƒbƒv (ƒ}ƒbƒv“ǂݏo‚µ‚ð‘f‘‚­)
MZoom = {} # ƒ}ƒbƒv‚²‚Æ‚ÌŠg‘å—¦‚ðŒˆ‚ß‚é ( ID=>Šg‘å—¦, )

# ¦ ƒ}ƒbƒv‚ð“ǂݍž‚ÞŽž‚É’x‚¢‚ÆŠ´‚¶‚½‚çA‚»‚̃}ƒbƒvID‚ð LoMap ‚Ì’†‚É“ü‚ê‚Ü‚·
# ¦ ‰æ‘œ‚́A‰æ–Ê‚ÌŠO‚ɂ͂͂ݏo‚³‚È‚¢—l‚ɐݒ肳‚ê‚Ä‚¢‚Ü‚·

# ¥ Ý’è2 (Ver1.50‚æ‚è)
Point = Color.new(255, 255, 96, 255) # F ƒ|ƒCƒ“ƒg
end

#-mymemo-----------------------------------------------------------------------
# ŠC‚Í ˆê‘w–ڂ̃^ƒCƒ‹ID ‚ª‘S‚Ä“¯‚¶ (“ñ‘w–ڂŃ^ƒCƒ‹”»•Ê)
# ŽR‚Í “ñ‘w–ڂ̃ŒƒCƒ„[ ‚Ƀ^ƒCƒ‹”ԍ†‚ªÚ‚Á‚Ä‚¢‚é (ˆê‘w–ڂ̏°‚ª“¯‚¶¶’n)
# ì¬‚·‚é‰æ‘œ‚ð•ÏX‚·‚é‚Æ‚«‚́ACache ‚Ì create_map(map_id) ‚ð•ÏX
#------------------------------------------------------------------------------

#==============================================================================
# ¡ FiMark
#==============================================================================

module FiMark
#--------------------------------------------------------------------------
# œ ’萔
#--------------------------------------------------------------------------

# ¥ ƒ}ƒbƒvƒ|ƒCƒ“ƒg‚̐F (Ver1.70‚æ‚è)
ColorS = { # F”ԍ†=>Color.new( Ô , —Î , Â , “§–¾“x )
1=>Point, # ¦ "F ƒ|ƒCƒ“ƒg" ‚ð—¬—p
2=>Color.new( 96, 255, 255, 255),
3=>Color.new(255, 0, 0, 255),
}
# FiMark.set_mark(F”ԍ†, XÀ•W, YÀ•W, ƒ}ƒbƒvID) # ƒ|ƒCƒ“ƒgÝ’è
# FiMark.set_mark(F”ԍ†, XÀ•W, YÀ•W) # V (Œ»Ý‚̃}ƒbƒv)
# FiMark.set_mark(F”ԍ†) # V (Œ»Ý’n)

#--------------------------------------------------------------------------
# œ “Á’èƒ}ƒbƒv‚ðƒNƒŠƒA
#--------------------------------------------------------------------------
def self.clear_mark(map_id = $game_map.map_id)
$game_map.fimark_points.mark_clear(map_id)
$game_temp.zii_fimark_point_flag = true
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ðÝ’è
#--------------------------------------------------------------------------
def self.set_mark(type, x = nil, y = nil, map_id = $game_map.map_id)
x = $game_player.x if x.nil?
y = $game_player.y if y.nil?
$game_map.fimark_points.set_mark(type, map_id, x, y)
$game_temp.zii_fimark_point_flag = true
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ð’ljÁ
#--------------------------------------------------------------------------
def self.add_mark(x = nil, y = nil, map_id = $game_map.map_id)
x = $game_player.x if x.nil?
y = $game_player.y if y.nil?
$game_map.fimark_points.add_mark(map_id, x, y)
$game_temp.zii_fimark_point_flag = true
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ðŠO‚·
#--------------------------------------------------------------------------
def self.remove_mark(x = nil, y = nil, map_id = $game_map.map_id)
x = $game_player.x if x.nil?
y = $game_player.y if y.nil?
$game_map.fimark_points.remove_mark(map_id, x, y)
$game_temp.zii_fimark_point_flag = true
end
end

#==============================================================================
# ¡ Cache
#==============================================================================

module Cache
#--------------------------------------------------------------------------
# œ ’萔
#--------------------------------------------------------------------------
MtnIndex = [18, 26, 34, 42] # ŽR‚̃Cƒ“ƒfƒbƒNƒX
#--------------------------------------------------------------------------
# œ ƒQ[ƒ€ŠJŽnŽž‚̐ݒè
#--------------------------------------------------------------------------
def self.start_up_by_fimark
for i in FiMark::LoMap do self.load_map(i) end # •\Ž¦‚·‚éƒ}ƒbƒv‚ðì¬
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv ƒrƒbƒgƒ}ƒbƒv ‚̍쐬
# map_id : ƒ}ƒbƒv ID
#--------------------------------------------------------------------------
def self.create_map(map_id)
map = load_data(sprintf("Data/Map%03d.rvdata", map_id))
bitmap = Bitmap.new(map.width, map.height)
for y in 0...map.height
for x in 0...map.width
tile1 = map.data[x, y, 0]
tile2 = map.data[x, y, 1]
# ŠC (ƒ^ƒCƒ‹A : ƒCƒ“ƒfƒbƒNƒX1 : ‰º‘wƒŒƒCƒ„[)
if Zii.tile_info(tile1) == [0, 0]
if Zii.tile_number(tile2) == 1
bitmap.set_pixel(x, y, FiMark::Sea)
else # ó‚¢ŠC
bitmap.set_pixel(x, y, FiMark::OffS)
end
# ŽR (ƒ^ƒCƒ‹A : ’萔ƒCƒ“ƒfƒbƒNƒX : ’†‘wƒŒƒCƒ„[)
elsif (MtnIndex.include?(Zii.tile_number(tile2)) and
Zii.tile_type(tile2) == 0)
bitmap.set_pixel(x, y, FiMark::Mtn)
# —¤’n (‚»‚Ì‘¼)
else
bitmap.set_pixel(x, y, FiMark::Land)
end
end
end
return bitmap
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv ƒrƒbƒgƒ}ƒbƒv ‚̓ǂݍž‚Ý
# map_id : ƒ}ƒbƒv ID
#--------------------------------------------------------------------------
def self.load_map(map_id)
@cache = {} if @cache == nil
path = "ZiiFieldMap/" + map_id.to_s
if not @cache.include?(path) or @cache[path].disposed?
if map_id <= 0
@cache[path] = Bitmap.new(32, 32)
else
@cache[path] = self.create_map(map_id)
end
end
return @cache[path]
end
end

#******************************************************************************
# š ƒ^ƒCƒ‹ƒf[ƒ^‚̉ðÍ (»ì—p)
#******************************************************************************

module Zii # Ver2.00
#--------------------------------------------------------------------------
# œ ƒ^ƒCƒ‹ˆÃ† ‚̎擾 (”z—ñ)
# type : °‚ÌŽí—Þ (0`4 : A`E)
# index : ƒ^ƒCƒ‹”ԍ†
#--------------------------------------------------------------------------
def self.tile_data(type, index)
return [] if type == nil
return [] if index == nil
if type == 0 # Aƒ^ƒCƒ‹
if index < 128
result = []
for i in 0...48
result.push(i + index * 48 + 2048)
end
return result
else # ƒp[ƒc5 ‚̏ꍇ
return [index + 1408]
end
else # Bƒ^ƒCƒ‹ˆÈ~
return [(type - 1) * 256 + index]
end
end
#--------------------------------------------------------------------------
# œ ƒ^ƒCƒ‹ƒ^ƒCƒv ‚̎擾
# data : ƒ^ƒCƒ‹ˆÃ†
#--------------------------------------------------------------------------
def self.tile_type(data)
return nil if data == nil
if data >= 1280 # Aƒ^ƒCƒ‹ (0)
return 0
else # Bƒ^ƒCƒ‹ ˆÈ~ (1..)
return (data / 256 + 1)
end
end
#--------------------------------------------------------------------------
# œ ƒ^ƒCƒ‹”ԍ† ‚̎擾
# data : ƒ^ƒCƒ‹ˆÃ†
#--------------------------------------------------------------------------
def self.tile_number(data)
return nil if data == nil
if data >= 1280 # Aƒ^ƒCƒ‹
if data >= 2048
return (data - 2048) / 48
else # ƒp[ƒc5 ‚̏ꍇ
return (data - 1408)
end
else # Bƒ^ƒCƒ‹ ˆÈ~
return (data % 256)
end
end
#--------------------------------------------------------------------------
# œ ƒ^ƒCƒ‹ƒ^ƒCƒv ‚̎擾
# data : ƒ^ƒCƒ‹ˆÃ†
#--------------------------------------------------------------------------
def self.tile_info(data)
return [self.tile_type(data), self.tile_number(data)]
end
end

#******************************************************************************
# š ƒV[ƒ“‚̍쐬
#******************************************************************************

#==============================================================================
# ¡ Game_Temp
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :zii_fimark_point_flag # ƒ}ƒbƒvƒ|ƒCƒ“ƒgÄÝ’èƒtƒ‰ƒO
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias :zii_fimark_temp_initialize :initialize
def initialize
zii_fimark_temp_initialize
@zii_fimark_point_flag = false
end
end

#==============================================================================
# ¡ Game_System
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ‚̉Ž‹”»’è
#--------------------------------------------------------------------------
def fieldmap_visible?
return true unless FiMark::OnSwi > 0
return $game_switches[FiMark::OnSwi]
end
end

#==============================================================================
# ¡ Game_Map
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias :zii_fimark_map_initialize :initialize
def initialize
@fimark_points = Game_FieldMarkPoint.new(self)
zii_fimark_map_initialize
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒvƒ|ƒCƒ“ƒg‚̎擾
#--------------------------------------------------------------------------
def fimark_points
@fimark_points = Game_FieldMarkPoint.new(self) if @fimark_points == nil
return @fimark_points
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ ’†S‚Ì X À•WŽæ“¾
#--------------------------------------------------------------------------
def fieldmark_cx
return FiMark::CX
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ ’†S‚Ì Y À•WŽæ“¾
#--------------------------------------------------------------------------
def fieldmark_cy
return FiMark::CY
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ Šg‘å—¦‚̎擾
#--------------------------------------------------------------------------
def fieldmark_zoom
if FiMark::MZoom.include?(@map_id)
return FiMark::MZoom[@map_id]
end
return FiMark::NZoom
end
end

#==============================================================================
# ¡ Game_FieldMarkPoint
#------------------------------------------------------------------------------
# @ƒ}ƒbƒv‚̃|ƒCƒ“ƒg‚ðŠÇ—‚·‚éƒNƒ‰ƒX‚Å‚·BGame_Map ƒNƒ‰ƒX‚Ì“à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================

class Game_FieldMarkPoint
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_reader :data # ƒ}[ƒNƒf[ƒ^ ƒnƒbƒVƒ…
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize(map)
@map = map
@data = {}
end
#--------------------------------------------------------------------------
# œ î•ñ‚̃NƒŠƒA
#--------------------------------------------------------------------------
def clear
@data = {}
end
#--------------------------------------------------------------------------
# œ “Á’èƒ}ƒbƒv‚̃NƒŠƒA
#--------------------------------------------------------------------------
def mark_clear(map_id)
@data.delete(map_id)
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒLƒ“ƒOî•ñ‚̎擾
# map_id : Žæ“¾‚·‚éƒ}ƒbƒv‚Ì ID
# resize : ƒ}ƒbƒvƒf[ƒ^‚Ì‘å‚«‚³‚ð•ÏX‚·‚é‚©H
#--------------------------------------------------------------------------
def marking(map_id, resize = false)
if not @data.has_key?(map_id)
map = load_data(sprintf("Data/Map%03d.rvdata", map_id))
@data[map_id] = Table.new(map.width, map.height)
elsif resize
map = load_data(sprintf("Data/Map%03d.rvdata", map_id))
@data[map_id].resize(map.width, map.height)
end
return @data[map_id]
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ðÝ’è
#--------------------------------------------------------------------------
def set_mark(type, map_id, x, y)
mark = marking(map_id)
mark[x, y] = type
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ð’ljÁ
#--------------------------------------------------------------------------
def add_mark(map_id, x, y)
mark = marking(map_id)
mark[x, y] = 1
end
#--------------------------------------------------------------------------
# œ ƒ}[ƒN‚ðŠO‚·
#--------------------------------------------------------------------------
def remove_mark(map_id, x, y)
mark = marking(map_id)
mark[x, y] = 0
end
end

#==============================================================================
# ¡ Sprite_ZiiFiMarkMap
#------------------------------------------------------------------------------
# ƒ}ƒbƒv‰æ‘œ‚ð•\Ž¦‚·‚éƒXƒvƒ‰ƒCƒg‚̃Nƒ‰ƒX‚Å‚·B
#==============================================================================

class Sprite_ZiiFiMarkMap < Sprite
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# viewport : ƒrƒ…[ƒ|[ƒg
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
create_graphic
end
#--------------------------------------------------------------------------
# œ ‰æ‘œ‚̍쐬
#--------------------------------------------------------------------------
def create_graphic
self.bitmap = Cache.load_map($game_map.map_id)
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
super
update_map
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ}ƒbƒv)
#--------------------------------------------------------------------------
def update_map
change = (@fieldmark_zoom != $game_map.fieldmark_zoom)
$game_temp.zii_fimark_point_flag = true if change
if (change or @fieldmark_cx != $game_map.fieldmark_cx or
@fieldmark_cy != $game_map.fieldmark_cy)
@fieldmark_zoom = $game_map.fieldmark_zoom
@fieldmark_cx = $game_map.fieldmark_cx
@fieldmark_cy = $game_map.fieldmark_cy
move_setting
end
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ‚Ì’²ß
#--------------------------------------------------------------------------
def move_setting
cx , cy = @fieldmark_cx , @fieldmark_cy
width = self.width * @fieldmark_zoom
height = self.height * @fieldmark_zoom
self.x = cx - width / 2
self.y = cy - height / 2
# X À•W‚̈ʒu‚¸‚êC³
if self.x < FiMark::Spa
self.x = FiMark::Spa
elsif self.x + width > 544 - FiMark::Spa
self.x = 544 - FiMark::Spa - width
end
# Y À•W‚̈ʒu‚¸‚êC³
if self.y < FiMark::Spa
self.y = FiMark::Spa
elsif self.y + height > 416 - FiMark::Spa
self.y = 416 - FiMark::Spa - height
end
self.zoom_x = @fieldmark_zoom
self.zoom_y = @fieldmark_zoom
end
end

#==============================================================================
# ¡ Sprite_ZiiFiMarkPlayer
#------------------------------------------------------------------------------
# ƒ}ƒbƒv‚ŃvƒŒƒCƒ„[‚ð•\Ž¦‚·‚éƒXƒvƒ‰ƒCƒg‚̃Nƒ‰ƒX‚Å‚·B
#==============================================================================

class Sprite_ZiiFiMarkPlayer < Sprite
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# field_map : ƒ}ƒbƒv‰æ‘œ
# viewport : ƒrƒ…[ƒ|[ƒg
#--------------------------------------------------------------------------
def initialize(field_mark, viewport = nil)
super(viewport)
@field_mark = field_mark
create_graphic
end
#--------------------------------------------------------------------------
# œ ‰æ‘œ‚̍쐬
#--------------------------------------------------------------------------
def create_graphic
self.bitmap = Bitmap.new(3, 3)
self.bitmap.fill_rect(0, 0, 3, 3, FiMark::Now)
self.ox = self.width / 2
self.oy = self.height / 2
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
super
self.x = @field_mark.x + $game_player.x * $game_map.fieldmark_zoom
self.y = @field_mark.y + $game_player.y * $game_map.fieldmark_zoom
end
end

#==============================================================================
# ¡ Sprite_ZiiFiMarkPoint
#------------------------------------------------------------------------------
# ƒ}ƒbƒv‚Ń|ƒCƒ“ƒg‚ð•\Ž¦‚·‚éƒXƒvƒ‰ƒCƒg‚̃Nƒ‰ƒX‚Å‚·B
#==============================================================================

class Sprite_ZiiFiMarkPoint < Sprite
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# field_map : ƒ}ƒbƒv‰æ‘œ
# viewport : ƒrƒ…[ƒ|[ƒg
#--------------------------------------------------------------------------
def initialize(field_mark, viewport = nil)
super(viewport)
$game_map.fimark_points.marking($game_map.map_id, true) # ¦ƒŠƒTƒCƒY
@field_mark = field_mark
@effect_count = 0
create_graphic
end
#--------------------------------------------------------------------------
# œ ‰æ‘œ‚̍쐬
#--------------------------------------------------------------------------
def create_graphic
mark = $game_map.fimark_points.marking($game_map.map_id) # ƒf[ƒ^ Žæ“¾
width = @field_mark.width * $game_map.fieldmark_zoom # ‰¡• Žæ“¾
height = @field_mark.height * $game_map.fieldmark_zoom # ‚‚³ Žæ“¾
self.bitmap = Bitmap.new(width, height) # Bitmap ì¬
for y in 0...mark.ysize # YÀ•Wƒ‹[ƒv
for x in 0...mark.xsize # XÀ•Wƒ‹[ƒv
next if mark[x, y] == 0 # •`‰æ‚·‚é‚©H
draw_mark_point(x, y, mark[x, y])
end
end
end
#--------------------------------------------------------------------------
# œ ƒ|ƒCƒ“ƒg•`‰æ
# ox , oy : •\Ž¦À•W , type : •\Ž¦Ží—Þ
#--------------------------------------------------------------------------
def draw_mark_point(ox, oy, type)
x , y = ox * $game_map.fieldmark_zoom , oy * $game_map.fieldmark_zoom
color = FiMark::ColorS[type]
self.bitmap.set_pixel(x-1, y, color)
self.bitmap.set_pixel(x, y-1, color)
self.bitmap.set_pixel(x+1, y, color)
self.bitmap.set_pixel(x, y+1, color)
self.bitmap.set_pixel(x, y, color)
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
super
update_points
update_effect
self.x = @field_mark.x
self.y = @field_mark.y
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ|ƒCƒ“ƒg)
#--------------------------------------------------------------------------
def update_points
return unless $game_temp.zii_fimark_point_flag # V‚µ‚­‚·‚é‚©H
$game_temp.zii_fimark_point_flag = false # ƒtƒ‰ƒO‚ð‰ðœ
self.bitmap.dispose # ƒrƒbƒgƒ}ƒbƒv‰ð•ú
create_graphic # ‰æ‘œì¬
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒGƒtƒFƒNƒg)
#--------------------------------------------------------------------------
def update_effect
@effect_count += 1
@effect_count = 0 if @effect_count > 80
self.opacity = (255 - @effect_count * 3)
end
end

#==============================================================================
# ¡ Spriteset_Map
#==============================================================================

class Spriteset_Map
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
alias :zii_fimark_initialize :initialize
def initialize
create_fieldmark
zii_fimark_initialize
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
alias :zii_fimark_dispose :dispose
def dispose
dispose_fieldmark
zii_fimark_dispose
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
alias :zii_fimark_update :update
def update
zii_fimark_update
update_fieldmark
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ‚̍쐬
#--------------------------------------------------------------------------
def create_fieldmark
return unless FiMark::OnMap.include?($game_map.map_id)
@mark_view = Viewport.new(0, 0, 544, 416)
@mark_view.z = 80
@field_mark = Sprite_ZiiFiMarkMap.new(@mark_view)
@fimark_player = Sprite_ZiiFiMarkPlayer.new(@field_mark, @mark_view)
@fimark_points = Sprite_ZiiFiMarkPoint.new(@field_mark, @mark_view)
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ‚̉ð•ú
#--------------------------------------------------------------------------
def dispose_fieldmark
if @fimark_points != nil
@fimark_points.dispose
end
if @fimark_player != nil
@fimark_player.dispose
end
if @field_mark != nil
@field_mark.dispose
end
if @mark_view != nil
@mark_view.dispose
end
end
#--------------------------------------------------------------------------
# œ ƒ}ƒbƒv‰æ‘œ‚̍XV (¦ ƒ}ƒbƒv¨ƒvƒŒƒCƒ„[Eƒ|ƒCƒ“ƒg‚̏‡‚É!)
#--------------------------------------------------------------------------
def update_fieldmark
return if @field_mark == nil
@mark_view.visible = $game_system.fieldmap_visible?
@field_mark.update
@fimark_player.update if @fimark_player != nil
@fimark_points.update if @fimark_points != nil
end
end

#******************************************************************************
# š ‰Šúˆ—
#******************************************************************************

# œ ‹N“®Žž‚Ƀ}ƒbƒv‰æ‘œ‚ðì¬
Cache.start_up_by_fimark
No se a quien darle los créditos.
espero les sirva, mis saludos

se despide KRiZ
KRiZaLiD
KRiZaLiD
Moderador
Moderador

Masculino
Chile
RPG Maker : Vx
Mensajes : 856
Monedas : 4331
Reputación : 110
Edad : 34
Localización : Florida (pueblo fantasma), Chile

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.