Jump to content
prepe

Window_MapName+ edit with image -FIXED-

Recommended Posts

Window_MapName+
An edit by prepe

Introduction
This is the first but hopfully not the last thing I give to you guys. I'm no scripter but am trying to learn it so here you go.

What I did is edit the map name script to show a custiom background pic behind the name and moved it to the right
of the screen. I know its not much and super easy but I felt someone could use it.

Screenshots
screencapt.png

The Script
Place this ether in the materials section or overright Window_MapName
with this one. If using the map name fix By Crazyninjaguy place this above it.

 

#==============================================================================
# Window Map Name+
# by Enterbrain
# edited by LUSHI
# battle fix by Sixth
# Date 05/24/2015
#------------------------------------------------------------------------------
# **WHAT IT DOES**
# This edit is simple I'm no pro but wanted my have my one image in the
# background of the map name so I edited Window_MapName.
# This adds a background image to the map name and moves it to the right of the
# screen.
#------------------------------------------------------------------------------
# **WHERE THINGS GO**
# place this scrip ether in the materials section or overright Window_MapName
# with this one. If using the map name fix By Crazyninjaguy place this above it.
#
# Must have "Map_Name_Back.png" in Graphics/System folder
#
# thats it run your game.
#
#------------------------------------------------------------------------------
# **HOW TO EDIT**
# To change the locaton of the name change the values of lines,
#
# 49
# 122
# 123
#
# to change the name of the png file find line,
#
# 120
#
# and edit as you need.
#
# **THE END**
# Thats all there is. I hope That helps.
#------------------------------------------------------------------------------
# This window displays the map name.
#==============================================================================
class Window_MapName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(1))
    self.opacity = 0
    self.contents_opacity = 0
    self.x = 340
    @map_name_back = Sprite.new
    @show_count = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 240
  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
    @map_name_back.opacity += 16
  end
  #--------------------------------------------------------------------------
  # * Update Fadeout
  #--------------------------------------------------------------------------
  def update_fadeout
    self.contents_opacity -= 16
    @map_name_back.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
    unless $game_map.display_name.empty?
    draw_background(contents.rect)
    draw_text(contents.rect, $game_map.display_name, 1)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Background
  #--------------------------------------------------------------------------
  def draw_background(rect)
    temp_rect = rect.clone
    temp_rect.width /= 2
    contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
    @map_name_back = Sprite.new
    @map_name_back.bitmap = Cache.system("Map_Name_Back.png")
    @map_name_back.z = 0
    @map_name_back.x = 370
    @map_name_back.y = 7
    @map_name_back.opacity = 0
    temp_rect.x = temp_rect.width
    contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 1
  #--------------------------------------------------------------------------
  def back_color1
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Get Background Color 2
  #--------------------------------------------------------------------------
  def back_color2
    Color.new(0, 0, 0, 0)
  end
  #--------------------------------------------------------------------------
  # * Delete Background On Battle Start
  #--------------------------------------------------------------------------
  def dispose
    @map_name_back.bitmap.dispose
    @map_name_back.dispose
    super
  end
end

 




Resources
Credits Goes to Hanzo Kimura. Its his graphic form the Valkyrie Stories open source that he gave out.
I just edited it a little.
mapnameback.png
Goes in your Graphics/System folder. Name it "Map_Name_Back" without the quotes.
Image shack changed the name on me.

Compatibility
As its a small edit to a default script it should have no issues. If it does post here I shall try and fix it.

Credit and Thanks
- Hanzo Kimura
- Enterbrain

- Sixth
- Everyone who has helped me learn to script over the years.

Author's Notes
The instructions on how to edit and change it are in the script.
I encourage you to make your own graphic for this.
I also will not be making a demo as thats how I learned.
I hade to put them in and set them up, no copy past sorry guys.

I hope you like it.
Credits are welcome but not mandatory. Just ask before you repost this on another forum, thanks

Prepe

Edited by prepe

Share this post


Link to post
Share on other sites

Thank you so much :) I've been wanting a script like this for a long time.

 

