Modified Map Name Display

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
Map Name Display Plus v 1.0




by Majirefy


Introduction

This script will dislpay your map name in a modified way when switching between maps in Ace.

Features

- Easy to custom style

- Good for muti-language or add descriptions for map

- Make your game more "PRO"(at least I believe that... :D )

How to Use

  1. Paste above main
  2. Turn to Scence_Map section, on Line 161, change @map_name_window = Window_MapName.new to @map_name_window = Window_MapNamePlus.new
  3. In Map Properties window, set Display Name in format like: name1@name2. nam1 will be set above the split line and in bigger font size, while name2 will be below the split line and in smaller font size
  4. Run your game and see the change.

Demo

MapNamePlus.zip

Screenshot

Example.png

Script



Code:
# encoding: utf-8
#==============================================================================
# ** Window_MapNamePlus
#------------------------------------------------------------------------------
#  This window displays the map name.
#------------------------------------------------------------------------------
#	This class replaces the default Window_MapName class, adding more
#   modification and custom.
#------------------------------------------------------------------------------
#  Author: Majirefy
#------------------------------------------------------------------------------
#  Guide:
#	To use this script, create a new section below Materials in Script Editor
#   and paste the script there. Then turn to Scene_Map section, find string
#   "Window_MapName.new", replace it by "Winodw_MapNamePlus.new".
#	Map name should be set in pattern like "拉普兰德@Lapland", using symbol "@"
#   to split Chinese character and English text. You can also use "@" to split
#   everything in map name.
#------------------------------------------------------------------------------
#  Version: 1.0 - 20120502
#   First Release
#==============================================================================
class Window_MapNamePlus < Window_Base
  #--------------------------------------------------------------------------
  # * Settings
  #--------------------------------------------------------------------------
  FONT_NAME_CH = ["PMingLiU", "FangSong"]	   # Chinese Font Name
  FONT_SIZE_CH = 42							 # Chinese Font Size
  FONT_NAME_EN = ["Monotype Corsiva"]		   # English Font Name
  FONT_SIZE_EN = 28							 # English Font Size
  FONT_BOLD	= false						  # True if Font in Bold
  FONT_COLOR   = Color.new(255, 255, 255, 255)  # Color of Font
  FONT_OUT	 = true						   # True if Font Has Outline
  OUT_COLOR	= Color.new(0, 0, 0, 200)		# Color of Outline Color of Font
  FONT_SHADOW  = false						  # True if Text Drops Shadow
  MODIFIER	 = "~"							# Modifier Added beside Map Name
  PADDING	  = 8							  # Padding between Window's Frame and Contents
  LINE_HEIGHT  = 6							  # Height of Split Line
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :map_name_ch					  # Chinese Map Name
  attr_reader :map_name_en					  # English Map Name
  attr_reader :line_x						   # Split Line X Coordinate
  attr_reader :line_y						   # Split Line Y Coordinate
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
	#----------------------------------------------------------------------
	# * Set the window in the middle of screen.
	#----------------------------------------------------------------------
	super(((Graphics.width - window_width) / 2),
	  ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)) / 2),
	  window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)
	#----------------------------------------------------------------------
	# * Custom font and style.
	#----------------------------------------------------------------------
	contents.font.bold	  = FONT_BOLD
	contents.font.color	 = FONT_COLOR
	contents.font.outline   = FONT_OUT
	contents.font.out_color = OUT_COLOR
	contents.font.shadow	= FONT_SHADOW
	#----------------------------------------------------------------------
	# * Set Window Opacity
	#----------------------------------------------------------------------
	self.opacity = 0
	self.contents_opacity = 0
	@show_count = 0
	refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
	return Graphics.width
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
	super
	if @show_count > 0 && $game_map.name_display
	  update_fadein
	  @show_count -= 1
	else
	  update_fadeout
	end
  end
  #--------------------------------------------------------------------------
  # * Update Fadein
  #--------------------------------------------------------------------------
  def update_fadein
	self.contents_opacity += 16
  end
  #--------------------------------------------------------------------------
  # * Update Fadeout
  #--------------------------------------------------------------------------
  def update_fadeout
	self.contents_opacity -= 16
  end
  #--------------------------------------------------------------------------
  # * Open Window
  #--------------------------------------------------------------------------
  def open
	refresh
	@show_count = 150
	self.contents_opacity = 0
	self
  end
  #--------------------------------------------------------------------------
  # * Close Window
  #--------------------------------------------------------------------------
  def close
	@show_count = 0
	self
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	contents.clear
	set_map_name
	unless $game_map.display_name.empty?
	  draw_map_name
	end
  end
  #--------------------------------------------------------------------------
  # * Draw Line
  #--------------------------------------------------------------------------
  def draw_line(rect)
	temp_rect = rect.clone
	temp_rect.height = LINE_HEIGHT
	temp_rect.width /= 4
	contents.gradient_fill_rect(temp_rect, color2, color1)
	temp_rect.x += temp_rect.width
	temp_rect.width *= 2
	contents.fill_rect(temp_rect, color1)
	temp_rect.x += temp_rect.width
	temp_rect.width /= 2
	contents.gradient_fill_rect(temp_rect, color1, color2)
  end
  #--------------------------------------------------------------------------
  # * Set Map Name
  #--------------------------------------------------------------------------
  def set_map_name
	temp_map_name = $game_map.display_name.split("@")
	@map_name_ch  = temp_map_name[0].to_s
	@map_name_en  = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER
  end
  #--------------------------------------------------------------------------
  # * Draw Map Name
  #--------------------------------------------------------------------------
  def draw_map_name
	set_line_position
	set_line_width
	temp_line_rect = Rect.new(@line_x, @line_y, set_line_width, LINE_HEIGHT)
	draw_line(temp_line_rect)
	temp_name_rect_ch = Rect.new(0, 0, contents.width, FONT_SIZE_CH)
	contents.font.name = FONT_NAME_CH
	contents.font.size = FONT_SIZE_CH
	draw_text(temp_name_rect_ch, @map_name_ch, 1)
	temp_name_rect_en = Rect.new(0, FONT_SIZE_CH, contents.width, FONT_SIZE_EN)
	contents.font.size = FONT_SIZE_EN
	contents.font.name = FONT_NAME_EN
	draw_text(temp_name_rect_en, @map_name_en, 1)
  end
  #--------------------------------------------------------------------------
  # * Set Line Width
  #--------------------------------------------------------------------------
  def set_line_width
	text_width_ch = text_size(@map_name_ch).width * 1.5
	text_width_en = text_size(@map_name_en).width * 1.5
	(text_width_ch >= text_width_en) ?
	  (text_width_ch) : (text_width_en)
  end
  #--------------------------------------------------------------------------
  # * Set Line Position
  #--------------------------------------------------------------------------
  def set_line_position
	@line_x = (contents.width - set_line_width) / 2
	@line_y = (contents.height - LINE_HEIGHT) / 2
  end
  #--------------------------------------------------------------------------
  # * Get Color 1
  #--------------------------------------------------------------------------
  def color1
	Color.new(255, 255, 255, 255)
  end
  #--------------------------------------------------------------------------
  # * Get Color 2
  #--------------------------------------------------------------------------
  def color2
	Color.new(255, 255, 255, 0)
  end
