设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2450|回复: 5
打印 上一主题 下一主题

[已经过期] 为什么用了地图名显示脚本会这样?

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1058
在线时间
878 小时
注册时间
2012-6-28
帖子
1079
1
发表于 2012-9-1 21:15:07 | 显示全部楼层
本帖最后由 没是的人 于 2012-9-1 21:16 编辑
  1. #_______________________________________________________________________________
  2. # MOG_MPW Map_Name V1.2            
  3. #_______________________________________________________________________________
  4. # By Moghunter      
  5. # http://www.atelier-rgss.com


  6. #_Translated by Tabris Air.______________________________________________________________________________
  7. module MOG
  8. #描绘地图名称的字体名称,记得改成中文字体
  9. MPFONT = "楷体_GB2312"
  10. #是否渐变
  11. MPNMFD = true
  12. #渐变时间(单位秒)
  13. MPNMTM = 10
  14. #显示位置
  15. # 0 = 上方左侧
  16. # 1 = 下方左侧
  17. # 2 = 上方右侧
  18. # 3 = 下方右侧
  19. MPNMPS = 3
  20. # 打开该开关时不显示地名
  21. WM_SWITCH_VIS_DISABLE = 8
  22. end
  23. #_________________________________________________
  24. $mogscript = {} if $mogscript == nil
  25. $mogscript["mpmapname"] = true
  26. ###############
  27. # Game_System #
  28. ###############
  29. class Game_System
  30. attr_accessor :fdtm
  31. attr_accessor :mpnm_x
  32. attr_accessor :mpnm_y
  33. alias mog24_initialize initialize
  34. def initialize
  35. mog24_initialize
  36. @fdtm = 255 + 40 * MOG::MPNMTM
  37. if MOG::MPNMPS == 0
  38. @mpnm_x = -300
  39. @mpnm_y = 0
  40. elsif MOG::MPNMPS == 1
  41. @mpnm_x = -300
  42. @mpnm_y = 380
  43. elsif MOG::MPNMPS == 2
  44. @mpnm_x = 640
  45. @mpnm_y = 0
  46. else
  47. @mpnm_x = 640
  48. @mpnm_y = 380
  49. end  
  50. end
  51. def mpnm_x
  52. return @mpnm_x
  53. end
  54. def mpnm_y
  55. return @mpnm_y
  56. end
  57. def fdtm
  58. if @fdtm <= 0
  59. @fdtm = 0
  60. end
  61. return @fdtm
  62. end
  63. end
  64. ############
  65. # Game_Map #
  66. ############
  67. class Game_Map
  68. attr_reader   :map_id  
  69. def mpname
  70. $mpname = load_data("Data/MapInfos.rxdata")
  71. $mpname[@map_id].name
  72. end
  73. end
  74. ###############
  75. # Window Base #
  76. ###############
  77. class Window_Base < Window
  78. def nd_mapic
  79. mapic = RPG::Cache.picture("")     
  80. end  
  81. def draw_mpname(x,y)
  82. mapic = RPG::Cache.picture("Mpname") rescue nd_mapic   
  83. cw = mapic.width
  84. ch = mapic.height
  85. src_rect = Rect.new(10, 0, cw, ch)
  86. self.contents.blt(x , 10, mapic, src_rect)
  87. self.contents.font.name = MOG::MPFONT
  88. self.contents.font.size = 14
  89. #self.contents.font.color = Color.new(0,0,0,255)
  90. #self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
  91. self.contents.font.color = Color.new(231,206,156,255)
  92. self.contents.draw_text(x + 75, 5, 110, 32, $game_map.mpname.to_s ,1)
  93. end
  94. end
  95. ##########
  96. # Mpname #
  97. ##########
  98. class Mpname < Window_Base
  99. def initialize
  100. super($game_system.mpnm_x, 0, 250, 100)
  101. self.contents = Bitmap.new(width - 32, height - 32)
  102. self.opacity = 0
  103. refresh
  104. end
  105. def refresh
  106. self.contents.clear
  107. draw_mpname(10,-20)   
  108. end
  109. end
  110. #############
  111. # Scene_Map #
  112. #############
  113. class Scene_Map
  114. alias mog24_main main
  115. def main
  116. @mpnm = Mpname.new
  117. @mpnm.contents_opacity = $game_system.fdtm
  118. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  119. @mpnm.visible = true
  120. else
  121. @mpnm.visible = false  
  122. end  
  123. mog24_main
  124. @mpnm.dispose
  125. end
  126. alias mog24_update update
  127. def update
  128. mog24_update  
  129. $game_system.mpnm_x = @mpnm.x
  130. @mpnm.y = -25
  131. $game_system.mpnm_y = -20
  132. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  133. if $game_system.fdtm <= 0
  134. @mpnm.visible = false  
  135. else
  136. @mpnm.visible = true  
  137. end
  138. else
  139. @mpnm.visible = false  
  140. end
  141. if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
  142. if @mpnm.x < 0
  143.    @mpnm.x += 8
  144. elsif @mpnm.x >= 0
  145.    @mpnm.x = 0
  146. end   
  147. else
  148. if @mpnm.x > 410
  149.    @mpnm.x -= 8
  150. elsif @mpnm.x <= 410
  151.    @mpnm.x = 410
  152. end     
  153. end
  154. @mpnm.contents_opacity = $game_system.fdtm
  155. if MOG::MPNMFD == true
  156. $game_system.fdtm -= 3
  157. end
  158. end
  159. alias mog24_transfer_player transfer_player
  160. def transfer_player
  161. mog24_transfer_player
  162. if MOG::MPNMPS == 0
  163. $game_system.mpnm_x = -300
  164. $game_system.mpnm_y = 0
  165. elsif MOG::MPNMPS == 1
  166. $game_system.mpnm_x = -300
  167. $game_system.mpnm_y = 0
  168. elsif MOG::MPNMPS == 2
  169. $game_system.mpnm_x = 640
  170. $game_system.mpnm_y = 100
  171. else
  172. $game_system.mpnm_x = 640
  173. $game_system.mpnm_y = 0
  174. end  
  175. @mpnm.y = $game_system.mpnm_y
  176. @mpnm.x = $game_system.mpnm_x
  177. $game_system.fdtm = 255 + 40 * MOG::MPNMTM
  178. @mpnm.refresh
  179. end
  180. end
复制代码
试试这个,记得在Graphics\Pictures文件夹加个背景图片,名字为Mpname
比如这样的

评分

参与人数 1星屑 +20 收起 理由
hcm + 20 感谢回答

查看全部评分

不追求华丽的商业素材;不依赖与自己运用能力不符的外挂脚本;不搞华而不实的无用噱头。
                    修改,使用最朴实的素材,融入自己的智慧做最好的游戏!
                                    点这里!暂不设加入门槛
         
                               我觉得我的优点是,会认真的画每一张地图。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 07:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表