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

Project1

 找回密码
 注册会员
搜索
楼主: tommay
打印 上一主题 下一主题

请问:ICON的问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
61
在线时间
24 小时
注册时间
2008-8-5
帖子
1924
1
发表于 2009-5-6 05:25:06 | 显示全部楼层
没有用过,是什么样的?O.O
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
61
在线时间
24 小时
注册时间
2008-8-5
帖子
1924
2
发表于 2009-5-6 11:57:40 | 显示全部楼层
文件过多增加解压缩时间的问题应该是首要吧,可以:
class Window_Item < Window_Selectable
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon("iconset.png")
    item.description.slice!(/\\icon\[(\d+)\]/i)
    if $1 != nil
      index = $1.to_i

      opacity = self.contents.font.color == normal_color ? 255 : 128
      self.contents.blt(x, y + 4, bitmap,
        Rect.new(index % 16 * 24, index / 16 * 24, 24, 24), opacity)
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
end

这样在数据库武器、防具、物品描述信息中写上 \icon[x] 就是显示 iconset 中,从左到右、从上到下的索引为 x 的图标~

VX 中添加新的物品后也是直接指定物品图标吧,如果要按照 ID 号直接显示也可以,只分物品、武器、防具、技能、其它这几种还比较简单,因为这三种在数据库中的编号是独立的;但要把防具、物品再分类成头部、身体,草药、钥匙就比较麻烦了……

以下引用后知后觉于2009-5-6 2:35:51的发言:

这样的东西写脚本是做不到的吧
八方向的行走在工程里鼠标悬着面向的时候仍然是4*4的
这些东西属于操作平台的问题,不是脚本问题的说
在脚本里我们可以把人的HP设置成9999*10的N次方
但是在数据库里最高也就9999

呵呵,程序的最大缺陷是有穷性,除此之外人的简单逻辑没有什么是不可能的
系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
61
在线时间
24 小时
注册时间
2008-8-5
帖子
1924
3
发表于 2009-5-6 18:48:22 | 显示全部楼层
这个只是为了解决图标素材过多不好管理的问题~
我说了要按照 ID 自动按照顺序显示图标也是可以的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-6-19 18:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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