Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Animatéd Map Namé™ ★
- ================================================================================
- Script Information:
- ====================
- This script creates a new map name "window" and gives the ability to remove
- the old (shit) one.
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- ================================================================================
- 1. You must give credit to "Dekita"
- 2. You are NOT allowed to repost this script.(or modified versions)
- 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
- 4. You are NOT allowed to use this script for Commercial games.
- 5. ENJOY!
- "FINE PRINT"
- By using this script you hereby agree to the above terms and conditions,
- if any violation of the above terms occurs "legal action" may be taken.
- Not understanding the above terms and conditions does NOT mean that
- they do not apply to you.
- If you wish to discuss the terms and conditions in further detail you can
- contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 06/01/2o13 - started && finished,
- ================================================================================
- Known Bugs:
- ============
- N/A
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- If a new bug is found please contact me at
- http://dekitarpg.wordpress.com/
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- NOTETAGS:
- ==========
- <icon: icon_id>
- notetag for maps that have unique map name icon images
- =end #==========================================================================#
- module Map_Name_Window
- Remove_Default_Name_Window = true # obviously...
- Icon = 304 #231
- Icon_Pos = [10, 10] # [x, y]
- Map_Name_Pos = [25, 5] # [x, y]
- # replace this with a string of the font you wish to use. eg. "Comic Sans MS"
- Font_Name = Font.default_name
- Font_Size = 18
- Font_Bold = true
- Font_Italic = true
- # Font_Color = [ use? , color(red,grn,blu,alpha)]
- Font_Color = [ false , Color.new(255,0,0,255) ]
- # Font outline color.
- Font_Out_Col=[ false , Color.new(0 ,0 ,0,128) ]
- # Z value for the new map name "window"
- Map_Name_z = 100
- # The delay from entering the map till the name begins to show. (Frames)
- Delay_Timer = 30
- # The delay between each letter showing, this results in a fade like effect.
- L_S_D_Timer = 10
- end #####################
- # CUSTOMISATION END #
- #####################
- #===============================================================================#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DITTO.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- $imported = {} if $imported.nil?
- $imported[:Dekita_Anim_Map_Name] = true
- #===============================================================================#
- class RPG::Map
- #===============================================================================#
- attr_reader(:map_name_icon)
- def get_map_name_icon_info
- @map_name_icon = Map_Name_Window::Icon
- self.note.split(/[\r\n]+/).each { |line|
- case line ;
- when /<icon: (.*)>/i
- @map_name_icon = $1.to_i
- end ; } # self.note.split
- end
- end
- #==============================================================================
- class Game_Temp
- #==============================================================================
- attr_accessor :mapname
- alias :map_name_initialize_GT :initialize
- def initialize
- map_name_initialize_GT
- @mapname = nil
- end
- end
- #===============================================================================#
- class Game_Map
- #===============================================================================#
- alias :map_nameGMsetup :setup
- def setup(map_id)
- map_nameGMsetup(map_id)
- @map.get_map_name_icon_info
- end
- def map_name_icon
- @map.map_name_icon
- end
- end
- #==============================================================================
- class Sprite_Name < Sprite
- #==============================================================================
- include Map_Name_Window
- def initialize(letter, x = 0, y = 0, timer = 0)
- super(nil)
- create_map_name(letter, x, y)
- @open = true
- @timer = timer
- @timer_val = 0
- end
- def create_map_name(letter, x, y)
- size = Font_Size
- self.bitmap = Bitmap.new(size,size)
- self.bitmap.font.size = size
- self.bitmap.font.bold = Font_Bold
- self.bitmap.font.italic = Font_Italic
- self.bitmap.font.color = Font_Color[1] if Font_Color[0]
- self.bitmap.font.out_color = Font_Out_Col[1] if Font_Out_Col[0]
- self.bitmap.draw_text(0, 0, size, size, letter.to_s,0)
- self.x = x#(x - (self.bitmap.width/2))
- self.y = y + (size / 2).to_i
- self.z = Map_Name_z + 1
- self.opacity = 0
- end
- def update
- super
- update_show
- end
- def update_show
- if @timer_val <= @timer
- @timer_val += 1
- self.opacity = 1
- return
- end
- if @open ; self.opacity += 1
- else ; self.opacity -= 1
- end
- @open = false if self.opacity >= 255
- end
- def dispose
- super
- end
- end
- #==============================================================================
- class Sprite_MapIcon < Sprite
- #==============================================================================
- def initialize(icon, x = 0, y = 0)
- super(nil)
- self.bitmap = Cache.system("Iconset")
- rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
- self.bitmap.blt(0, 0, self.bitmap, rect)
- self.src_rect.set(rect.x, rect.y, 24, 24)
- self.x = x
- self.y = y
- self.z = Map_Name_Window::Map_Name_z
- self.opacity = 0
- @open = true
- end
- def update
- super
- update_show
- end
- def update_show
- if @open ; self.opacity += 1
- else ; self.opacity -= 1
- end
- @open = false if self.opacity >= 255
- end
- def dispose
- super
- end
- end
- #==============================================================================
- class Spriteset_Map_Name
- #==============================================================================
- def initialize
- return if $game_temp.mapname == $game_map.display_name
- dispose
- create_map_name_BG
- create_map_name
- @delay_timer = 0
- end
- def create_map_name_BG
- x = Map_Name_Window::Icon_Pos[0]
- y = Map_Name_Window::Icon_Pos[1]
- icon = $game_map.map_name_icon
- @map_icon.dispose if @map_icon != nil
- @map_icon = Sprite_MapIcon.new(icon, x, y)
- end
- def create_map_name
- x = Map_Name_Window::Map_Name_Pos[0]
- y = Map_Name_Window::Map_Name_Pos[1]
- $game_temp.mapname = $game_map.display_name
- n = $game_map.display_name.to_s.split(//)
- @map_name = []
- timer = Map_Name_Window::L_S_D_Timer
- for i in n
- @map_name.push( Sprite_Name.new(i[0], x, y, timer) )
- x += ($imported[:Dekita_Game_Settings] ? Font.default_size : Font_Size)/4*3
- timer += Map_Name_Window::L_S_D_Timer
- end
- end
- def update
- initialize
- update_map_name
- end
- def update_map_name
- return if @delay_timer == nil
- @delay_timer += 1
- return unless @delay_timer >= Map_Name_Window::Delay_Timer
- @map_icon.update if @map_icon != nil
- if @map_name != nil
- @map_name.each {|sprite|
- next unless sprite != nil
- sprite.update if !sprite.disposed?
- sprite.dispose if sprite != nil && !sprite.disposed? && sprite.opacity <= 0
- }
- end
- end
- def dispose
- @map_icon.dispose if @map_icon != nil
- @map_name.each {|sprite| sprite.dispose if sprite != nil &&
- !sprite.disposed? } if @map_name != nil
- end
- end
- #==============================================================================
- class Spriteset_Map
- #==============================================================================
- alias :initialize_map_name :initialize
- alias :dispose_map_name :dispose
- alias :update_map_name :update
- def initialize
- initialize_map_name
- @mn = Spriteset_Map_Name.new
- end
- def dispose
- dispose_map_name
- @mn.dispose if @mn != nil
- end
- def update
- update_map_name
- @mn.update if @mn != nil
- end
- end
- #==============================================================================
- class Window_MapName < Window_Base
- #==============================================================================
- if Map_Name_Window::Remove_Default_Name_Window
- def update
- super
- end
- def open
- refresh
- self
- end
- def close
- self
- end
- def refresh
- contents.clear
- end
- end # if Map_Name_Window::Remove_Default_Name_Window
- end
- #==============================================================================#
- # - SCRIPT END - #
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement