RPG maker VX


Unirse al foro, es rápido y fácil

RPG maker VX
RPG maker VX
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Últimos temas
» Script de menu
por maxi Jue 04 Dic 2014, 1:44 pm

» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm

» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am

» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am

» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm

» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm

» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am

» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am

» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am

» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am

» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am

» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm

» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am

» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am

» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm

¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado

Ninguno

[ Ver toda la lista ]


El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm

[Aporte]Script Nombre en Mapa[VX]

Ir abajo

[Aporte]Script Nombre en Mapa[VX] Empty [Aporte]Script Nombre en Mapa[VX]

Mensaje por luistop12 Mar 23 Oct 2012, 12:29 pm

este script te permite mostrar el nombre de el lugar en el que estas en el mapa


¿lo puedo esconder?
sip, simplemente pone llamar evento
hide_location_name [para esconder]
show_location_name [para mostrar]

Código:
#===============================================================================
#
# Shanghai Simple Script - Location Name
# Last Date Updated: 2010.05.21
# Level: Easy
#
# This places a small window in the upper left corner of the map screen to show
# the name of the current location. The location name window will also hide if
# the player's screen position is directly under the location name window.
# This will also update to the area's name if the player is inside of an area.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# These commands go into the script call event.
#  hide_location_name
#  show_location_name
# They do exactly as they suggest.
#===============================================================================
 
$imported = {} if $imported == nil
$imported["LocationName"] = true
 
module SSS
  # This adjusts the backsprite used for the location background text.
  LOCATION_COLOR1 = Color.new(0, 0, 0, 128)
  LOCATION_COLOR2 = Color.new(0, 0, 0, 0)
  LOCATION_PREFIX = "◆%s"
end
 
#==============================================================================
# ** Game_System
#==============================================================================
 
class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :hide_location_name
end
 
#===============================================================================
# ** Game_Map
#===============================================================================
 
class Game_Map
  #--------------------------------------------------------------------------
  # * Location Name
  #--------------------------------------------------------------------------
  def location_name
    data = load_data("Data/MapInfos.rvdata")
    text = data[@map_id].name.gsub(/\[.*\]/) { "" }
    for area in $data_areas.values
      next unless $game_player.in_area?(area)
      text = area.name.gsub(/\[.*\]/) { "" }
      break
    end
    return text
  end
end
 
#==============================================================================
# ** Game_Interpreter
#==============================================================================
 
class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Hide Location Name
  #--------------------------------------------------------------------------
  def hide_location_name
    $game_system.hide_location_name = true
  end
  #--------------------------------------------------------------------------
  # * Show Location Name
  #--------------------------------------------------------------------------
  def show_location_name
    $game_system.hide_location_name = false
  end
end
 
#==============================================================================
# ** Window_LocationName
#==============================================================================
 
class Window_LocationName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width/2, 56)
    self.back_opacity = 0
    self.opacity = 0
    create_location_color_sprite
    @location_name = $game_map.location_name
    refresh
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    @background_color_sprite.bitmap.dispose
    @background_color_sprite.dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Create Location Color Sprite
  #--------------------------------------------------------------------------
  def create_location_color_sprite
    bitmap = Bitmap.new(Graphics.width/2, 24)
    g1 = SSS::LOCATION_COLOR1
    g2 = SSS::LOCATION_COLOR2
    bitmap.gradient_fill_rect(0, 0, Graphics.width/4, 24, g1, g1)
    bitmap.gradient_fill_rect(Graphics.width/4, 0, Graphics.width/4, 24, g1, g2)
    @background_color_sprite = Sprite.new(self.viewport)
    @background_color_sprite.bitmap = bitmap
    @background_color_sprite.y = 16
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @background_color_sprite.update
    rate = hide_sprite? ? -16 : 16
    @background_color_sprite.opacity += rate
    refresh if @location_name != $game_map.location_name
  end
  #--------------------------------------------------------------------------
  # * Hide Sprite?
  #--------------------------------------------------------------------------
  def hide_sprite?
    return true if $game_system.hide_location_name
    if $game_player.screen_x < Graphics.width/3 and $game_player.screen_y <= 60
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @location_name = $game_map.location_name
    t = sprintf(SSS::LOCATION_PREFIX, @location_name)
    @background_color_sprite.bitmap.dispose
    create_location_color_sprite
    @background_color_sprite.bitmap.draw_text(16, 0, contents.width, WLH, t)
  end
end
 
#==============================================================================
# ** Scene_Map
#==============================================================================
 
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias start_sss_location_name start unless $@
  def start
    start_sss_location_name
    @location_window = Window_LocationName.new
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias terminate_sss_location_name terminate unless $@
  def terminate
    @location_window.dispose
    terminate_sss_location_name
  end
  #--------------------------------------------------------------------------
  # * Basic Update Processing
  #--------------------------------------------------------------------------
  alias update_basic_sss_location_name update_basic unless $@
  def update_basic
    update_basic_sss_location_name
    @location_window.update
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias update_sss_location_name update unless $@
  def update
    update_sss_location_name
    @location_window.update
  end
end
 
#===============================================================================
#
# END OF FILE
#
#===============================================================================

CREDITOS:POKETHOUSE
luistop12
luistop12
500
500

Masculino

Edad 33

Cantidad de envíos 759

Maker Cash 944

Reputación 42


Volver arriba Ir abajo

Volver arriba

- Temas similares

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