#-------------------------------------------------------------------------- # ● 绘制值槽 # rate : 比率(1.0 为满值) # color1 : 渐变色的左端 # color2 : 渐变色的右端 #-------------------------------------------------------------------------- def draw_gauge(x, y, width, rate, color1, color2) fill_w = (width * rate).to_i gauge_y = y + line_height - 8 contents.fill_rect(x, gauge_y, width, 6, gauge_back_color) contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2) end
gauge.png (253 Bytes, 下载次数: 55)
guage图片
QQ截图20130422131127.png (6.36 KB, 下载次数: 52)
没用脚本
QQ截图20130422131258.png (8.03 KB, 下载次数: 52)
用脚本后
QQ截图20130422131709.png (7.85 KB, 下载次数: 54)
脚本
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |