| 赞 | 7 |
| VIP | |
| 好人卡 | |
| 积分 | 7 |
| 经验 | |
| 最后登录 | 2023-4-20 |
| 在线时间 | 511 小时 |
- 梦石
- 0
- 星屑
- 701
- 在线时间
- 511 小时
- 注册时间
- 2012-4-8
- 回帖
- 193
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 黑白界 于 2015-3-8 11:01 编辑
https://rpg.blue/forum.php?mod=viewthread&tid=344109
已经有前辈做过了类似的,不过需要三张图片
于是我做了一个只需一个icon的,不需要素材,商店显示有效
在最开始设置 $icon_jinqian = 你选择的icon的编号 就好
[pre lang="ruby"]$icon_jinqian= 361 #金钱图标的编号
class Window_Base
def draw_icon2(icon_index,xx,yy)
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
b = Bitmap.new(24,24)
b.blt(0, 0, bitmap, rect, 255)
for x in 0..23
for y in 0..23
next if b.get_pixel(x, y).alpha == 0
c=b.get_pixel(x, y)
m = (c.red + c.green + c.blue) / 3
b.set_pixel(x, y, Color.new(m, m, m, c.alpha))
end
end
rect2 = Rect.new(0, 0, 24, 24)
contents.blt(xx, yy, b,rect2, 255)
end
def draw_icon3(icon_index,xx,yy)
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
b = Bitmap.new(24,24)
b.blt(0, 0, bitmap, rect, 255)
for x in 0..23
for y in 0..23
next if b.get_pixel(x, y).alpha == 0
c = b.get_pixel(x, y)
m = (c.red + c.green + c.blue) / 3-30
b.set_pixel(x, y, Color.new(c.red, m, m, c.alpha))
end
end
rect2 = Rect.new(0, 0, 24, 24)
contents.blt(xx, yy, b,rect2, 255)
end
def draw_currency_value(unit,s,x,y,width)
if unit >=10000
i1=unit/10000
i2=(unit-i1*10000)/100
i3=unit-i1*10000-i2*100
elsif unit >=100
i1=0
i2=unit/100
i3=unit-i2*100
else
i1=0
i2=0
i3=unit
end
cx1 = text_size(i1).width+4
cx2 = text_size(i2).width+4
cx3 = text_size(i3).width+4
self.contents.fill_rect(x, y,width, 24, Color.new(0,0,0,200))
self.contents.fill_rect(x, y,width, 1, Color.new(200,200,200,200))
self.contents.fill_rect(x, y,1, 24, Color.new(200,200,200,200))
self.contents.fill_rect(x, y+23,width, 1, Color.new(200,200,200,200))
self.contents.fill_rect(x+width, y,1, 24, Color.new(200,200,200,200))
draw_icon($icon_jinqian, x+width-60-cx3-cx2, y)
draw_icon2($icon_jinqian, x+width-42-cx3, y)
draw_icon3($icon_jinqian, x+width-24, y)
self.contents.font.color=Color.new(150,150,50)
self.contents.font.size=20
draw_text(x+width-cx3-54-cx2-cx1, y, cx1, 24,i1)
draw_text(x+width-cx3-36-cx2, y, cx2, 24,i2)
draw_text(x+width-cx3-18, y, cx3, 24,i3)
end
end[/pre]
兼容VIPArcher装备帮助增强的脚本
[pre lang="ruby"]
$huobijin= "金"
$huobiyin= "银"
$huobitong= "铜"
class Window_Help_Ex < Window_Base
def set_item(item)
if item == nil
set_text("")
return
end
@xtext = ""
if $VIPArcherScript[:itemcolor] # require 物品描绘颜色脚本
@xtext = "\\c[16]名称:\\c[#{VIPArcher::ItemColor::Color_Lv[item.color]}]" +
"#{item.name} #{item.color if item.color != 0}#{"★" if item.color != 0}\\c[0]\n"
else
@xtext = "\\c[16]名称:\\c[0]#{item.name}\n"
end
@xtext += "\\c[16]介绍:\\c[0]#{item.description}\n"
if $VIPArcherScript[:load] # require 队伍负重脚本
@xtext += "\\c[16]售价:#{item.price} 重量:#{item.load}\\c[0]\n"
else
unit=item.price
if unit >=10000
i1=unit/10000
i2=(unit-i1*10000)/100
i3=unit-i1*10000-i2*100
elsif unit >=100
i1=0
i2=unit/100
i3=unit-i2*100
else
i1=0
i2=0
i3=unit
end
a1="#{$huobijin}"
a2="#{$huobiyin}"
a3="#{$huobitong}"
if i1==0
i1=nil
a1=nil
end
if i2==0
i2=nil
a2=nil
end
if i3==0
i3=nil
a3=nil
end
@xtext += item.price == 0 ? "\\c[16]售价:\\c[14]无法出售\\c[0]\n":"\\c[16]售价:#{i1}#{a1}#{i2}#{a2}#{i3}#{a3}\\c[0]\n"
end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
@xtext += VIPArcher::Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
@xtext += VIPArcher::Equipplus.getskillhelp(item) if item.is_a?(RPG::Skill)
@xtext += VIPArcher::Equipplus.getitemhelp(item) if item.is_a?(RPG::Item)
if $VIPArcherScript[:exdrop_rate] # require 队伍掉率扩展
@xtext += "\\c[#{$2.to_i > 0 ? UP : DOWN}]#{$1}掉率: #{$2}%\\c[0]\n" if
item.note =~ /<(\W+)掉率:\s*([0-9+.-]+)%>/i
end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Skill)
@xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
end
end
[/pre] |
|