end
Notes

This is my first time working with script and I am thirst to have some advices from you.

Have fun and give me reply if that won't bother you! :wub:
 

Attachments

  • MapNamePlus.zip
    322 bytes · Views: 642
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
please fix the screenie... it says:

the demo too...
 
Last edited by a moderator:

AlaiaVee

Villager
Member
Joined
Mar 14, 2012
Messages
76
Reaction score
21
First Language
English
Primarily Uses
Screenshot isn't working, but I found Majirefy's post on a Chinese RPG Maker site (temp.66rpg.com)

Here's the screenshot:

mmndisplay.png

I couldn't find the demo.

All in all it looks pretty nice.
 

Mako

Veteran
Veteran
Joined
Mar 13, 2012
Messages
276
Reaction score
48
First Language
English
Primarily Uses
Thanks! Great perfect script! Is there anyway to just display it once? it gets kinda annoying going in and out of houses. =/
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,906
Reaction score
458
First Language
April Fools
Primarily Uses
N/A
So this will turn off the default way Ace shows map names also?
 

Mako

Veteran
Veteran
Joined
Mar 13, 2012
Messages
276
Reaction score
48
First Language
English
Primarily Uses
So this will turn off the default way Ace shows map names also?
Yes, I can answer that...

The answer is yes. lol
 
