| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2019-11-8 |
| 在线时间 | 231 小时 |
- 梦石
- 0
- 星屑
- 75
- 在线时间
- 231 小时
- 注册时间
- 2014-10-5
- 回帖
- 226
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
javascript:;javascript:;
我自己画了一下,一个是之前的样子,我希望的效果是另外一个,三层的方形框框,在战斗时显示在状态栏,
我使用了一个很好用的血槽脚本,也不大,希望大神指导一下需要修改哪里,怎么修改,小的在这里学习了[pre lang="ruby" line="1"]# -----------------------------------------------------------------------------
# 值槽脚本随机生成系统(SLOTCR) By.Clov
# 通用版本:RMXP(RGSS1) RMVX(RGSS2) RMVX ACE(RGSS3)
# 使用方法:在全部窗口类插入即可 例:draw_cr(0,0,变量1,变量2,'开心值',100,10)
# 参数说明:x x坐标,y y坐标,current 当前值,max 最大值,txt 显示的文字
# width 值槽的宽,height 值槽的高
# 背景与边框没有随机的必要,请自行到脚本里设置
# -----------------------------------------------------------------------------
class Window_Base
def draw_crhp(x,y,current,max,txt='',width=60,height=10)
#颜色1、颜色2
c1=[230, 7, 17];c2=[13, 2, 158]
#背景颜色
bk_color = Color.new(0,0,0,255)
back_color = Color.new(0,0,0,80)
#数值是否显示
num = true
#显示数值的对齐方式 0:向左对齐 1:向中间对齐 2:向右边对齐
num_align = 1
#计算比率
bl = current.to_f / max
#计算实际宽
w = (width*bl).round
#描绘值槽
contents.fill_rect(x, y, width, height, back_color)
r = c1[0];g = c1[1];b = c1[2]
plus_r = (c2[0]-c1[0])/(height-1).to_f
plus_g = (c2[1]-c1[1])/(height-1).to_f
plus_b = (c2[2]-c1[2])/(height-1).to_f
height.times {|i|
contents.fill_rect(x, y+i, w, 1, Color.new(r,g,b,255))
r+=plus_r;g+=plus_g;b+=plus_b}
contents.fill_rect(x-1, y-1, width+2, 1, bk_color)
contents.fill_rect(x-1, y+height, width+2, 1, bk_color)
contents.fill_rect(x-1, y, 1, height, bk_color)
contents.fill_rect(x+width, y, 1, height, bk_color)
#描绘文字
txt_w = contents.text_size(txt).width + 2
contents.draw_text(x-txt_w,y+height/2-12, width, 24, txt)
contents.draw_text(x,y+height/2-12, width, 24,
current.to_s,num_align) if num
end
end[/pre] |
-
-
|