查看: 2400|回复: 1

[已经过期] 求大神指导一下,关于方形环绕的血槽怎么制作

[复制链接]
梦石
0
星屑
75
在线时间
231 小时
注册时间
2014-10-5
回帖
226
发表于 2014-10-24 21:12:43 | 显示全部楼层 |阅读模式

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

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

×
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]
QQ截图20141024195213.png
QQ截图20141024195213413.png
梦石
0
星屑
75
在线时间
231 小时
注册时间
2014-10-5
回帖
226
 楼主| 发表于 2014-10-24 21:59:34 | 显示全部楼层
如果可以,圆形的也很好,不过听说很难做啊
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部