Project1
标题:
显示地图名字的问题
[打印本页]
作者:
RPG文笔
时间:
2013-8-16 19:50
标题:
显示地图名字的问题
怎么修改字体的大小
#_______________________________________________________________________________
# 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
作者:
紫英晓狼1130
时间:
2013-8-16 20:13
请LZ看一下对Window_Base的定义里有一行
self.contents.font.size = 14
复制代码
应该是这里,但是自己没测试过,只是目测判断一下…
作者:
你最珍贵
时间:
2013-8-18 01:50
#_______________________________________________________________________________
# MOG_MPW Map_Name V1.2
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_Translated by Tabris Air.______________________________________________________________________________
module MOG
#描绘地图名称的字体名称,记得改成中文字体
MPFONT = "楷体_GB2312"
#字体大小
$NZZG = 24
#是否渐变
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 = $NZZG
#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 = 100
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
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1