| 赞 | 0  | 
 
| VIP | 2 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 8041 | 
 
| 最后登录 | 2021-5-13 | 
 
| 在线时间 | 60 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 55 
 
        - 在线时间
 - 60 小时
 
        - 注册时间
 - 2009-7-16
 
        - 帖子
 - 199
 
 
 
 | 
	
先把字体文件放在游戏目录中,再在main前插入如下脚本- dir = Win32API.new('kernel32','GetSystemDirectory','p,l','l')
 
 - dir_str = " " * 256
 
 - dir.call(dir_str,255)
 
 - dir_str = dir_str.split('system')[0]
 
  
- font_name = "字体文件名称" 
 
 - font_chn_name = "字体名称"
 
  
- if FileTest.exist?(font_name)
 
 -  copy = Win32API.new('kernel32',"CopyFileA",'p,p,l','')
 
 -  copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
 
 -  font = Win32API.new('gdi32','AddFontResourceA','p','l')
 
 -  sendmsg = Win32API.new('user32','SendMessageA','l,l,l,l','l')
 
 -  unless Font.exist?(font_chn_name)
 
 -    font.call(font_name)
 
 -    sendmsg.call(65535,29,0,0)
 
 -    retry
 
 -  end
 
 - end
 
  复制代码 然后把main改成- #==============================================================================
 
 - # ■ Main
 
 - #------------------------------------------------------------------------------
 
 - #  各定义结束后、从这里开始实际处理。
 
 - #==============================================================================
 
  
- begin
 
 -   # 准备过渡
 
 -   # 设置系统默认字体
 
 -   Font.default_name = (["字体名称"])
 
 -   Graphics.freeze
 
 -   # 生成场景对像 (标题画面)
 
 -   $scene = Scene_Title.new
 
 -   # $scene 为有效的情况下调用 main 过程
 
 -   while $scene != nil
 
 -     $scene.main
 
 -   end
 
 -   # 淡入淡出
 
 -   Graphics.transition(20)
 
 - rescue Errno::ENOENT
 
 -   # 补充 Errno::ENOENT 以外错误
 
 -   # 无法打开文件的情况下、显示信息后结束
 
 -   filename = $!.message.sub("No such file or directory - ", "")
 
 -   print("找不到文件 #{filename}。 ")
 
 - end
 
 
  复制代码 |   
 
 
 
 |