You are very welcome. I know its not much but glad you liked it.

 

-EDIT-

Hold on dont use it yet. I found an error when transferring from one map to another.

Its 3am I will fix it tomorrow after work and have it up by tomorrow evening.

 

Sorry Guys

 

Prepe

 

-EDIT AGAIN-

All fixed :D

Edited by prepe

Share this post


Link to post
Share on other sites

All right, I MIGHT have made a mistake but I followed the instructions directly;

 

Script 'Map Name Plus' line 83: RGSSError occurred.

disposed sprite

The coding of that line, according to my script:

@map_name_back.opacity -= 16

It happens whenever I change between maps, apparently.

 

EDIT: Oh, you already noticed. Awesome.

Edited by Ehren Rivers

Share this post


Link to post
Share on other sites

All right, I MIGHT have made a mistake but I followed the instructions directly;

 

Script 'Map Name Plus' line 83: RGSSError occurred.

disposed sprite

The coding of that line, according to my script:

@map_name_back.opacity -= 16

It happens whenever I change between maps, apparently.

 

EDIT: Oh, you already noticed. Awesome.

 

Yeah I did and its good to go now.

 

If anyone has used this replace the code with the new one. Its all fixed and ready to go.

let me know if there are more errors.

 

Also Im planing on making more for it like it sliding in from the side, or top, or something.

I dunno yet though well see If i have it in me to do that. :) That will be another day though.

 

Prepe

Edited by prepe

Share this post


Link to post
Share on other sites

Looks delicious... Planning to edit the hud and make it really nice map name pop-upper ;3...

 

Thanksies.

Share this post


Link to post
Share on other sites

Looks delicious... Planning to edit the hud and make it really nice map name pop-upper ;3...

 

Thanksies.

 

Your welcome. I hope it all works out for you. :)

 

I noticed the pic stays when you open the menu.I will fix that and have it up tonight.

 

 

Prepe

Edited by prepe

Share this post


Link to post
Share on other sites

Ah, it's what I needed right now.

Thank you for sharing it, I will try it as soon as possible. :)

Share this post


Link to post
Share on other sites

Ah, it's what I needed right now.

Thank you for sharing it, I will try it as soon as possible. :)

 

you are verry welcome

Share this post


Link to post
Share on other sites

This is great! I really need his to my project. Thank you for this!

 

I want to make a request, only if possible. Can make a font for map title w/c is different from the default system font?

 

I only want to display the map title with different font style from default font.

 

Thanks you!

 

 

Bug report:

When you encounter enemy while the map title is not yet fading out, the map title will still show up in battle scene and never fade out.

Edited by Rhayvie1978

Share this post


Link to post
Share on other sites

This is great! I really need his to my project. Thank you for this!

 

I want to make a request, only if possible. Can make a font for map title w/c is different from the default system font?

 

I only want to display the map title with different font style from default font.

 

Thanks you!

 

 

Bug report:

When you encounter enemy while the map title is not yet fading out, the map title will still show up in battle scene and never fade out.

 

Yeah the font is easy and the bug is fixed. Im revamping this to be better and bug free, I hope. Ill post when its done.

Share this post


Link to post
Share on other sites

Hi, I have put this script in but the name does not show up on any map :S any help on this?

 

Cheers

 

DB32

In your map properties there are two places to type a name. One is the name and the other is what displays as the map name. I'm sure its blank and thats why. Also the first map you start on does not show the name. You need to go to a new map for it to work.Its a vxa bug but there is a fix for it on the forums here. I'm not sure where its at though.

Share this post


Link to post
Share on other sites

Add this above the last 'end' line (so, inside the class):

  def dispose
    @map_name_back.bitmap.dispose
    @map_name_back.dispose
    super
  end
This should get rid of the background automatically.

Share this post


Link to post
Share on other sites

Wow i totally forgot i started this script so long ago. I forgot all about it. Thanks for the fix  @Sixth.

 

-EDIT-

I updated the script in the first post to include the fix by @Sixth.

Just replace the old one with the new one.

 

 

Prepe

Edited by prepe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted