查看: 3041|回复: 3

[已经过期] 不会用按钮的那个脚本

[复制链接]
梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
回帖
164
发表于 2013-6-16 10:09:41 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
# 66对此脚本使用方法的说明(可能不是很准确,反正大体能用):
#
# ★、Kboard.keyboard(键位)  返回是否按下这个键的判断。
#     比如条件分歧:Kboard.keyboard($R_Key_H)
#                   则当按下键盘H键的时候条件分歧成立
#
# ★、Kboard.keyb(键位) == 1 当连续按住某键返回真,否则为false
#     比如条件分歧:Kboard.keyb($R_Key_U) == 1
#                   则当持续按下键盘U的时候条件分歧成立
#
# ★、Kboard.key(键位,1) 似乎可以做开关用。按下一次变为true,再按变false
这个怎么用?还有还有,单个图标怎么用?
class RPG::BaseItem
  #--------------------------------------------------------------------------
  # ● 获取图标
  #--------------------------------------------------------------------------
  def get_icon
    self.note.split(/[\r\n]+/).each { |line|
      return $1 if line =~ /\[(?:icon) (\S+)\]/
    }
    return nil
  end
  #--------------------------------------------------------------------------
  # ● 图标 index
  #--------------------------------------------------------------------------
  alias draw_single_icon_icon_index icon_index
  def icon_index
    icon_index = get_icon
    # 如果有指定图标
    if icon_index && icon_index =~ /\d+/ # 如果指定的是數字
      @icon_index = icon_index.to_i # 轉換成數字
    elsif icon_index
      return icon_index # 返回指定图标文件名
    end
    return draw_single_icon_icon_index # 否则返回原本的图标 index
  end
end
class Window_Base
  #--------------------------------------------------------------------------
  # ● 绘制图标
  #--------------------------------------------------------------------------
  alias draw_single_icon_draw_icon draw_icon
  def draw_icon(icon_index, x, y, enabled = true)
    if icon_index.is_a?(Integer) # 判断是否为整数
      # 调用原本的绘制图标方法
      draw_single_icon_draw_icon(icon_index, x, y, enabled)
    else # 指定图标时
      bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
      rect = Rect.new(0, 0, 24, 24)
      contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    end
  end
end

梦石
1
星屑
23236
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2013-6-16 10:18:54 | 显示全部楼层
按键脚本按照其格式扔到事件页条件分歧里面输入脚本的地方就可以了

单个图标那个脚本你给完整了么?脚本开头没有说明?

评分

参与人数 1星屑 +40 收起 理由
Sion + 40 感谢帮忙

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
回帖
164
 楼主| 发表于 2013-6-16 10:55:30 | 显示全部楼层
说明
使用方法:
将图标文件放在 游戏根目录/Graphics/Icons 里面
在数据库的物品/武器/防具/技能/状态中的备注里面写 [icon 文件名](注意这点与旧版稍有不同)
也用不了啊。
还有按按钮的貌似也是用不了。是我人品问题么{:2_258:}
回复

使用道具 举报

梦石
0
星屑
50
在线时间
492 小时
注册时间
2013-6-15
回帖
164
 楼主| 发表于 2013-6-16 11:00:45 | 显示全部楼层
{:2_271:}果然是人品么?
360截图20130616110151078.jpg
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部