| 
 
| 赞 | 4 |  
| VIP | 71 |  
| 好人卡 | 22 |  
| 积分 | 7 |  
| 经验 | 32145 |  
| 最后登录 | 2013-8-9 |  
| 在线时间 | 184 小时 |  
 Lv2.观梦者 天仙 
	梦石0 星屑680 在线时间184 小时注册时间2008-4-15帖子5023 
 | 
| 
本帖最后由 雪流星 于 2010-12-19 21:56 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 這個帖子裡面要求的,順便貼來發布區复制代码class Window_Base  < Window
  def draw_fullshape(text, x, y)
    text = text.to_s if text.is_a?(Numeric)
    stext = text.clone
    tx = x
    while ((c = stext.slice!(/./m)) != nil)
      cFS = get_fullshape(c)
      c_width = self.contents.text_size(cFS).width
      self.contents.draw_text(tx, y, c_width, WLH, cFS, 0)
      tx += c_width
    end
    
  end
  def get_fullshape(c)
    return c if /\w/!~c
    text = text.to_s if text.is_a?(Numeric) # 確使數字變成字符串
    alphanumericFS = {
    "0"=>"0", "1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", 
    "5"=>"5", "6"=>"6", "7"=>"7", "8"=>"8", "9"=>"9", 
    "A"=>"A", "B"=>"B", "C"=>"C", "D"=>"D", "E"=>"E", 
    "F"=>"F", "G"=>"G", "H"=>"H", "I"=>"I", "J"=>"J", 
    "K"=>"K", "L"=>"L", "M"=>"M", "N"=>"N", "O"=>"O", 
    "P"=>"P", "Q"=>"Q", "R"=>"R", "S"=>"S", "T"=>"T", 
    "U"=>"U", "V"=>"V", "W"=>"W", "X"=>"X", "Y"=>"Y", "Z"=>"Z", 
    "a"=>"a", "b"=>"b", "c"=>"c", "d"=>"d", "e"=>"e", 
    "f"=>"f", "g"=>"g", "h"=>"h", "i"=>"i", "j"=>"j", 
    "k"=>"k", "l"=>"l", "m"=>"m", "n"=>"n", "o"=>"o", 
    "p"=>"p", "q"=>"q", "r"=>"r", "s"=>"s", "t"=>"t", 
    "u"=>"u", "v"=>"v", "w"=>"w", "x"=>"x", "y"=>"t", "z"=>"z"
    }
    return alphanumericFS.has_key?(c) ? alphanumericFS[c] : c
  end
end
  | 
 评分
查看全部评分
 |