Advertisement
Dekita

amn1.2

Jan 14th, 2013
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.04 KB | None | 0 0
  1. =begin =========================================================================
  2. Dekita's v1.2
  3. ★ Animatéd Map Namé™ ★
  4.  
  5. ================================================================================
  6. Script Information:
  7. ====================
  8. This script creates a highly dynamic and customisable map name "window"
  9. and gives the ability to remove the old (shit) one.
  10.  
  11. Features :~
  12. Multiple effect types,
  13. Each map can have its own unique map name display features, such as...
  14. Location, Icon, Font, Size, Effect, ect.
  15.  
  16. ================================================================================
  17. ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  18. ================================================================================
  19. 1. You must give credit to "Dekita"
  20. 2. You are NOT allowed to repost this script.(or modified versions)
  21. 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
  22. 4. You are NOT allowed to use this script for Commercial games.
  23. 5. ENJOY!
  24.  
  25. "FINE PRINT"
  26. By using this script you hereby agree to the above terms and conditions,
  27. if any violation of the above terms occurs "legal action" may be taken.
  28. Not understanding the above terms and conditions does NOT mean that
  29. they do not apply to you.
  30. If you wish to discuss the terms and conditions in further detail you can
  31. contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  32.  
  33. ================================================================================
  34. History:
  35. =========
  36. D /M /Y
  37. 11/o1/2o13 - increased efficiency,
  38. - added background option,
  39. - fixed bug, (icons not doing name effect properly)
  40. o9/o1/2o13 - added 18 effects,
  41. o8/o1/2o13 - added 8 effects,
  42. fixed bug, (typo)
  43. o6/o1/2o13 - started && finished,
  44.  
  45. ================================================================================
  46. Known Bugs:
  47. ============
  48. N/A
  49.  
  50. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  51. If a new bug is found please contact me at
  52. http://dekitarpg.wordpress.com/
  53.  
  54. ================================================================================
  55. INSTRUCTIONS:
  56. ==============
  57. Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
  58.  
  59. ================================================================================
  60. SCRIPT CALLS:
  61. =============
  62. reset_map_name
  63. ^ Does what it says.
  64.  
  65. ================================================================================
  66. NOTETAGS: (map noteboxes)
  67. ==========
  68.  
  69. Font_Name_Tags :
  70. <FONT NAME: X>
  71. <FN: X>
  72. replace X with the Font_Name array index.
  73.  
  74. Font_Size_Tags :
  75. <FONT SIZE: X>
  76. <FS: X>
  77. replace X with the font size.
  78.  
  79. Font_Bold_Tags :
  80. <FONT BOLD: bool>
  81. <FB: bool>
  82. replace bool with true or false
  83.  
  84. Font-italic_Tags :
  85. <FONT ITALIC: bool>
  86. <FI: bool>
  87. replace bool with true or false
  88.  
  89. Font_Color_Tags :
  90. (main color tags)
  91. <FONT COLOR: red, grn, blu, alp>
  92. <FC: red, grn, blu, alp>
  93. (outline color tags)
  94. <FONT OUT COLOR: red, grn, blu, alp>
  95. <FOC: red, grn, blu, alp>
  96. red = the red value of the font
  97. grn = the green value of the font
  98. blu = the blue value of the font
  99. alp = the alpha value of the font
  100.  
  101. Icon_id_Tags :
  102. <NAME ICON: X>
  103. <ICON: X>
  104. <NI: X>
  105. replace x with the icon id from your iconset
  106.  
  107. Icon_Position_Tags :
  108. <ICON POS: x, y>
  109. <IP, x, y>
  110. x / y = the screen position.
  111.  
  112. Icon_Center_Tags :
  113. <ICON CENTER: bool_X, bool_Y>
  114. <ICEN: bool_X, bool_Y>
  115. bool_X / bool_Y should be replaced with true or false e.g <ICEN: true, false>
  116. this would center the icon's x value in the middle but not the y
  117.  
  118. Icon_Effect_Tags :
  119. <ICON EFFECT: bool>
  120. <IC: bool>
  121. bool = true or false
  122.  
  123. Map_Name_Effect_Tags :
  124. <NAME EFFECT: id>
  125. <NAME EFF: id>
  126. <NE: id>
  127. id = the effect id for this map.
  128.  
  129. <NO NAME EFFECT>
  130. <NO NAME EFF>
  131. <NO NE>
  132. makes this map have no name effect
  133.  
  134. Map_Name_Slide_Tags :
  135. <NAME SLIDE: dist>
  136. <NS DIST: dist>
  137. <NSD: dist>
  138. dist = the distance of the slide, eg. 180
  139.  
  140. Map_Name_Position_Tags :
  141. <NAME POS: x, y>
  142. <NP: x, y>
  143. x, y = the position of the map name
  144.  
  145. <NAME CENTER: bool_X, bool_Y>
  146. <NCEN: bool_X, bool_Y>
  147. bool_X / bool_Y should be replaced with true or false e.g <NCEN: true, false>
  148. this would center the name's x value in the middle but not the y
  149.  
  150. Map_Name_L_S_D_Tags :
  151. <NAME DELAY: val>
  152. <ND: val>
  153. val = the delay value from one letter showing till the next.
  154.  
  155. BACKGROUND NOTETAGS :
  156. <BACKGROUND: "IMAGE NAME">
  157. <BG: "IMAGE NAME">
  158. These notetags will change the maps background image name,
  159. for use if you want t use a special image for a background box :p
  160.  
  161. <BGPOS: x, y>
  162. <BGP: x, y>
  163. Background box position.
  164.  
  165. <SHOW BG: bool>
  166. <SBG: bool>
  167. Do you want to show the background ? bool = true / false
  168.  
  169.  
  170. Single Huge Notetag :
  171. Tired of putting loads of litte '<' and '>' ? use this notetag .
  172. <MAP NAME>
  173. # -- notes go here
  174. <\MAP NAME>
  175. or
  176. <MNW>
  177. # -- notes go here
  178. <\MNW>
  179.  
  180. the notes for inside these notetags are the same as above without the '<' and '>'
  181. e.g
  182.  
  183. <MNW>
  184. FN: X
  185. FS: X
  186. FB: bool
  187. FI: bool
  188. FC: red, grn, blu, alp
  189. FOC: red, grn, blu, alp
  190. NI: X
  191. IP, x, y
  192. ICEN: bool_X, bool_Y
  193. IC: bool
  194. NE: id
  195. NO NE
  196. NSD: dist
  197. NP: x, y
  198. NCEN: bool_X, bool_Y
  199. ND: val
  200. BG: "IMAGENAME"
  201. BGP: x, y
  202. SBG: bool
  203. </MNW>
  204.  
  205. =end #=========================================================================#
  206. module Map_Name_Window
  207. Font_Name=[]#Do Not Delete.
  208.  
  209. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  210. # ★ GENERAL SETTINGS ★
  211. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  212.  
  213. Remove_Default_Name_Window = true # obviously...
  214.  
  215. # Z value for the new map name "window" reccommended to be about 200
  216. Map_Name_z = 200
  217.  
  218. # The delay from entering the map till the name begins to show. (Frames)
  219. Delay_Timer = 30
  220.  
  221. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  222. # ★ FONT SETTINGS ★
  223. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  224.  
  225. # This adjusts the fonts used for your maps. If the font at the start of
  226. # the array doesn't exist on the player's computer, it'll use the next one.
  227. # the games default font will be used if a maps font name is unspecified.
  228. Font_Name[0] = ["VL Gothic" , Font.default_name]
  229. Font_Name[1] = ["Arial" , Font.default_name]
  230. Font_Name[2] = ["Xirod" , Font.default_name]
  231. Font_Name[3] = ["Comic Sans MS", Font.default_name]
  232. Font_Name[4] = ["Verdana" , Font.default_name]
  233. Font_Name[5] = ["Arial" , Font.default_name]
  234. Font_Name[6] = ["Courier" , Font.default_name]
  235.  
  236. Font_Size = 18
  237.  
  238. Font_Bold = true
  239.  
  240. Font_Italic = true
  241.  
  242. Font_Color = [ 255, 255, 255, 255 ] # [ red, grn, blu, alpha ]
  243.  
  244. Font_Out_Col=[ 0 , 0 , 0 , 128 ] # Font outline color, same format as above.
  245.  
  246. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  247. # ★ ICON SETTINGS ★
  248. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  249.  
  250. #Icon= [ use? , icon id ]
  251. Icon = [ true , 304 ] # Default iconset map icon = 231
  252.  
  253. Icon_Pos = [10, 10] # [x, y] (position of the icon)
  254.  
  255. Icon_Has_Effects = true # Icon has the same effects as letters ?
  256.  
  257. Center_Icon = [ false , false ] # format = [ center x ? , center y ? ]
  258.  
  259. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  260. # ★ LETTER SETTINGS ★
  261. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  262.  
  263. Map_Name_Pos = [25, 5] # [x, y] (position of the first letter in the map name)
  264.  
  265. # The delay between each letter showing, this results in a fade like effect.
  266. L_S_D_Timer = 10
  267.  
  268. Center_Name = [ false , false ] # format = [ center x ? , center y ? ]
  269.  
  270. Slide_Distance = Graphics.width / 4 # the distance that letters slide.
  271.  
  272. Letter_Effects = true # do letters have effects ? e.g slide, spin...
  273.  
  274. L_Effect_Type = 0
  275. # 0 = Basic Left Slide
  276. # 1 = Basic Right Slide
  277. # 2 = Top Drop Left Slide
  278. # 3 = Top Drop Right Slide
  279. # 4 = Bottoms up Left Slide
  280. # 5 = Bottoms up Right Slide
  281. # 6 = Basic Left Spin
  282. # 7 = Basic Right Spin
  283. # 8 = Basic Left Swirl Top
  284. # 9 = Basic Left Swirl Bottom
  285. # 10 = Basic Right Swirl Bottom
  286. # 11 = Basic Right Swirl Top
  287. # 12 = Slide Up
  288. # 13 = Slide Down
  289. # 14 = Slide Up & Left
  290. # 15 = Slide Up & Right
  291. # 16 = Slide Down & Left
  292. # 17 = Slide Down & Right
  293. # 18 = Slide Up & Left, Left Spin
  294. # 19 = Slide Up & Left, Right Spin
  295. # 20 = Slide Up & Right, Left Spin
  296. # 21 = Slide Up & Right, Right Spin
  297. # 22 = Slide Down & Left, Left Spin
  298. # 23 = Slide Down & Left, Right Spin
  299. # 24 = Slide Down & Right, Left Spin
  300. # 25 = Slide Down & Right, Right Spin
  301.  
  302. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  303. # ★ BACKGROUND SETTINGS ★
  304. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  305.  
  306. # Basic background color , format = (red , green , blue , alpha)
  307. BackGound_Color_1 = Color.new(0,0,0,150)
  308. BackGound_Color_2 = Color.new(0,0,0,0)
  309.  
  310. Show_Background = true # self explanitory
  311.  
  312. # This is the name of the folder you want to store your map name bg images in,
  313. # This MUST be within your games poject folder.
  314. BG_Image_Folder = "Graphics/Map Windows/"
  315.  
  316. end # DO NOT DELETE #
  317. module M_N_W_RegExp #
  318. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  319. # ★ REGEXP SETTINGS ★
  320. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  321. # only change these if you know what you are doing.
  322. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  323. F_Name = /(?:FONT NAME|font name|FN|fn):[ ](\d+)/
  324. F_Size = /(?:FONT SIZE|FS):[ ](\d+)/i
  325. F_Bold = /(?:FONT BOLD|FB):[ ](.*)/i
  326. F_Ital = /(?:FONT ITALIC|FI):[ ](.*)/i
  327. F_Col_ = /(?:FONT COLOR|FC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
  328. F_OCol = /(?:FONT OUT COLOR|FOC):[ ](.*),[ ](.*),[ ](.*),[ ](.*)/i
  329. Icon = /(?:NAME ICON|ICON|NI):[ ](\d+)/i
  330. IPos = /(?:ICON POS|IP):[ ](\d+),[ ](\d+)/i
  331. ICent = /(?:ICON CENTER|ICEN):[ ](.*),[ ](.*)/i
  332. IEffs = /(?:ICON EFFECT|IEFF):[ ](.*)/i
  333. Eff = /(?:NAME EFFECT|NAME EFF|NE):[ ](\d+)/i
  334. NEff = /(?:NO NAME EFFECT|NO NAME EFF|NO NE)/i
  335. Slide = /(?:NAME SLIDE|NS DIST|NSD):[ ](\d+)/i
  336. Posi = /(?:NAME POS|NP):[ ](\d+),[ ](\d+)/i
  337. Pos2 = /(?:NAME CENTER|NCEN):[ ](.*),[ ](.*)/i
  338. LSD_ = /(?:NAME DELAY|ND):[ ](\d+)/i
  339. Large = /<(?:MAP NAME|MNW)>([^><]*)<\/(?:MAP NAME|MNW)>/im
  340. BG__ = /(?:BACKGROUND|BG):[ ]"(.*)"/i
  341. BGpos = /(?:BGPOS|BGP):[ ](\d+),[ ](\d+)/i
  342. BGshow = /(?:SHOW BG|SBG):[ ](.*)/i
  343. #####################
  344. # CUSTOMISATION END #
  345. end #####################
  346. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  347. # #
  348. # http://dekitarpg.wordpress.com/ #
  349. # #
  350. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  351. #===============================================================================#
  352. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  353. # YES?\.\. #
  354. # OMG, REALLY? \| #
  355. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  356. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  357. #===============================================================================#
  358.  
  359. $imported = {} if $imported.nil?
  360. $imported[:Dekita_Anim_Map_Name] = true
  361.  
  362. #===============================================================================#
  363. class RPG::Map
  364. #===============================================================================#
  365.  
  366. attr_reader(:map_name_font_name)
  367. attr_reader(:map_name_font_size)
  368. attr_reader(:map_name_font_bold)
  369. attr_reader(:map_name_font_ital)
  370. attr_reader(:map_name_font_col_)
  371. attr_reader(:map_name_font_ocol)
  372. attr_reader(:map_name_icon)
  373. attr_reader(:map_name_icon_pos)
  374. attr_reader(:map_name_icon_pos_centered)
  375. attr_reader(:map_name_icon_gets_effects)
  376. attr_reader(:map_name_effect)
  377. attr_reader(:map_name_slide_dist)
  378. attr_reader(:map_name_letter_show_delay)
  379. attr_reader(:map_name_position)
  380. attr_reader(:map_name_position_centered)
  381. attr_reader(:map_name_bg)
  382. attr_reader(:map_name_bg_pos)
  383. attr_reader(:map_name_bg_show)
  384.  
  385. def get_map_name_icon_info
  386. @map_name_font_name = Font.default_name
  387. @map_name_font_size = Map_Name_Window::Font_Size
  388. @map_name_font_bold = Map_Name_Window::Font_Bold
  389. @map_name_font_ital = Map_Name_Window::Font_Italic
  390. @map_name_font_col_ = Map_Name_Window::Font_Color
  391. @map_name_font_ocol = Map_Name_Window::Font_Out_Col
  392. @map_name_icon = Map_Name_Window::Icon
  393. @map_name_icon_pos = Map_Name_Window::Icon_Pos
  394. @map_name_icon_pos_centered = Map_Name_Window::Center_Icon
  395. @map_name_icon_gets_effects = Map_Name_Window::Icon_Has_Effects
  396. @map_name_effect = [Map_Name_Window::Letter_Effects,Map_Name_Window::L_Effect_Type]
  397. @map_name_slide_dist = Map_Name_Window::Slide_Distance
  398. @map_name_position = Map_Name_Window::Map_Name_Pos
  399. @map_name_position_centered = Map_Name_Window::Center_Name
  400. @map_name_letter_show_delay = Map_Name_Window::L_S_D_Timer
  401. @map_name_bg = nil
  402. @map_name_bg_pos = @map_name_position
  403. @map_name_bg_show = Map_Name_Window::Show_Background
  404. self.note.split(/[\r\n]+/).each { |line| ; case line
  405. when /<#{M_N_W_RegExp::F_Name}>/ ; @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i]
  406. when /<#{M_N_W_RegExp::F_Size}>/ ; @map_name_font_size = $1.to_i
  407. when /<#{M_N_W_RegExp::F_Bold}>/ ; @map_name_font_bold = $1.to_s
  408. when /<#{M_N_W_RegExp::F_Ital}>/ ; @map_name_font_ital = $1.to_s
  409. when /<#{M_N_W_RegExp::F_Col_}>/ ; @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i]
  410. when /<#{M_N_W_RegExp::F_OCol}>/ ; @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i,]
  411. when /<#{M_N_W_RegExp::Icon}>/ ; @map_name_icon = [true, $1.to_i]
  412. when /<#{M_N_W_RegExp::IPos}>/ ; @map_name_icon_pos = [$1.to_i, $2.to_i]
  413. when /<#{M_N_W_RegExp::ICent}>/ ; @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase]
  414. when /<#{M_N_W_RegExp::IEffs}>/ ; @map_name_icon_gets_effects = $1.to_s.downcase
  415. when /<#{M_N_W_RegExp::Eff}>/ ; @map_name_effect = [true, $1.to_i]
  416. when /<#{M_N_W_RegExp::NEff}>/ ; @map_name_effect = [false, 0]
  417. when /<#{M_N_W_RegExp::Slide}>/ ; @map_name_slide_dist = $1.to_i
  418. when /<#{M_N_W_RegExp::Posi}>/ ; @map_name_position = [$1.to_i, $2.to_i]
  419. when /<#{M_N_W_RegExp::Pos2}>/ ; @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase]
  420. when /<#{M_N_W_RegExp::LSD_}>/ ; @map_name_letter_show_delay = $1.to_i
  421. when /<#{M_N_W_RegExp::BG__}>/ ; @map_name_bg = $1.to_s
  422. when /<#{M_N_W_RegExp::BGpos}>/ ; @map_name_bg_pos = [$1.to_i, $2.to_i]
  423. when /<#{M_N_W_RegExp::BGshow}>/ ; @map_name_bg_show = $1.to_s.downcase
  424. end ; } # self.note.split
  425. get_mni(self.note)
  426. end
  427.  
  428. def get_mni(note)
  429. note.scan(M_N_W_RegExp::Large) { setup_map_name_info($1) }
  430. end
  431.  
  432. def setup_map_name_info(info)
  433. @map_name_font_name = Map_Name_Window::Font_Name[$1.to_i] if info =~ M_N_W_RegExp::F_Name
  434. @map_name_font_size = $1.to_i if info =~ M_N_W_RegExp::F_Size
  435. @map_name_font_bold = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Bold
  436. @map_name_font_ital = $1.to_s.downcase if info =~ M_N_W_RegExp::F_Ital
  437. @map_name_font_col_ = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_Col_
  438. @map_name_font_ocol = [$1.to_i,$2.to_i,$3.to_i,$4.to_i] if info =~ M_N_W_RegExp::F_OCol
  439. @map_name_icon = [true,$1.to_i] if info =~ M_N_W_RegExp::Icon
  440. @map_name_icon_pos = [$1.to_i, $2.to_i] if info =~ M_N_W_RegExp::IPos
  441. @map_name_icon_pos_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::ICent
  442. @map_name_icon_gets_effects = $1.to_s.downcase if info =~ M_N_W_RegExp::IEffs
  443. @map_name_effect = [true,$1.to_i] if info =~ M_N_W_RegExp::Eff
  444. @map_name_effect = [false, 0] if info =~ M_N_W_RegExp::NEff
  445. @map_name_slide_dist = $1.to_i if info =~ M_N_W_RegExp::Slide
  446. @map_name_position = [$1.to_i,$2.to_i] if info =~ M_N_W_RegExp::Posi
  447. @map_name_position_centered = [$1.to_s.downcase, $2.to_s.downcase] if info =~ M_N_W_RegExp::Pos2
  448. @map_name_letter_show_delay = $1.to_i if info =~ M_N_W_RegExp::LSD_
  449. @map_name_bg = $1.to_s if info =~ M_N_W_RegExp::BG__
  450. @map_name_bg_pos = [$1.to_i,$2.to_i] if info =~ M_N_W_RegExp::BGpos
  451. @map_name_bg_show = $1.to_s.downcase if info =~ M_N_W_RegExp::BGshow
  452. end
  453.  
  454. end
  455.  
  456. #==============================================================================
  457. module Cache
  458. #==============================================================================
  459.  
  460. def self.mapname_im(filename)
  461. load_bitmap(Map_Name_Window::BG_Image_Folder, filename)
  462. end
  463.  
  464. end
  465.  
  466. #==============================================================================
  467. class Game_Temp
  468. #==============================================================================
  469.  
  470. attr_accessor :mapname
  471.  
  472. alias :map_name_initialize_GT :initialize
  473. def initialize
  474. map_name_initialize_GT
  475. @mapname = nil
  476. end
  477.  
  478. end
  479.  
  480. #===============================================================================#
  481. class Game_Map
  482. #===============================================================================#
  483.  
  484. alias :map_nameGMsetup :setup
  485. def setup(map_id)
  486. map_nameGMsetup(map_id)
  487. @map.get_map_name_icon_info
  488. end
  489.  
  490. def setup_map_name_info
  491. end
  492.  
  493. def map_name_icon
  494. @map.map_name_icon
  495. end
  496.  
  497. def map_name_icon_pos_x
  498. @map.map_name_icon_pos[0]
  499. end
  500.  
  501. def map_name_icon_pos_y
  502. @map.map_name_icon_pos[1]
  503. end
  504.  
  505. def map_name_icon_pos_x_center?
  506. @map.map_name_icon_pos_centered[0]
  507. end
  508.  
  509. def map_name_icon_pos_y_center?
  510. @map.map_name_icon_pos_centered[1]
  511. end
  512.  
  513. def map_name_icon_effects?
  514. @map.map_name_icon_gets_effects
  515. end
  516.  
  517. def map_name_effect
  518. @map.map_name_effect
  519. end
  520.  
  521. def map_name_slide
  522. @map.map_name_slide_dist
  523. end
  524.  
  525. def map_name_font_name
  526. @map.map_name_font_name
  527. end
  528.  
  529. def map_name_font_size
  530. @map.map_name_font_size
  531. end
  532.  
  533. def map_name_font_bold
  534. @map.map_name_font_bold
  535. end
  536.  
  537. def map_name_font_italic
  538. @map.map_name_font_ital
  539. end
  540.  
  541. def map_name_position_x
  542. @map.map_name_position[0]
  543. end
  544.  
  545. def map_name_position_y
  546. @map.map_name_position[1]
  547. end
  548.  
  549. def map_name_pos_center_x?
  550. @map.map_name_position_centered[0]
  551. end
  552.  
  553. def map_name_pos_center_y?
  554. @map.map_name_position_centered[1]
  555. end
  556.  
  557. def map_name_LSD
  558. @map.map_name_letter_show_delay
  559. end
  560.  
  561. def map_name_font_color
  562. c = @map.map_name_font_col_
  563. Color.new(c[0],c[1],c[2],c[3])
  564. end
  565.  
  566. def map_name_font_out_color
  567. c = @map.map_name_font_ocol
  568. Color.new(c[0],c[1],c[2],c[3])
  569. end
  570.  
  571. def map_name_bg
  572. @map.map_name_bg
  573. end
  574.  
  575. def map_name_bg_x
  576. @map.map_name_bg_pos[0]
  577. end
  578.  
  579. def map_name_bg_y
  580. @map.map_name_bg_pos[1]
  581. end
  582.  
  583. def map_name_bg_showing?
  584. @map.map_name_bg_show
  585. end
  586.  
  587. end
  588.  
  589. #==============================================================================
  590. class Game_Interpreter
  591. #==============================================================================
  592.  
  593. def reset_map_name
  594. $game_temp.mapname = nil
  595. end
  596.  
  597. end
  598.  
  599. #==============================================================================
  600. class Sprite_MapName < Sprite
  601. #==============================================================================
  602.  
  603. include Map_Name_Window
  604.  
  605. def initialize(letter, x = 0, y = 0, timer = 0, index = 0)
  606. super(nil)
  607. create_variables(timer, index)
  608. get_letter_effects if @letter_effects[0]
  609. create_map_name(letter, x, y) if letter != nil
  610. end
  611.  
  612. def create_variables(t, i)
  613. @open = true
  614. @slide_left = false
  615. @slide_right = false
  616. @slide_up = false
  617. @slide_down = false
  618. @timer = t
  619. @timer_val = 0
  620. @letter_index = i
  621. @angle_type = nil
  622. @letter_effects = $game_map.map_name_effect
  623. @slide_distance = $game_map.map_name_slide
  624. end
  625.  
  626. def create_map_name(letter, x, y)
  627. size = $game_map.map_name_font_size
  628. self.bitmap = Bitmap.new(size,size)
  629. self.bitmap.font.name = $game_map.map_name_font_name
  630. self.bitmap.font.size = size
  631. self.bitmap.font.bold = $game_map.map_name_font_bold
  632. self.bitmap.font.italic = $game_map.map_name_font_italic
  633. self.bitmap.font.color = $game_map.map_name_font_color
  634. self.bitmap.font.out_color = $game_map.map_name_font_out_color
  635. self.bitmap.draw_text(0, 0, size, size, letter.to_s)
  636. self.x = x
  637. self.y = y + (size / 2).to_i
  638. self.z = Map_Name_z + 2
  639. self.opacity = 0
  640. end
  641.  
  642. def get_letter_effects
  643. case @letter_effects[1]
  644. when 0 ; basic_left_slide
  645. when 1 ; basic_right_slide
  646. when 2 ; basic_left_slide ; get_angle_type(0)
  647. when 3 ; basic_right_slide ; get_angle_type(1)
  648. when 4 ; basic_left_slide ; get_angle_type(1)
  649. when 5 ; basic_right_slide ; get_angle_type(0)
  650. when 6 ; basic_left_spin ; get_angle_type(2)
  651. when 7 ; basic_right_spin ; get_angle_type(3)
  652. when 8 ; basic_right_slide ; get_angle_type(4)
  653. when 9 ; basic_left_slide ; get_angle_type(4)
  654. when 10; basic_right_slide ; get_angle_type(5)
  655. when 11; basic_left_slide ; get_angle_type(5)
  656. when 12; basic_up_slide
  657. when 13; basic_down_slide
  658. when 14; basic_up_slide ; basic_left_slide
  659. when 15; basic_up_slide ; basic_right_slide
  660. when 16; basic_down_slide ; basic_left_slide
  661. when 17; basic_down_slide ; basic_right_slide
  662. when 18; basic_up_slide ;basic_left_slide; basic_left_spin ;get_angle_type(2)
  663. when 19; basic_up_slide ;basic_left_slide; basic_right_spin ;get_angle_type(3)
  664. when 20; basic_up_slide ;basic_right_slide; basic_left_spin ;get_angle_type(2)
  665. when 21; basic_up_slide ;basic_right_slide; basic_right_spin ;get_angle_type(3)
  666. when 22; basic_down_slide ;basic_left_slide ; basic_left_spin ;get_angle_type(2)
  667. when 23; basic_down_slide ;basic_left_slide ; basic_right_spin ;get_angle_type(3)
  668. when 24; basic_down_slide ;basic_right_slide ; basic_left_spin ;get_angle_type(2)
  669. when 25; basic_down_slide ;basic_right_slide ; basic_right_spin ;get_angle_type(3)
  670. end
  671. end
  672.  
  673. def basic_left_slide
  674. @slide_left = true
  675. self.ox = -(@slide_distance).to_i
  676. end
  677.  
  678. def basic_right_slide
  679. @slide_right = true
  680. self.ox = (@slide_distance).to_i
  681. end
  682.  
  683. def basic_up_slide
  684. @slide_up = true
  685. self.oy = -(@slide_distance).to_i
  686. end
  687.  
  688. def basic_down_slide
  689. @slide_down = true
  690. self.oy = (@slide_distance).to_i
  691. end
  692.  
  693. def basic_left_spin
  694. @move_for_spin = true
  695. end
  696.  
  697. def basic_right_spin
  698. @move_for_spin = true
  699. end
  700.  
  701. def get_angle_type(angle_type)
  702. @angle_type = angle_type
  703. case angle_type
  704. when 0 ; self.angle = 50
  705. when 1 ; self.angle = -50
  706. when 2 ; self.angle = -360
  707. when 3 ; self.angle = 360
  708. when 4 ; self.angle = (50 * (@timer / (@letter_index+1)))
  709. when 5 ; self.angle = -(50 * (@timer / (@letter_index+1)))
  710. end
  711. end
  712.  
  713. def update
  714. super
  715. update_timer
  716. update_show
  717. update_slide if @open
  718. update_angle if @angle_type != nil
  719. end
  720.  
  721. def update_timer
  722. return if @timer_val >= @timer
  723. @timer_val += 1
  724. self.opacity = 1
  725. end
  726.  
  727. def update_show
  728. self.opacity += 1 if @open
  729. self.opacity -= 1 if !@open
  730. @open = false if self.opacity >= 255
  731. end
  732.  
  733. def update_slide
  734. self.ox += 1 if self.ox < 0 && @slide_left
  735. self.ox -= 1 if self.ox > 0 && @slide_right
  736. self.oy += 1 if self.oy < 0 && @slide_up
  737. self.oy -= 1 if self.oy > 0 && @slide_down
  738. end
  739.  
  740. def update_angle
  741. return if @angle_type == nil
  742. return if self.angle.between?(-0.49,0.49)
  743. case @angle_type
  744. when 0, 1 ; self.angle < 0 ? self.angle += 0.2 : self.angle -= 0.2
  745. when 2, 3 ; self.angle.between?(-5,5) ?
  746. self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 :
  747. self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5
  748. when 4, 5 ; self.angle.between?(-10,10) ? self.angle.between?(-4,4) ?
  749. self.angle < 0 ? self.angle += 0.5 : self.angle -= 0.5 : # 2nd between
  750. self.angle < 0 ? self.angle += 1.5 : self.angle -= 1.5 : # 1st between
  751. self.angle < 0 ? self.angle += 2.5 : self.angle -= 2.5
  752. end
  753. end
  754.  
  755. def dispose
  756. super
  757. if self.bitmap != nil
  758. self.bitmap.dispose
  759. end
  760. end
  761.  
  762. end
  763.  
  764. #==============================================================================
  765. class Sprite_MapIcon < Sprite_MapName
  766. #==============================================================================
  767.  
  768. def initialize(icon, x = 0, y = 0, timer, index)
  769. super(nil, x, y, timer, index)
  770. self.bitmap = Cache.system("Iconset")
  771. rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
  772. self.bitmap.blt(0, 0, self.bitmap, rect)
  773. self.src_rect.set(rect.x, rect.y, 24, 24)
  774. self.x = x
  775. self.y = y
  776. self.z = Map_Name_z + 1
  777. end
  778.  
  779. def update
  780. super
  781. end
  782.  
  783. def dispose
  784. super
  785. if self.bitmap != nil
  786. self.bitmap.dispose
  787. end
  788. end
  789.  
  790. end
  791.  
  792. #==============================================================================
  793. class Sprite_MapName_BG < Sprite
  794. #==============================================================================
  795.  
  796. include Map_Name_Window
  797.  
  798. def initialize(x, y, width, height, image = nil)
  799. super(nil)
  800. self.z = Map_Name_z
  801. self.opacity = 0
  802. @open = true
  803. if image == nil
  804. create_standard_bg(x, y, width, height)
  805. else
  806. create_background_image(x, y, image)
  807. end
  808. @timer = 0
  809. update
  810. end
  811.  
  812. def create_standard_bg(x, y, width, height)
  813. self.bitmap = Bitmap.new(width,height)
  814. rect = Rect.new(0, 0,width,height)
  815. rect.width /= 2
  816. self.bitmap.gradient_fill_rect(rect, BackGound_Color_2, BackGound_Color_1)
  817. rect.x = rect.width
  818. self.bitmap.gradient_fill_rect(rect, BackGound_Color_1, BackGound_Color_2)
  819. self.x = x
  820. self.y = y + (height / 2 )
  821. end
  822.  
  823. def create_background_image(x, y, image)
  824. self.bitmap = Cache.mapname_im(image)
  825. self.x = x
  826. self.y = y
  827. end
  828.  
  829. def update
  830. super
  831. @timer += 1 if !@open
  832. self.opacity += 1 if @open
  833. self.opacity -= 1 if !@open
  834. @open = false if self.opacity >= 250
  835. end
  836.  
  837. def dispose
  838. super
  839. if self.bitmap != nil
  840. self.bitmap.dispose
  841. end
  842. end
  843.  
  844. end
  845.  
  846. #==============================================================================
  847. module Spriteset_Map_Name
  848. #==============================================================================
  849.  
  850. def init_map_name_set
  851. return if $game_temp.mapname == $game_map.display_name
  852. $game_temp.mapname = $game_map.display_name
  853. create_map_name
  854. create_map_name_BG
  855. create_map_name_icon
  856. @delay_timer = 0
  857. @display_mn_timer = 0
  858. end
  859.  
  860. def create_map_name_icon
  861. return unless $game_map.map_name_icon[0]
  862. x = $game_map.map_name_icon_pos_x
  863. y = $game_map.map_name_icon_pos_y
  864. x = (Graphics.width / 2) - (12) if $game_map.map_name_icon_pos_x_center?
  865. y = (Graphics.height / 2) - (12) if $game_map.map_name_icon_pos_y_center?
  866. timer = $game_map.map_name_LSD
  867. index = 0
  868. icon = $game_map.map_name_icon[1]
  869. @map_icon = Sprite_MapIcon.new(icon, x, y, timer, index)
  870. end
  871.  
  872. def create_map_name
  873. x = $game_map.map_name_position_x
  874. y = $game_map.map_name_position_y
  875. n = $game_map.display_name.to_s.split(//)
  876. @map_name = []
  877. timer = $game_map.map_name_LSD
  878. index = 0
  879. fbvaal = ($game_map.map_name_font_bold ? 0 : 0) + ($game_map.map_name_font_italic ? 0 : 0)
  880. if $game_map.map_name_pos_center_x?
  881. n_size = ($game_map.display_name.size+1) * ($game_map.map_name_font_size + fbvaal )
  882. x = (Graphics.width / 2) - (n_size / 2)
  883. end
  884. if $game_map.map_name_pos_center_y?
  885. n_size = ($game_map.map_name_font_size + fbvaal )
  886. y = (Graphics.height / 2) - (n_size / 2)
  887. end
  888. for i in n
  889. @map_name.push( Sprite_MapName.new(i[0], x, y, timer, index))
  890. x += ($game_map.map_name_font_size / 4 * 3)
  891. timer += $game_map.map_name_LSD
  892. index += 1
  893. end
  894. end
  895.  
  896. def create_map_name_BG
  897. return unless $game_map.map_name_bg_showing?
  898. timer = $game_map.map_name_LSD
  899. mbgwid = ($game_map.display_name.size) * @map_name[0].width / 4 * 3
  900. mbghei = @map_name[0].height
  901. mbgx = $game_map.map_name_bg_x
  902. mbgy = $game_map.map_name_bg_y
  903. image = $game_map.map_name_bg
  904. @map_BG = Sprite_MapName_BG.new(mbgx, mbgy, mbgwid, mbghei, image) if @map_name != nil
  905. end
  906.  
  907. def update_map_name_set
  908. if $game_temp.mapname != $game_map.display_name
  909. dispose_map_name_set
  910. init_map_name_set
  911. end
  912. return if @map_name == nil
  913. return if @map_icon == nil
  914. return if @map_BG == nil
  915. update_map_name_DPBz
  916. update_map_name_BG
  917. update_map_name_icon
  918. @display_mn_timer += 1
  919. if @display_mn_timer > 600
  920. @map_name.each {|i| return if i.opacity > 0 }
  921. return if @map_icon.opacity > 0
  922. return if @map_BG.opacity > 0
  923. dispose_map_name_set
  924. end
  925. end
  926.  
  927. def update_map_name_DPBz
  928. return if @delay_timer == nil
  929. @delay_timer += 1
  930. return unless @delay_timer >= Map_Name_Window::Delay_Timer
  931. @map_name.each {|sprite| sprite.update } if @map_name != nil
  932. end
  933.  
  934. def update_map_name_BG
  935. @map_BG.update if @map_BG != nil
  936. end
  937.  
  938. def update_map_name_icon
  939. @map_icon.update if @map_icon != nil
  940. end
  941.  
  942. def dispose_map_name_set
  943. @map_BG.dispose if @map_BG != nil
  944. @map_icon.dispose if @map_icon != nil
  945. @map_name.each {|sprite| sprite.dispose } if @map_name != nil
  946. @map_BG = nil
  947. @map_icon = nil
  948. @map_name = nil
  949. @delay_timer = nil
  950. end
  951.  
  952. end
  953.  
  954. #==============================================================================
  955. class Spriteset_Map
  956. #==============================================================================
  957.  
  958. include Spriteset_Map_Name
  959.  
  960. alias :initialize_map_name :initialize
  961. alias :dispose_map_name :dispose
  962. alias :update_map_name :update
  963.  
  964. def initialize
  965. initialize_map_name
  966. init_map_name_set
  967. end
  968.  
  969. def dispose
  970. dispose_map_name
  971. dispose_map_name_set
  972. end
  973.  
  974. def update
  975. update_map_name
  976. update_map_name_set
  977. end
  978.  
  979. end
  980.  
  981. #==============================================================================
  982. class Window_MapName < Window_Base
  983. #==============================================================================
  984.  
  985. if Map_Name_Window::Remove_Default_Name_Window
  986.  
  987. def refresh
  988. contents.clear
  989. end
  990.  
  991. end # if Map_Name_Window::Remove_Default_Name_Window
  992.  
  993. end
  994.  
  995. #==============================================================================#
  996. # - SCRIPT END - #
  997. #==============================================================================#
  998. # http://dekitarpg.wordpress.com/ #
  999. #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement