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

Project1

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

[已经解决] 显示地图名字的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
135 小时
注册时间
2013-8-7
帖子
79
跳转到指定楼层
1
发表于 2013-8-16 19:50:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
怎么修改字体的大小



#_______________________________________________________________________________
# MOG_MPW Map_Name V1.2            
#_______________________________________________________________________________
# By Moghunter      
# http://www.atelier-rgss.com


#_Translated by Tabris Air.______________________________________________________________________________
module MOG
#描绘地图名称的字体名称,记得改成中文字体
MPFONT = "楷体_GB2312"
#是否渐变
MPNMFD = true
#渐变时间(单位秒)
MPNMTM = 60
#显示位置
# 0 = 上方左侧
# 1 = 下方左侧
# 2 = 上方右侧
# 3 = 下方右侧
MPNMPS = 2
# 打开该开关时不显示地名
WM_SWITCH_VIS_DISABLE = 8
end
#_________________________________________________
$mogscript = {} if $mogscript == nil
$mogscript["mpmapname"] = true
###############
# Game_System #
###############
class Game_System
attr_accessor :fdtm
attr_accessor :mpnm_x
attr_accessor :mpnm_y
alias mog24_initialize initialize
def initialize
mog24_initialize
@fdtm = 255 + 40 * MOG::MPNMTM
if MOG::MPNMPS == 0
@mpnm_x = -300
@mpnm_y = 0
elsif MOG::MPNMPS == 1
@mpnm_x = -300
@mpnm_y = 380
elsif MOG::MPNMPS == 2
@mpnm_x = 640
@mpnm_y = 0
else
@mpnm_x = 640
@mpnm_y = 380
end  
end
def mpnm_x
return @mpnm_x
end
def mpnm_y
return @mpnm_y
end
def fdtm
if @fdtm <= 0
@fdtm = 0
end
return @fdtm
end
end
############
# Game_Map #
############
class Game_Map
attr_reader   :map_id  
def mpname
$mpname = load_data("Data/MapInfos.rxdata")
$mpname[@map_id].name
end
end
###############
# Window Base #
###############
class Window_Base < Window
def nd_mapic
mapic = RPG::Cache.picture("")     
end  
def draw_mpname(x,y)
mapic = RPG::Cache.picture("Mpname") rescue nd_mapic   
cw = mapic.width
ch = mapic.height
src_rect = Rect.new(10, 0, cw, ch)
self.contents.blt(x , 10, mapic, src_rect)
self.contents.font.name = MOG::MPFONT
self.contents.font.size = 14
#self.contents.font.color = Color.new(0,0,0,255)
#self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
self.contents.font.color = Color.new(231,206,156,255)
self.contents.draw_text(x + 75, 5, 110, 32, $game_map.mpname.to_s ,1)
end
end
##########
# Mpname #
##########
class Mpname < Window_Base
def initialize
super($game_system.mpnm_x, 0, 250, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
def refresh
self.contents.clear
draw_mpname(10,-20)   
end
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog24_main main
def main
@mpnm = Mpname.new
@mpnm.contents_opacity = $game_system.fdtm
if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
@mpnm.visible = true
else
@mpnm.visible = false  
end  
mog24_main
@mpnm.dispose
end
alias mog24_update update
def update
mog24_update  
$game_system.mpnm_x = @mpnm.x
@mpnm.y = -25
$game_system.mpnm_y = -20
if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
if $game_system.fdtm <= 0
@mpnm.visible = false  
else
@mpnm.visible = true  
end
else
@mpnm.visible = false  
end
if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
if @mpnm.x < 0
   @mpnm.x += 8
elsif @mpnm.x >= 0
   @mpnm.x = 0
end   
else
if @mpnm.x > 410
   @mpnm.x -= 8
elsif @mpnm.x <= 410
   @mpnm.x = 410
end     
end
@mpnm.contents_opacity = $game_system.fdtm
if MOG::MPNMFD == true
$game_system.fdtm -= 3
end
end
alias mog24_transfer_player transfer_player
def transfer_player
mog24_transfer_player
if MOG::MPNMPS == 0
$game_system.mpnm_x = -300
$game_system.mpnm_y = 0
elsif MOG::MPNMPS == 1
$game_system.mpnm_x = -300
$game_system.mpnm_y = 0
elsif MOG::MPNMPS == 2
$game_system.mpnm_x = 640
$game_system.mpnm_y = 0
else
$game_system.mpnm_x = 640
$game_system.mpnm_y = 0
end  
@mpnm.y = $game_system.mpnm_y
@mpnm.x = $game_system.mpnm_x
$game_system.fdtm = 255 + 40 * MOG::MPNMTM
@mpnm.refresh
end
end

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2013-8-16 20:13:59 | 只看该作者
请LZ看一下对Window_Base的定义里有一行
  1. self.contents.font.size = 14
复制代码
应该是这里,但是自己没测试过,只是目测判断一下…
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv2.观梦者

故九江太守

梦石
0
星屑
573
在线时间
2161 小时
注册时间
2012-12-5
帖子
4463
3
发表于 2013-8-18 01:50:32 | 只看该作者
  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. $NZZG = 24
  12. #是否渐变
  13. MPNMFD = true
  14. #渐变时间(单位秒)
  15. MPNMTM = 60
  16. #显示位置
  17. # 0 = 上方左侧
  18. # 1 = 下方左侧
  19. # 2 = 上方右侧
  20. # 3 = 下方右侧
  21. MPNMPS = 2
  22. # 打开该开关时不显示地名
  23. WM_SWITCH_VIS_DISABLE = 8
  24. end
  25. #_________________________________________________
  26. $mogscript = {} if $mogscript == nil
  27. $mogscript["mpmapname"] = true
  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 mog24_initialize initialize
  36. def initialize
  37. mog24_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 = 380
  45. elsif MOG::MPNMPS == 2
  46. @mpnm_x = 640
  47. @mpnm_y = 0
  48. else
  49. @mpnm_x = 640
  50. @mpnm_y = 380
  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.rxdata")
  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 = RPG::Cache.picture("")     
  82. end  
  83. def draw_mpname(x,y)
  84. mapic = RPG::Cache.picture("Mpname") rescue nd_mapic   
  85. cw = mapic.width
  86. ch = mapic.height
  87. src_rect = Rect.new(10, 0, cw, ch)
  88. self.contents.blt(x , 10, mapic, src_rect)
  89. self.contents.font.name = MOG::MPFONT
  90. self.contents.font.size = $NZZG
  91. #self.contents.font.color = Color.new(0,0,0,255)
  92. #self.contents.draw_text(x + 76, y + 27, 110, 32, $game_map.mpname.to_s,1)
  93. self.contents.font.color = Color.new(231,206,156,255)
  94. self.contents.draw_text(x + 75, 5, 110, 32, $game_map.mpname.to_s ,1)
  95. end
  96. end
  97. ##########
  98. # Mpname #
  99. ##########
  100. class Mpname < Window_Base
  101. def initialize
  102. super($game_system.mpnm_x, 0, 250, 100)
  103. self.contents = Bitmap.new(width - 32, height - 32)
  104. self.opacity = 100
  105. refresh
  106. end
  107. def refresh
  108. self.contents.clear
  109. draw_mpname(10,-20)   
  110. end
  111. end
  112. #############
  113. # Scene_Map #
  114. #############
  115. class Scene_Map
  116. alias mog24_main main
  117. def main
  118. @mpnm = Mpname.new
  119. @mpnm.contents_opacity = $game_system.fdtm
  120. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  121. @mpnm.visible = true
  122. else
  123. @mpnm.visible = false  
  124. end  
  125. mog24_main
  126. @mpnm.dispose
  127. end
  128. alias mog24_update update
  129. def update
  130. mog24_update  
  131. $game_system.mpnm_x = @mpnm.x
  132. @mpnm.y = -25
  133. $game_system.mpnm_y = -20
  134. if $game_switches[MOG::WM_SWITCH_VIS_DISABLE] == false
  135. if $game_system.fdtm <= 0
  136. @mpnm.visible = false  
  137. else
  138. @mpnm.visible = true  
  139. end
  140. else
  141. @mpnm.visible = false  
  142. end
  143. if MOG::MPNMPS == 0 or MOG::MPNMPS == 1
  144. if @mpnm.x < 0
  145.    @mpnm.x += 8
  146. elsif @mpnm.x >= 0
  147.    @mpnm.x = 0
  148. end   
  149. else
  150. if @mpnm.x > 410
  151.    @mpnm.x -= 8
  152. elsif @mpnm.x <= 410
  153.    @mpnm.x = 410
  154. end     
  155. end
  156. @mpnm.contents_opacity = $game_system.fdtm
  157. if MOG::MPNMFD == true
  158. $game_system.fdtm -= 3
  159. end
  160. end
  161. alias mog24_transfer_player transfer_player
  162. def transfer_player
  163. mog24_transfer_player
  164. if MOG::MPNMPS == 0
  165. $game_system.mpnm_x = -300
  166. $game_system.mpnm_y = 0
  167. elsif MOG::MPNMPS == 1
  168. $game_system.mpnm_x = -300
  169. $game_system.mpnm_y = 0
  170. elsif MOG::MPNMPS == 2
  171. $game_system.mpnm_x = 640
  172. $game_system.mpnm_y = 0
  173. else
  174. $game_system.mpnm_x = 640
  175. $game_system.mpnm_y = 0
  176. end  
  177. @mpnm.y = $game_system.mpnm_y
  178. @mpnm.x = $game_system.mpnm_x
  179. $game_system.fdtm = 255 + 40 * MOG::MPNMTM
  180. @mpnm.refresh
  181. end
  182. end
复制代码

评分

参与人数 1星屑 +90 收起 理由
︶ㄣ牛排ぶ + 90 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 18:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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