Project1

标题: 为什么 老出现位图找不到 [打印本页]

作者: z2z4    时间: 2014-6-19 18:00
标题: 为什么 老出现位图找不到
我下面这句 写的不对吗   就是读取一张图片 老出现  filename.empty? 这个找不到
  1. class RPG::BaseItem
  2.   #--------------------------------------------------------------------------
  3.   # ● 获取图标
  4.   #--------------------------------------------------------------------------
  5.   def 获取_图形
  6.     self.note.split(/[\r\n]+/).each { |line|
  7.       return $1 if line =~ /\[(?:图形) (\S+)\]/
  8.     }
  9.     return nil
  10.     p 获取_图形
  11.   end
  12.   #--------------------------------------------------------------------------
  13.   # ● 图标 index
  14.   #--------------------------------------------------------------------------
  15.   def 图形_索引
  16.    icon_index = 获取_图形
  17.      #如果有指定图标
  18.     if icon_index && icon_index =~ /\d+/ # 如果指定的是數字
  19.       @icon_index = icon_index.to_i # 轉換成數字
  20.     elsif icon_index
  21.       return icon_index # 返回指定图标文件名
  22.     end
  23.     return 图形_索引 # 否则返回原本的图标 index
  24.   end
  25. end
  26. class Window_Base
  27.   #--------------------------------------------------------------------------
  28.   # ● 绘制图标
  29.   #--------------------------------------------------------------------------
  30.   def 绘制_物品_图形(图形_索引, x, y, enabled = true)  # 图形_索引
  31.    
  32.     位图 = Cache.load_bitmap("Graphics/Ptuxing/", 图形_索引)
  33.     矩形 = Rect.new(0, 0, 85, 85)  
  34.     contents.blt(x, y, 位图, 矩形, enabled ? 255 : translucent_alpha)
  35.   end
  36. end  
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1