以下引用小湖于2009-3-9 16:53:27的发言:
你把你的window_help_new贴出来看一下~
以下引用小湖于2009-3-9 19:36:47的发言:
你好像是新建了一个类Window_Help_Icon,不过好像和Window_Help一样么……
如果是装备大图可以参考这个:
http://rpg.blue/web/htm/news279.htm
以下引用小湖于2009-3-9 20:00:27的发言:
其实就是在help窗口中加入图片咯?
那可以参考:http://rpg.blue/web/htm/news584.htm
里面的\s[]就是可以添加图片的~
以下引用小湖于2009-3-9 20:18:22的发言:
其实用http://rpg.blue/web/htm/news584.htm里的set_text方法代替你的set_text方法就可以了,然后用\s[XXX]来显示Icons菜单下面的skill_XXX.png图片~
我做了略微修改
本帖相关代码如下:
def set_text(text, align = 0)
# 当文字不同时刷新
if text != @text_old
self.contents.clear
self.contents.font.color = Color.new(0, 0, 0, 255)
# 记录文字
@text_old = text.clone
@text = text.clone
x = 16
y = 1
begin
last_text = @text.clone
@text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
end until @text == last_text
@text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
@text.gsub!(/\\\\/) { "\000" }
@text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
@text.gsub!(/\\[Nn]/) { "\002" }
@text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
while ((c = @text.slice!(/./m)) != nil)
if c == "\000"
c = "\\"
end
if c == "\001"
@text.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
next
end
if c == "\002"
y += 1
x = 16
next
end
if c == "\003"
@text.sub!(/\[([0-9]+)\]/, "")
t = RPG::Cache.icon("skill_#{$1}")
self.contents.blt(x, 32 * y, t, t.rect)
t.dispose
next
end
self.contents.font.size = 16
self.contents.draw_text(4 + x, 26 * y, 40, 32, c)
x += self.contents.text_size(c).width
if x >= 160
y += 1
x = 16
end
end
end
self.visible = true
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |