Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.1
- ★ Animatéd Map Namé™ ★
- ================================================================================
- Script Information:
- ====================
- This script creates a highly dynamic and customisable map name "window"
- and gives the ability to remove the old (shit) one.
- Features :~
- Multiple effect types,
- Each map can have its own unique map name display features, such as...
- Location, Icon, Font, Size, Effect, ect.
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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
- 09/01/2o13 - added 18 effects,
- 08/01/2o13 - added 8 effects,
- fixed bug, (typo)
- 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.
- ================================================================================
- SCRIPT CALLS:
- =============
- reset_map_name
- ^ Does what it says.
- ================================================================================
- NOTETAGS: (map noteboxes)
- ==========
- Font_Name_Tags :
- <FONT NAME: X>
- <FN: X>
- replace X with the Font_Name array index.
- Font_Size_Tags :
- <FONT SIZE: X>
- <FS: X>
- replace X with the font size.
- Font_Bold_Tags :
- <FONT BOLD: bool>
- <FB: bool>
- replace bool with true or false
- Font-italic_Tags :
- <FONT ITALIC: bool>
- <FI: bool>
- replace bool with true or false
- Font_Color_Tags :
- (main color tags)
- <FONT COLOR: red, grn, blu, alp>
- <FC: red, grn, blu, alp>
- (outline color tags)
- <FONT OUT COLOR: red, grn, blu, alp>
- <FOC: red, grn, blu, alp>
- red = the red value of the font
- grn = the green value of the font
- blu = the blue value of the font
- alp = the alpha value of the font
- Icon_id_Tags :
- <NAME ICON: X>
- <ICON: X>
- <NI: X>
- replace x with the icon id from your iconset
- Icon_Position_Tags :
- <ICON POS: x, y>
- <IP, x, y>
- x / y = the screen position.
- Icon_Center_Tags :
- <ICON CENTER: bool_X, bool_Y>
- <ICEN: bool_X, bool_Y>
- bool_X / bool_Y should be replaced with true or false e.g <ICEN: true, false>
- this would center the icon's x value in the middle but not the y
- Icon_Effect_Tags :
- <ICON EFFECT: bool>
- <IC: bool>
- bool = true or false
- Map_Name_Effect_Tags :
- <NAME EFFECT: id>
- <NAME EFF: id>
- <NE: id>
- id = the effect id for this map.
- <NO NAME EFFECT>
- <NO NAME EFF>
- <NO NE>
- makes this map have no name effect
- Map_Name_Slide_Tags :
- <NAME SLIDE: dist>
- <NS DIST: dist>
- <NSD: dist>
- dist = the distance of the slide, eg. 180
- Map_Name_Position_Tags :
- <NAME POS: x, y>
- <NP: x, y>
- x, y = the position of the map name
- <NAME CENTER: bool_X, bool_Y>
- <NCEN: bool_X, bool_Y>
- bool_X / bool_Y should be replaced with true or false e.g <NCEN: true, false>
- this would center the name's x value in the middle but not the y
- Map_Name_L_S_D_Tags :
- <NAME DELAY: val>
- <ND: val>
- val = the delay value from one letter showing till the next.
- Single Huge Notetag :
- Tired of putting loads of litte '<' and '>' ? use this notetag .
- <MAP NAME>
- # -- notes go here
- <\MAP NAME>
- or
- <MNW>
- # -- notes go here
- <\MNW>
- the notes for inside these notetags are the same as above without the '<' and '>'
- e.g
- <MNW>
- FN: X
- FS: X
- FB: bool
- FI: bool
- FC: red, grn, blu, alp
- FOC: red, grn, blu, alp
- NI: X
- IP, x, y
- ICEN: bool_X, bool_Y
- IC: bool
- NE: id
- NO NE
- NSD: dist
- NP: x, y
- NCEN: bool_X, bool_Y
- ND: val
- </MNW>
- =end #=========================================================================#
- module Map_Name_Window
- Font_Name=[]#Do Not Delete.
- Remove_Default_Name_Window = true # obviously...
- # Z value for the new map name "window"
- Map_Name_z = 100
- # This adjusts the fonts used for your maps. If the font at the start of
- # the array doesn't exist on the player's computer, it'll use the next one.
- # the games default font will be used if a maps font name is unspecified.
- Font_Name[0] = ["VL Gothic" , Font.default_name]
- Font_Name[1] = ["Arial" , Font.default_name]
- Font_Name[2] = ["Xirod" , Font.default_name]
- Font_Name[3] = ["Comic Sans MS", Font.default_name]
- Font_Name[3] = ["Verdana" , Font.default_name]
- Font_Name[3] = ["Arial" , Font.default_name]
- Font_Name[3] = ["Courier" , Font.default_name]
- Font_Size = 18
- Font_Bold = true
- Font_Italic = true
- # Font_Color=[ red, grn, blu, alpha ]
- Font_Color = [ 255, 255, 255, 255 ]
- # Font outline color.
- Font_Out_Col=[ 0 , 0 , 0 , 128 ]
- #Icon= [ use? , icon id ]
- Icon = [ true , 304 ] # Default iconset map icon = 231
- Icon_Pos = [10, 10] # [x, y]
- Icon_Has_Effects = true # Icon has the same effects as letters ?
- Map_Name_Pos = [25, 5] # [x, y]
- # 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
- Center_Name = [ false , false ]
- Center_Icon = [ false , false ]
- Slide_Distance = Graphics.width / 4
- Letter_Effects = true
- L_Effect_Type = 0
- # 0 = Basic Left Slide
- # 1 = Basic Right Slide
- # 2 = Top Drop Left Slide
- # 3 = Top Drop Right Slide
- # 4 = Bottoms up Left Slide
- # 5 = Bottoms up Right Slide
- # 6 = Basic Left Spin
- # 7 = Basic Right Spin
- # 8 = Basic Left Swirl Top
- # 9 = Basic Left Swirl Bottom
- # 10 = Basic Right Swirl Bottom
- # 11 = Basic Right Swirl Top
- # 12 = Slide Up
- # 13 = Slide Down
- # 14 = Slide Up & Left
- # 15 = Slide Up & Right
- # 16 = Slide Down & Left
- # 17 = Slide Down & Right
- # 18 = Slide Up & Left, Left Spin
- # 19 = Slide Up & Left, Right Spin
- # 20 = Slide Up & Right, Left Spin
- # 21 = Slide Up & Right, Right Spin
- # 22 = Slide Down & Left, Left Spin
- # 23 = Slide Down & Left, Right Spin
- # 24 = Slide Down & Right, Left Spin
- # 25 = Slide Down & Right, Right Spin
- end # RegExp options below. only change these if you know what you are doing.
- module M_N_W_RegExp
- F_Name = /(?:FONT NAME|font name|FN|fn):[ ](\d+)/
- F_Size = /(?:FONT SIZE|FS):[ ](\d+)/i
- F_Bold = /(?:FONT BOLD|FB):[ ](.*)/i
- F_Ital = /(?:FONT ITALIC|FI):[ ](.*)/i
- F_Col_ = /(?:FONT COLOR|FC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
- F_OCol = /(?:FONT OUT COLOR|FOC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
- Icon = /(?:NAME ICON|ICON|NI):[ ](\d+)/i
- IPos = /(?:ICON POS|IP):[ ](\d+),[ ](\d+)/i
- ICent = /(?:ICON CENTER|ICEN):[ ](.*),[ ](.*)/i
- IEffs = /(?:ICON EFFECT|IEFF):[ ](.*)/i
- Eff = /(?:NAME EFFECT|NAME EFF|NE):[ ](\d+)/i
- NEff = /(?:NO NAME EFFECT|NO NAME EFF|NO NE)/i
- Slide = /(?:NAME SLIDE|NS DIST|NSD):[ ](\d+)/i
- Posi = /(?:NAME POS|NP):[ ](\d+),[ ](\d+)/i
- Pos2 = /(?:NAME CENTER|NCEN):[ ](.*),[ ](.*)/i
- LSD_ = /(?:NAME DELAY|ND):[ ](\d+)/i
- Large = /<(?:MAP NAME|MNW)>([^><]*)<\/(?:MAP NAME|MNW)>/im
- #####################
- # CUSTOMISATION END #
- 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_font_name)
- attr_reader(:map_name_font_size)
- attr_reader(:map_name_font_bold)
- attr_reader(:map_name_font_ital)
- attr_reader(:map_name_font_col_)
- attr_reader(:map_name_font_ocol)
- attr_reader(:map_name_icon)
- attr_reader(:map_name_icon_pos)
- attr_reader(:map_name_icon_pos_centered)
- attr_reader(:map_name_icon_gets_effects)
- attr_reader(:map_name_effect)
- attr_reader(:map_name_slide_dist)
- attr_reader(:map_name_letter_show_delay)
- attr_reader(:map_name_position)
- attr_reader(:map_name_position_centered)
- def get_map_name_icon_info
- @map_name_font_name = Font.default_name
- @map_name_font_size = Map_Name_Window::Font_Size
- @map_name_font_bold = Map_Name_Window::Font_Bold
- @map_name_font_ital = Map_Name_Window::Font_Italic
- @map_name_font_col_ = Map_Name_Window::Font_Color
- @map_name_font_ocol = Map_Name_Window::Font_Out_Col
- @map_name_icon = Map_Name_Window::Icon
- @map_name_icon_pos = Map_Name_Window::Icon_Pos
- @map_name_icon_pos_centered = Map_Name_Window::Center_Icon
- @map_name_icon_gets_effects = Map_Name_Window::Icon_Has_Effects
- @map_name_effect = [Map_Name_Window::Letter_Effects,Map_Name_Window::L_Effect_Type]
- @map_name_slide_dist = Map_Name_Window::Slide_Distance
- @map_name_position = Map_Name_Window::Map_Name_Pos
- @map_name_position_centered = Map_Name_Window::Center_Name
- @map_name_letter_show_delay = Map_Name_Window::L_S_D_Timer
- self.note.split(/[\r\n]+/).each { |line| ; case line
- when /<#{M_N_W_RegExp::F_Name}>/ ; @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i]
- when /<#{M_N_W_RegExp::F_Size}>/ ; @map_name_font_size = $1.to_i
- when /<#{M_N_W_RegExp::F_Bold}>/ ; @map_name_font_bold = $1.to_s
- when /<#{M_N_W_RegExp::F_Ital}>/ ; @map_name_font_ital = $1.to_s
- when /<#{M_N_W_RegExp::F_Col_}>/ ; @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i]
- when /<#{M_N_W_RegExp::F_OCol}>/ ; @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,]
- when /<#{M_N_W_RegExp::Icon}>/ ; @map_name_icon = [true, $1.to_i]
- when /<#{M_N_W_RegExp::IPos}>/ ; @map_name_icon_pos = [$1.to_i, $2.to_i]
- when /<#{M_N_W_RegExp::ICent}>/ ; @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase]
- when /<#{M_N_W_RegExp::IEffs}>/ ; @map_name_icon_gets_effects = $1.to_s.downcase
- when /<#{M_N_W_RegExp::Eff}>/ ; @map_name_effect = [true, $1.to_i]
- when /<#{M_N_W_RegExp::NEff}>/ ; @map_name_effect = [false, 0]
- when /<#{M_N_W_RegExp::Slide}>/ ; @map_name_slide_dist = $1.to_i
- when /<#{M_N_W_RegExp::Posi}>/ ; @map_name_position = [$1.to_i, $2.to_i]
- when /<#{M_N_W_RegExp::Pos2}>/ ; @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase]
- when /<#{M_N_W_RegExp::LSD_}>/ ; @map_name_letter_show_delay = $1.to_i
- end ; } # self.note.split
- get_mni(self.note)
- end
- def get_mni(note)
- note.scan(M_N_W_RegExp::Large) { setup_map_name_info($1) }
- end
- def setup_map_name_info(info)
- @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i] if info =~ M_N_W_RegExp::F_Name
- @map_name_font_size = $1.to_i if info =~ M_N_W_RegExp::F_Size
- @map_name_font_bold = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Bold
- @map_name_font_ital = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Ital
- @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_Col_
- @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_OCol
- @map_name_icon = [true,$1.to_i] if info =~ M_N_W_RegExp::Icon
- @map_name_icon_pos = [$1.to_i, $2.to_i] if info =~ M_N_W_RegExp::IPos
- @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::ICent
- @map_name_icon_gets_effects = $1.to_s.downcase if info =~ M_N_W_RegExp::IEffs
- @map_name_effect = [true,$1.to_i] if info =~ M_N_W_RegExp::Eff
- @map_name_effect = [false, 0] if info =~ M_N_W_RegExp::NEff
- @map_name_slide_dist = $1.to_i if info =~ M_N_W_RegExp::Slide
- @map_name_position = [$1.to_i,$2.to_i] if info =~ M_N_W_RegExp::Posi
- @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::Pos2
- @map_name_letter_show_delay = $1.to_i if info =~ M_N_W_RegExp::LSD_
- 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
- def map_name_icon_pos_x
- @map.map_name_icon_pos[0]
- end
- def map_name_icon_pos_y
- @map.map_name_icon_pos[1]
- end
- def map_name_icon_pos_x_center?
- @map.map_name_icon_pos_centered[0]
- end
- def map_name_icon_pos_y_center?
- @map.map_name_icon_pos_centered[1]
- end
- def map_name_icon_effects?
- @map.map_name_icon_gets_effects
- end
- def map_name_effect
- @map.map_name_effect
- end
- def map_name_slide
- @map.map_name_slide_dist
- end
- def map_name_font_name
- @map.map_name_font_name
- end
- def map_name_font_size
- @map.map_name_font_size
- end
- def map_name_font_bold
- @map.map_name_font_bold
- end
- def map_name_font_italic
- @map.map_name_font_ital
- end
- def map_name_position_x
- @map.map_name_position[0]
- end
- def map_name_position_y
- @map.map_name_position[1]
- end
- def map_name_pos_center_x?
- @map.map_name_position_centered[0]
- end
- def map_name_pos_center_y?
- @map.map_name_position_centered[1]
- end
- def map_name_LSD
- @map.map_name_letter_show_delay
- end
- def map_name_font_color
- c = @map.map_name_font_col_
- Color.new(c[0],c[1],c[2],c[3])
- end
- def map_name_font_out_color
- c = @map.map_name_font_ocol
- Color.new(c[0],c[1],c[2],c[3])
- end
- end
- #==============================================================================
- class Game_Interpreter
- #==============================================================================
- def reset_map_name
- $game_temp.mapname = nil
- end
- end
- #==============================================================================
- class Sprite_MapName < Sprite
- #==============================================================================
- include Map_Name_Window
- def initialize(letter, x = 0, y = 0, timer = 0, index = 0)
- super(nil)
- create_variables(timer, index)
- create_map_name(letter, x, y)
- get_letter_effects if @letter_effects[0]
- end
- def create_variables(t, i)
- @open = true
- @slide_left = false
- @slide_right = false
- @slide_up = false
- @slide_down = false
- @timer = t
- @timer_val = 0
- @letter_index = i
- @angle_type = nil
- @letter_effects = $game_map.map_name_effect
- @slide_distance = $game_map.map_name_slide
- end
- def create_map_name(letter, x, y)
- size = $game_map.map_name_font_size
- self.bitmap = Bitmap.new(size,size)
- self.bitmap.font.name = $game_map.map_name_font_name
- self.bitmap.font.size = size
- self.bitmap.font.bold = $game_map.map_name_font_bold
- self.bitmap.font.italic = $game_map.map_name_font_italic
- self.bitmap.font.color = $game_map.map_name_font_color
- self.bitmap.font.out_color = $game_map.map_name_font_out_color
- self.bitmap.draw_text(0, 0, size, size, letter.to_s)
- self.x = x
- self.y = y + (size / 2).to_i
- self.z = Map_Name_z #+ 1
- self.opacity = 0
- end
- def get_letter_effects
- return if @icon && !$game_map.map_name_icon_effects?
- case @letter_effects[1]
- when 0 ; basic_left_slide
- when 1 ; basic_right_slide
- when 2 ; basic_left_slide ; get_angle_type(0)
- when 3 ; basic_right_slide ; get_angle_type(1)
- when 4 ; basic_left_slide ; get_angle_type(1)
- when 5 ; basic_right_slide ; get_angle_type(0)
- when 6 ; basic_left_spin ; get_angle_type(2)
- when 7 ; basic_right_spin ; get_angle_type(3)
- when 8 ; basic_right_slide ; get_angle_type(4)
- when 9 ; basic_left_slide ; get_angle_type(4)
- when 10 ; basic_right_slide ; get_angle_type(5)
- when 11 ; basic_left_slide ; get_angle_type(5)
- when 12; basic_up_slide
- when 13; basic_down_slide
- when 14; basic_up_slide ; basic_left_slide
- when 15; basic_up_slide ; basic_right_slide
- when 16; basic_down_slide ; basic_left_slide
- when 17; basic_down_slide ; basic_right_slide
- when 18; basic_up_slide ;basic_left_slide ; basic_left_spin ;get_angle_type(2)
- when 19; basic_up_slide ;basic_left_slide ; basic_right_spin ;get_angle_type(3)
- when 20; basic_up_slide ;basic_right_slide ; basic_left_spin ;get_angle_type(2)
- when 21; basic_up_slide ;basic_right_slide ; basic_right_spin ;get_angle_type(3)
- when 22; basic_down_slide ;basic_left_slide ; basic_left_spin ;get_angle_type(2)
- when 23; basic_down_slide ;basic_left_slide ; basic_right_spin ;get_angle_type(3)
- when 24; basic_down_slide ;basic_right_slide ; basic_left_spin ;get_angle_type(2)
- when 25; basic_down_slide ;basic_right_slide ; basic_right_spin ;get_angle_type(3)
- end
- end
- def basic_left_slide
- @slide_left = true
- self.ox = -(@slide_distance).to_i
- end
- def basic_right_slide
- @slide_right = true
- self.ox = (@slide_distance).to_i
- end
- def basic_up_slide
- @slide_up = true
- self.oy = -(@slide_distance).to_i
- end
- def basic_down_slide
- @slide_down = true
- self.oy = (@slide_distance).to_i
- end
- def basic_left_spin
- @move_for_spin = true
- end
- def basic_right_spin
- @move_for_spin = true
- end
- def get_angle_type(angle_type)
- @angle_type = angle_type
- case angle_type
- when 0 ; self.angle = 50
- when 1 ; self.angle = -50
- when 2 ; self.angle = -360
- when 3 ; self.angle = 360
- when 4 ; self.angle = (50 * (@timer / (@letter_index+1)))
- when 5 ; self.angle = -(50 * (@timer / (@letter_index+1)))
- end
- end
- def update
- return if self.disposed?
- super
- update_timer
- update_show
- update_slide if @open
- update_angle if @angle_type != nil
- end
- def update_timer
- return if @timer_val >= @timer
- @timer_val += 1
- self.opacity = 1
- end
- def update_show
- self.opacity += 1 if @open
- self.opacity -= 1 if !@open
- @open = false if self.opacity >= 255
- end
- def update_slide
- self.ox += 1 if self.ox < 0 && @slide_left
- self.ox -= 1 if self.ox > 0 && @slide_right
- self.oy += 1 if self.oy < 0 && @slide_up
- self.oy -= 1 if self.oy > 0 && @slide_down
- end
- def update_angle
- return if @angle_type == nil
- return if self.angle.between?(-0.5,0.5)
- case @angle_type
- when 0, 1 ; self.angle < 0 ? self.angle += 0.2 : self.angle -= 0.2
- when 2, 3 ; self.angle.between?(-5,5) ?
- self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 :
- self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5
- when 4, 5 ; self.angle.between?(-10,10) ? self.angle.between?(-4,4) ?
- self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 : # 2nd between
- self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5 : # 1st between
- self.angle < 0 ? self.angle += 2.5 : self.angle -= 2.5
- end
- end
- def dispose
- super
- if self.bitmap != nil
- self.bitmap.dispose
- end
- end
- end
- #==============================================================================
- class Sprite_MapIcon < Sprite_MapName
- #==============================================================================
- 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
- end
- def update
- return if self.disposed?
- super
- end
- def dispose
- super
- if self.bitmap != nil
- self.bitmap.dispose
- end
- 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
- return unless $game_map.map_name_icon[0]
- x = $game_map.map_name_icon_pos_x
- y = $game_map.map_name_icon_pos_y
- x = (Graphics.width / 2) - (12) if $game_map.map_name_icon_pos_x_center?
- y = (Graphics.height / 2) - (12) if $game_map.map_name_icon_pos_y_center?
- icon = $game_map.map_name_icon[1]
- @map_icon.dispose if @map_icon != nil
- @map_icon = Sprite_MapIcon.new(icon, x, y)
- end
- def create_map_name
- x = $game_map.map_name_position_x
- y = $game_map.map_name_position_y
- $game_temp.mapname = $game_map.display_name
- n = $game_map.display_name.to_s.split(//)
- @map_name = []
- timer = $game_map.map_name_LSD
- index = 0
- if $game_map.map_name_pos_center_x?
- fbvaal = $game_map.map_name_font_bold ? -4 : 0
- fbvaal -= $game_map.map_name_font_italic ? 4 : 0
- n_size = ($game_map.display_name.size+1) * ($game_map.map_name_font_size + fbvaal )
- x = (Graphics.width / 2) - (n_size / 2)
- end
- if $game_map.map_name_pos_center_y?
- fbvaal = $game_map.map_name_font_bold ? -4 : 0
- fbvaal -= $game_map.map_name_font_italic ? 4 : 0
- n_size = ($game_map.map_name_font_size + fbvaal )
- y = (Graphics.height / 2) - (n_size / 2)
- end
- for i in n
- @map_name.push( Sprite_MapName.new(i[0], x, y, timer, index))
- x += ($game_map.map_name_font_size / 4 * 3)
- timer += $game_map.map_name_LSD
- index += 1
- 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 @map_name != 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 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