Last edited by a moderator:

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
Thanks! Great perfect script! Is there anyway to just display it once? it gets kinda annoying going in and out of houses. =/
I'm working on modifying this script and trying to add more functions:

add a swtich which controls when to display it;

display once in same map

As a newbie to script, I will do my best! ;)

Forgive me for keeping you waiting...
 

Mako

Veteran
Veteran
Joined
Mar 13, 2012
Messages
276
Reaction score
48
First Language
English
Primarily Uses
Forgive me for keeping you waiting...
No need to forgive! You are already 100x better then me!
 

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
No need to forgive! You are already 100x better then me!
LOL...

There is a function in your event commands at Tab 3 called "Change Map Name Display", you can control map name display by using it.

Sorry I do not know how to make it show once as we hoped, but an alternative is to use this function in your Transfer Player event.

It seems more easy to control, I believe.
 

Samven

Veteran
Veteran
Joined
Jun 19, 2012
Messages
144
Reaction score
16
First Language
English
Primarily Uses
Oh, wow! This works great! I think I'd like to use this for my VXa test game. : 3
 

ncognito

Veteran
Veteran
Joined
Jul 7, 2013
Messages
157
Reaction score
4
First Language
English
Primarily Uses
How to Use
  • Paste above main
  • Turn to Scence_Map section, on Line 161, change @map_name_window = Window_MapName.new to @map_name_window = Window_MapNamePlus.new
  • In Map Properties window, set Display Name in format like: name1@name2. nam1 will be set above the split line and in bigger font size, while name2 will be below the split line and in smaller font size
  • Run your game and see the change.
I dont see a Scence_Map section at all in this script... nor do i see @map_name-window=Window_MapName.new. can someone tell me how to set this up plz
 

Geekman

Veteran
Veteran
Joined
Feb 22, 2013
Messages
73
Reaction score
7
First Language
English
Primarily Uses
What are the commercial terms?
 

ultimagicka

Veteran
Veteran
Joined
Oct 15, 2012
Messages
38
Reaction score
17
First Language
English
Primarily Uses
RMMV
@ncognito

this is what your looking for if you still have not found it.

Just change Window_MapName.new  

to this

Winodow_MapNamePlus.new

 

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
At first I must say sorry for those days I spent on HUNTING for a job,,,,

Thanks! Great perfect script! Is there anyway to just display it once? it gets kinda annoying going in and out of houses. =/
This will be a little more complicated...

For now, I have no good idea...

Give me some hint about that? Or any other scripts about this?
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
I tested it in my project with lots of other scripts, and is aw no flaws in it at all. Congratz on your fist script, Majirefy.  ;)
 

Majirefy

~Doraemon's Pocket~
Member
Joined
Apr 24, 2012
Messages
26
Reaction score
8
First Language
Chinese
Primarily Uses
I tested it in my project with lots of other scripts, and is aw no flaws in it at all. Congratz on your fist script, Majirefy.  ;)
THX~~~I will do better then!
 

Latest Threads

Latest Posts

Latest Profile Posts

The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?
I've been having a rough couple of months and as such let down some friends of mine in the RPG Maker community. I still need time to get back to my normal self, but it's nice to be back, to read articles, and to design again (albeit at a slow pace). Hope to give updates on Kid Crescent soon.
Friendly reminder that you don't have to be able to do absolutely everything. It's okay to scale back features or assets if things are too much - especially if you're the only one working on the game! And you can always add things in later. <3
My new cutscene system makes it so much easier to add parallel stuff happening in the background, I can easily fill the whole screen with action.

Forum statistics

Threads
107,734
Messages
1,031,736
Members
139,868
Latest member
enterjc
Top