Project1

标题: 如何写上地图的名字 [打印本页]

作者: 酷死了    时间: 2012-4-8 10:07
标题: 如何写上地图的名字
本帖最后由 「旅」 于 2012-4-8 12:34 编辑

这张图片,怎么在我圈的地方,写上这张地图的名字:比如说【家里】,谢谢dsu_plus_rewardpost_czw
作者: 以战止战    时间: 2012-4-8 11:20
请自行点击图书馆 找到相关内容
作者: hcm    时间: 2012-4-8 12:15
  1. #_______________________________________________________________________________
  2. # MOG_Location_Name_VX V1.0            
  3. #_______________________________________________________________________________
  4. # By Moghunter      
  5. # http://www.atelier-rgss.com
  6. #_______________________________________________________________________________
  7. # Apresenta uma janela com o nome do map.
  8. # É necessário ter uma imagem com o nome de  MAPNAME
  9. # dentro da pasta Graphics/System.
  10. #_______________________________________________________________________________
  11. module MOG
  12. #Font Name.
  13. MPFONT = "Georgia"
  14. #Fade ON/OFF(True - False).
  15. MPNMFD = true
  16. #Fade Time.
  17. MPNMTM = 10
  18. #Window Position.
  19. # 0 = Upper Left.
  20. # 1 = Lower Left.
  21. # 2 = Upper Right.
  22. # 3 = Lower Right.
  23. MPNMPS = 2
  24. # Disable Switch(ID).
  25. WM_SWITCH_VIS_DISABLE = 15
  26. end
  27. #_________________________________________________
  28. ###############
  29. # Game_System #
  30. ###############
  31. class Game_System
  32. attr_accessor :fdtm
  33. attr_accessor :mpnm_x
  34. attr_accessor :mpnm_y
  35. alias mog_vx06_initialize initialize
  36. def initialize
  37. mog_vx06_initialize
  38. @fdtm = 255 + 40 * MOG::MPNMTM
  39. if MOG::MPNMPS == 0
  40. @mpnm_x = -300
  41. @mpnm_y = 0
  42. elsif MOG::MPNMPS == 1
  43. @mpnm_x = -300
  44. @mpnm_y = 320
  45. elsif MOG::MPNMPS == 2
  46. @mpnm_x = 640
  47. @mpnm_y = 0
  48. else
  49. @mpnm_x = 640
  50. @mpnm_y = 320
  51. end  
  52. end
  53. def mpnm_x
  54. return @mpnm_x
  55. end
  56. def mpnm_y
  57. return @mpnm_y
  58. end
  59. def fdtm
  60. if @fdtm <= 0
  61. @fdtm = 0
  62. end
  63. return @fdtm
  64. end
  65. end
  66. ############
  67. # Game_Map #
  68. ############
  69. class Game_Map
  70. attr_reader   :map_id  
  71. def mpname
  72. $mpname = load_data("Data/MapInfos.rvdata")
  73. $mpname[@map_id].name
  74. end
  75. end
  76. ###############
  77. # Window Base #
  78. ###############
  79. class Window_Base < Window
  80. def nd_mapic
  81. mapic = Cache.system("")     
  82. end  
  83. def draw_mpname(x,y)
  84. mapic = Cache.system("Mpname") rescue nd_mapic   
  85. cw = mapic.width  
  86. ch = mapic.height
  87. src_rect = Rect.new(0, 0, cw, ch)
  88. self.contents.blt(x , y - ch + 65, mapic, src_rect)
  89. self.contents.font.name = MOG::MPFONT
  90. self.contents.font.size = 22
  91. self.contents.font.bold = true
  92. self.contents.font.shadow = true
  93. self.contents.font.color = Color.new(0,0,0,255)
  94. self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
  95. self.contents.font.color = Color.new(255,255,255,255)
  96. self.contents.draw_text(x + 75, y + 26, 110, 32, $game_map.mpname.to_s,1)
  97. end
  98. end
  99. ##########
  100. # Mpname #
  101. ##########
  102. class Mpname < Window_Base
  103. def initialize(x , y)
  104. super($game_system.mpnm_x, $game_system.mpnm_y, 250, WLH + 70)
  105. self.opacity = 0
  106. refresh
  107. end
  108. def refresh
  109. self.contents.clear
  110. draw_mpname(10,0)   
  111. end
  112. end
  113. #############
  114. # Scene_Map #
  115. #############
  116. class Scene_Map
  117. alias mog_vx06_start start
  118. def start
  119. @mpnm = Mpname.new($game_system.mpnm_x, $game_system.mpnm_y)
  120. @mpnm.contents_opacity = $game_system.fdtm
  121. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  122. @mpnm.visible = true
  123. else
  124. @mpnm.visible = false  
  125. end  
  126. mog_vx06_start  
  127. end  
  128. alias mog_vx06_terminate terminate
  129. def terminate
  130. mog_vx06_terminate
  131. @mpnm.dispose
  132. end
  133. alias mog_vx06_update update
  134. def update
  135. mog_vx06_update  
  136. location_name_update
  137. end
  138. def location_name_update
  139. $game_system.mpnm_x = @mpnm.x
  140. $game_system.mpnm_y = @mpnm.y
  141. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == true or $game_system.fdtm <= 0
  142. @mpnm.visible = false  
  143. else
  144. @mpnm.visible = true
  145. end
  146. if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
  147. if @mpnm.x < 0
  148. @mpnm.x += 5
  149. elsif @mpnm.x >= 0
  150. @mpnm.x = 0
  151. end   
  152. else
  153. if @mpnm.x > 300
  154. @mpnm.x -= 5
  155. elsif @mpnm.x <= 300
  156. @mpnm.x = 300
  157. end     
  158. end
  159. @mpnm.contents_opacity = $game_system.fdtm
  160. if MOG::MPNMFD == true
  161. $game_system.fdtm -= 3
  162. end
  163. end
  164. alias mog_vx06_update_transfer_player update_transfer_player
  165. def update_transfer_player
  166. return unless $game_player.transfer?
  167. @mpnm.contents_opacity = 0
  168. mog_vx06_update_transfer_player
  169. if MOG::MPNMPS == 0
  170. $game_system.mpnm_x = -340
  171. $game_system.mpnm_y = 0
  172. elsif MOG::MPNMPS == 1
  173. $game_system.mpnm_x = -340
  174. $game_system.mpnm_y = 320
  175. elsif MOG::MPNMPS == 2
  176. $game_system.mpnm_x = 640
  177. $game_system.mpnm_y = 0
  178. else
  179. $game_system.mpnm_x = 640
  180. $game_system.mpnm_y = 320
  181. end  
  182. @mpnm.y = $game_system.mpnm_y
  183. @mpnm.x = $game_system.mpnm_x
  184. $game_system.fdtm = 255 + 60 * MOG::MPNMTM
  185. @mpnm.refresh
  186. end
  187. end
  188. $mogscript = {} if $mogscript == nil
  189. $mogscript["location_name_vx"] = true
复制代码

作者: 酷死了    时间: 2012-4-8 13:00
hcm 发表于 2012-4-8 12:15

问一下,这个脚本放在哪
作者: hcm    时间: 2012-4-8 13:03
酷死了 发表于 2012-4-8 13:00
问一下,这个脚本放在哪

在main前单击右键插入,再粘贴上。
作者: 酷死了    时间: 2012-4-8 14:20
hcm 发表于 2012-4-8 13:03
在main前单击右键插入,再粘贴上。

谢谢了,真的是太感谢你了




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1