11-06-2009, 01:59 PM 
(This post was last modified: 09-02-2024, 05:46 PM by DerVVulfman.)
	
	
	
		Well loooking a nice map name show, i decided to make my own one, its full customizable and has a nice effect :P
This is the first script posted here ^^
Instructions
On the script
- to see the effect just teleport to another map(when you transfer the player the man name will work
- if you want to hide the name of some maps just add their ids to the variable DONT_SHOW_MAPS
(more instructions in the demo)
Screenshot
Script
  			
		
Demo
Are you serious? This don't need a demo...
Compatibility
SHOUD work with anything, just allieases three methods in scene_map
Termos & conditions
For non-comercial games only.
Giving credit it's not a must but its a nice act from your part ^^
See ya!
	
	
	This is the first script posted here ^^
Instructions
On the script
- to see the effect just teleport to another map(when you transfer the player the man name will work
- if you want to hide the name of some maps just add their ids to the variable DONT_SHOW_MAPS
(more instructions in the demo)
Screenshot
Script
 script
  			Code:
#===============================================================================
# SHOW THE MAP NAME - REVOLUTION MODE -
#------------------------------------------------------------------------------
# Author Ramiro (Holy_wyvern, ramiazul)
#------------------------------------------------------------------------------
# Version 1.0
#------------------------------------------------------------------------------
# Description:
# Allows you to show the name of some maps, whit a nice graphical style
#------------------------------------------------------------------------------
# Compatibility:
# RPG maker VX script.
# Shoud work with anyting (99.999 % sure)
#------------------------------------------------------------------------------
# Instructions:
# Insert on materials section
#
# To show the hero's name on a map or a variable
# \N[id of actor on database]         (1  -  999)
# \P[id of variable]                  (1  -  999)
# \PN[id of actor on party position]  (0  -    3)
# (Yes it's like the massage window...)
#------------------------------------------------------------------------------
# BUGS:
# Not now... Report if you found one
#------------------------------------------------------------------------------
# Author's notes:
# FOR non-Comertial games only. Giving credit it's not necesarry but it's nice :P
#===============================================================================
#===============================================================================
# Configurations
#===============================================================================
module MAPWINDOW
  
  VIEWING_TIME = 160                        # viewing time of letter
  LETTER_ANIM  = 200                        # starting animating time
  LETTER_END   = 20                         # time for hiding the name
  INIT_X       = 10                         # start X of first letter
  INIT_Y       = 10                         # start Y of first letter
  START_ANGLE  = -180                       # start angle of firs letter
  RECT_COLOR   = Color.new(255,255,255)     # The line's color
  RECT_X       = 0                          # the X correction of the rect
  RECT_Y       = -14                        # the Y correction
  FIRST_LETTER = Color.new(255,255,255)     # the first letter´s color
  LETTER_COLOR = Color.new(255,255,255,200) # other letter´s colors
  OPACITY      = 200                        # the letter´s opacity
  RECT_OPACITY = 255                        # opacity of the rect
  FONT_SIZE    = 25                         # the size of the font
  EX_START_X   = 0                          # X start movement
  RECT_HEIGHT  = 1                          # the height of the rect
  NOT_SHOW_MAPS= []                         # put map id of maps than don't show
                                            # it's name eg. [1,2,3]
end
#===============================================================================
# GAME MAP SETUP                                                
#===============================================================================
class Game_Map
  def name
    map_infos = load_data("Data/MapInfos.rvdata")
    name = map_infos[@map_id].name.clone
    name.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
    name.gsub!(/\\PN\[([0-9]+)\]/i) { $game_party.members[$1.to_i].name }
    name.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }  
 
    return name
  end
end
#===============================================================================
# The spritest of letters                                            
#===============================================================================
class Spriteset_MapName
  include MAPWINDOW
  def initialize
    @letters = []
    @index   = 0
    @finish_count = @dispose_count = 0
  end
  
  def set_sprites
   if !NOT_SHOW_MAPS.include?($game_map.map_id) 
    dispose_sprites
    @letters = []
    name = $game_map.name.scan(/./).clone
    @l_count = (LETTER_ANIM / name.size) + 1
    @index   = 0
    @finish = false
    @finish_count = VIEWING_TIME
    @dispose_count = LETTER_END
    
    for i in 0...name.size
       @letters[i] = Sprite.new
       @letters[i].bitmap = Bitmap.new(FONT_SIZE,FONT_SIZE)
       @letters[i].ox = 10
       @letters[i].oy = 10
       @letters[i].bitmap.font.size = FONT_SIZE
       @letters[i].bitmap.font.color = i == 0 ? FIRST_LETTER : LETTER_COLOR
       @letters[i].bitmap.draw_text(0,0,FONT_SIZE,FONT_SIZE,name[i],1)
       @letters[i].x = i * (FONT_SIZE / 2) + EX_START_X + INIT_X
       @letters[i].y = INIT_Y
       @letters[i].z = 9999
       @letters[i].opacity = 0
       @letters[i].angle = START_ANGLE
     end
    @b_count = @letters.size * ((LETTER_ANIM / @letters.size) + 1)
    @border = Sprite.new
    @border.bitmap = Bitmap.new(@letters.size * (FONT_SIZE / 2) + (FONT_SIZE / 2), RECT_HEIGHT)
    @border.bitmap.fill_rect(Rect.new(0,0,@letters.size * (FONT_SIZE / 2) + (FONT_SIZE / 2), RECT_HEIGHT),RECT_COLOR)
    @border.x = - @border.width + INIT_X - (FONT_SIZE / 2) - RECT_X
    @border.opacity = 0
    @border.y = INIT_Y + (FONT_SIZE ) + RECT_Y
  end
  end
  
  def update
    if !@finish
    if @letters[@index]
      if @l_count > 0
         @letters[@index].x = (@letters[@index].x * (@l_count - 1) + @index * (FONT_SIZE / 2) + INIT_X) / @l_count
         @letters[@index].opacity = (@letters[@index].opacity * (@l_count - 1) + OPACITY) / @l_count
         @letters[@index].angle = (@letters[@index].angle * (@l_count - 1)) / @l_count
         @l_count -= 1
         
         if @b_count > 0
           @border.x = (@border.x * (@b_count - 1) + INIT_X - (FONT_SIZE / 2) + RECT_X) / @b_count
           @border.opacity = (@border.opacity * (@b_count - 1) + RECT_OPACITY) / @b_count
           @b_count -= 1
         end
       else
         @index += 1
         @l_count = ((LETTER_ANIM / @letters.size) + 1)
       end 
    else
      @finish = true 
    end
    
  else
    if @finish_count > 0
      @finish_count -= 1
      return
    end  
    if @dispose_count > 0
    
      for i in 0...@letters.size
        @letters[i].x = (@letters[i].x * (@dispose_count - 1) + i * (FONT_SIZE / 2) + 24 + INIT_X) / @dispose_count
        @letters[i].opacity = (@letters[i].opacity * (@dispose_count - 1)) / @dispose_count
      end  
      @border.x = (@border.x * (@dispose_count - 1)+ INIT_X + RECT_X - (FONT_SIZE / 2) - @border.width ) / @dispose_count
      @border.opacity = (@border.opacity * (@dispose_count - 1)) / @dispose_count    
      @dispose_count -= 1
    end
    
  end
    
  end
  
  def dispose
    dispose_sprites
  end
  
  def dispose_sprites
    for i in @letters
      i.dispose
    end
    if @border
      @border.bitmap.dispose if @border.bitmap
      @border.dispose
    end  
  end
  
end
#===============================================================================
# The map                                           
#===============================================================================
class Scene_Map < Scene_Base
  
  
  alias smsbstrt start
  alias smsbupdbas update_transfer_player
  alias smsbupdnorm update
  alias smsbterm terminate
  
  def start
    @letters = Spriteset_MapName.new
    smsbstrt
#~     @letters.set_sprites
  end
  
  def update
    @letters.update 
    smsbupdnorm
  end
  
  def update_transfer_player
    teleported = true if $game_player.transfer?
    smsbupdbas
    @letters.set_sprites if teleported
  end
  
  def terminate
    @letters.dispose
    smsbterm
  end
  
endDemo
Are you serious? This don't need a demo...
Compatibility
SHOUD work with anything, just allieases three methods in scene_map
Termos & conditions
For non-comercial games only.
Giving credit it's not a must but its a nice act from your part ^^
See ya!


![[Image: mapnamewindows.th.png]](http://img4.imageshack.us/img4/3033/mapnamewindows.th.png)
	
