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

Project1

 找回密码
 注册会员
搜索

BitmapFont-位图字体

查看数: 1880 | 评论数: 1 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-9-1 17:11

正文摘要:

位图字体类呢 简单来说就是 用文字的图像和文字在图像中的位置数据结合成的一个绘制位图的工具 比如像这样子的:

回复

fux2 发表于 2016-9-3 09:09:12
RM里转码无非是用MultiByteToWideChar和WideCharToMultiByte
  1. # 声明
  2.   MultiByteToWideChar = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i')
  3.   WideCharToMultiByte = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i')
  4.   #--------------------------------------------------------------------------
  5.   # ● 转码:系统转UTF-8
  6.   #--------------------------------------------------------------------------
  7.   def s2u(text)
  8.     len = MultiByteToWideChar.call(0, 0, text, -1, nil, 0);
  9.     buf = "\0" * (len*2)
  10.     MultiByteToWideChar.call(0, 0, text, -1, buf, buf.size/2);
  11.     len = WideCharToMultiByte.call(65001, 0, buf, -1, nil, 0, nil, nil);
  12.     ret = "\0" * len
  13.     WideCharToMultiByte.call(65001, 0, buf, -1, ret, ret.size, nil, nil);
  14.     return ret.delete("\000")
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 转码:UTF-8转系统
  18.   #--------------------------------------------------------------------------
  19.   def u2s(text)
  20.     len = MultiByteToWideChar.call(65001, 0, text, -1, nil, 0);
  21.     buf = "\0" * (len*2)
  22.     MultiByteToWideChar.call(65001, 0, text, -1, buf, buf.size/2);
  23.     len = WideCharToMultiByte.call(0, 0, buf, -1, nil, 0, nil, nil);
  24.     ret = "\0" * len
  25.     WideCharToMultiByte.call(0, 0, buf, -1, ret, ret.size, nil, nil);
  26.     return ret.delete("\000")
  27.   end
复制代码

但本人对字体文件的数据结构没什么了解,你可以试试转码后是否有对应的下标。

点评

谢谢,我回到家了就试试  发表于 2016-9-3 19:52
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-7-19 15:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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