Project1
标题:
求在ActorCommand的戰鬥選單裡添加圖標的方法(VX)
[打印本页]
作者:
冰冷水藍
时间:
2019-4-24 00:40
标题:
求在ActorCommand的戰鬥選單裡添加圖標的方法(VX)
本帖最后由 冰冷水藍 于 2019-4-24 00:49 编辑
如題,希望能在ActorCommand的戰鬥選單,選項前添加圖標
查了很多相關腳本,全都是VX以外的系統專用
或是每個指令能透過圖片來顯示也可以
求解,謝謝!!!!
像這樣
作者:
活气寒露
时间:
2019-4-24 00:40
重新添加一个描绘图标的脚本就行了,很简单
#==============================================================================
# ** Window_ActorCommand
#------------------------------------------------------------------------------
# 本視窗顯示於作戰畫面中,用來選擇主角的行動指令。
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# * 宣告執行個體變數
#--------------------------------------------------------------------------
attr_reader :commands # 命令
Command_Icon = {0 => 1, 1 => 2, 2 => 3, 3 =>4}
#--------------------------------------------------------------------------
# * 物件初始化
#--------------------------------------------------------------------------
def initialize
super(128, [], 1, 4)
self.active = false
end
#--------------------------------------------------------------------------
# * 設置參數
# actor : 主角
#--------------------------------------------------------------------------
def setup(actor)
s1 = Vocab::attack
s2 = Vocab::skill
s3 = Vocab::guard
s4 = Vocab::item
if actor.class.skill_name_valid # 自訂技能指令項顯示名合法?
s2 = actor.class.skill_name # 替換技能指令項顯示名
end
@commands = [s1, s2, s3, s4]
@item_max = 4
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * 繪製條目
# index : 條目編號
# enabled : 可用性標幟,如果為false則半透明化條目繪製。
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.draw_icon(Command_Icon[index], rect.x, rect.y, enabled)
rect.x += 24
self.contents.draw_text(rect, @commands[index])
end
end
QQ截图20190424214522.png
(199.44 KB, 下载次数: 16)
下载附件
保存到相册
2019-4-24 21:45 上传
作者:
冰冷水藍
时间:
2019-4-25 16:20
本帖最后由 冰冷水藍 于 2019-4-25 18:50 编辑
感謝可以用,不過現在想把指令的行距調寬成40卻卡住了
下半截顯示不完全,還在找原因中,不是視窗高度問題
問題解決了,謝謝!!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1