赞 | 13 |
VIP | 0 |
好人卡 | 0 |
积分 | 21 |
经验 | 70950 |
最后登录 | 2023-8-23 |
在线时间 | 740 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2123
- 在线时间
- 740 小时
- 注册时间
- 2010-9-6
- 帖子
- 338
|
9楼
楼主 |
发表于 2013-4-17 13:03:36
|
只看该作者
千古一帝 发表于 2013-4-17 07:26
如图中的人物属性显示,不过那是XP的,求个VA的。
#============================================================================== # ■ Window_MASS #------------------------------------------------------------------------------ # 角色深造窗口 #============================================================================== class Window_MASS < Window_Status #-------------------------------------------------------------------------- # ● 绘制能力值 #-------------------------------------------------------------------------- def draw_parameters(x, y) x = x + 15 # 图形的X坐标 y = y # 图形的Y坐标 long = 65 # 每边边长 draw_param_shape2(x, y,long) end #-------------------------------------------------------------------------- # ● 多边形描绘角色属性 #-------------------------------------------------------------------------- def draw_param_shape2(x,y,long = 50,n = 7,color = Color.new(255,255,255),actor = @actor) if n >= 3 x1 = [] y1 = [] mx = [] my = [] px = [] py = [] an = jiaodu(n).to_f# * 2.0 an2 = 180 - an x1[0], y1[0] = x,y for i in 0...n an -= an2 if i > 0 an = 180 if i == n - 1 x1[i+1] = Math.cos(an/180.0*Math::PI) * long.to_f + x1[i] y1[i+1] = Math.sin(an/180.0*Math::PI) * long.to_f + y1[i] # 计算一边中点 mx[i] = Math.cos(an/180.0*Math::PI) * long.to_f / 2 + x1[i] my[i] = Math.sin(an/180.0*Math::PI) * long.to_f / 2 + y1[i] contents.draw_line(x1[i].to_i, y1[i].to_i, x1[i+1].to_i, y1[i+1].to_i, color) if i < n - 1 contents.draw_line(x1[i].to_i+1, y1[i].to_i+1, x1[i+1].to_i+1, y1[i+1].to_i+1, color) if i < n - 1 end contents.draw_line(x1[n-1].to_i, y1[n-1].to_i, x1[0].to_i, y1[0].to_i, color) contents.draw_line(x1[n-1].to_i+1, y1[n-1].to_i+1, x1[0].to_i+1, y1[0].to_i+1, color) s0 = jiaodu(n) / 2.0 s1 = Math.tan(s0/180.0*Math::PI) * (long / 2.0) # a 长度 s2 = jiaodu(n) - 90 # s3,s4 重心坐标 s3 = Math.cos(s2/180.0*Math::PI) * s1 + mx[0] s4 = Math.sin(s2/180.0*Math::PI) * s1 + my[0] # 连接重心 for i in 0...x1.size an2 = 0 s5 = x1[i].to_i s6 = y1[i].to_i s7 = Math.sqrt((long / 2.0)**2+s1**2) if (s3 < s5) an2 = Math.asin((s6-s4)/s7) * 180 / Math::PI else an2 = 180 - Math.asin((s6-s4)/s7) * 180 / Math::PI end link_mid_and_point_together(s5,s6,s3.to_i,s4.to_i) if i < x1.size-1 num = actor.param(i) px[i],py[i] = draw_add_param2(s5,s6,s7,[s3.to_i,s4.to_i],an2,i,num ) if i < n end for i in 0...px.size i < (n-1) ? contents.draw_line(px[i],py[i],px[i+1],py[i+1],Color.new(0,255,0)) : contents.draw_line(px[i],py[i],px[0],py[0],Color.new(0,255,0)) i += 1 end return x1,y1 end return nil,nil end #-------------------------------------------------------------------------- # ● 绘制值 #-------------------------------------------------------------------------- def draw_add_param2(x,y,len,mid,an,param_id,num,color = Color.new(255,255,0)) s1 = num.to_f / 999.0 # 最大值 s2 = len * s1 param_point_x = Math.cos(an/180.0*Math::PI) * s2 + mid[0] param_point_y = Math.sin(an/180.0*Math::PI) * s2 + mid[1] s3 = Vocab::param(param_id) + " " + num.to_s contents.font.size = 13 contents.font.shadow = true change_color(color) contents.font.out_color = Color.new(255,5,255,120) draw_text(x,y,70,line_height,s3) contents.font.out_color = Color.new(0,0,0,128) change_color(Color.new(255,255,255)) contents.font.size = 24 contents.font.shadow = false return param_point_x.to_i,param_point_y.to_i end end
#==============================================================================
# ■ Window_MASS
#------------------------------------------------------------------------------
# 角色深造窗口
#==============================================================================
class Window_MASS < Window_Status
#--------------------------------------------------------------------------
# ● 绘制能力值
#--------------------------------------------------------------------------
def draw_parameters(x, y)
x = x + 15 # 图形的X坐标
y = y # 图形的Y坐标
long = 65 # 每边边长
draw_param_shape2(x, y,long)
end
#--------------------------------------------------------------------------
# ● 多边形描绘角色属性
#--------------------------------------------------------------------------
def draw_param_shape2(x,y,long = 50,n = 7,color = Color.new(255,255,255),actor = @actor)
if n >= 3
x1 = []
y1 = []
mx = []
my = []
px = []
py = []
an = jiaodu(n).to_f# * 2.0
an2 = 180 - an
x1[0], y1[0] = x,y
for i in 0...n
an -= an2 if i > 0
an = 180 if i == n - 1
x1[i+1] = Math.cos(an/180.0*Math::PI) * long.to_f + x1[i]
y1[i+1] = Math.sin(an/180.0*Math::PI) * long.to_f + y1[i]
# 计算一边中点
mx[i] = Math.cos(an/180.0*Math::PI) * long.to_f / 2 + x1[i]
my[i] = Math.sin(an/180.0*Math::PI) * long.to_f / 2 + y1[i]
contents.draw_line(x1[i].to_i, y1[i].to_i, x1[i+1].to_i, y1[i+1].to_i, color) if i < n - 1
contents.draw_line(x1[i].to_i+1, y1[i].to_i+1, x1[i+1].to_i+1, y1[i+1].to_i+1, color) if i < n - 1
end
contents.draw_line(x1[n-1].to_i, y1[n-1].to_i, x1[0].to_i, y1[0].to_i, color)
contents.draw_line(x1[n-1].to_i+1, y1[n-1].to_i+1, x1[0].to_i+1, y1[0].to_i+1, color)
s0 = jiaodu(n) / 2.0
s1 = Math.tan(s0/180.0*Math::PI) * (long / 2.0) # a 长度
s2 = jiaodu(n) - 90
# s3,s4 重心坐标
s3 = Math.cos(s2/180.0*Math::PI) * s1 + mx[0]
s4 = Math.sin(s2/180.0*Math::PI) * s1 + my[0]
# 连接重心
for i in 0...x1.size
an2 = 0
s5 = x1[i].to_i
s6 = y1[i].to_i
s7 = Math.sqrt((long / 2.0)**2+s1**2)
if (s3 < s5)
an2 = Math.asin((s6-s4)/s7) * 180 / Math::PI
else
an2 = 180 - Math.asin((s6-s4)/s7) * 180 / Math::PI
end
link_mid_and_point_together(s5,s6,s3.to_i,s4.to_i) if i < x1.size-1
num = actor.param(i)
px[i],py[i] = draw_add_param2(s5,s6,s7,[s3.to_i,s4.to_i],an2,i,num ) if i < n
end
for i in 0...px.size
i < (n-1) ? contents.draw_line(px[i],py[i],px[i+1],py[i+1],Color.new(0,255,0)) : contents.draw_line(px[i],py[i],px[0],py[0],Color.new(0,255,0))
i += 1
end
return x1,y1
end
return nil,nil
end
#--------------------------------------------------------------------------
# ● 绘制值
#--------------------------------------------------------------------------
def draw_add_param2(x,y,len,mid,an,param_id,num,color = Color.new(255,255,0))
s1 = num.to_f / 999.0 # 最大值
s2 = len * s1
param_point_x = Math.cos(an/180.0*Math::PI) * s2 + mid[0]
param_point_y = Math.sin(an/180.0*Math::PI) * s2 + mid[1]
s3 = Vocab::param(param_id) + " " + num.to_s
contents.font.size = 13
contents.font.shadow = true
change_color(color)
contents.font.out_color = Color.new(255,5,255,120)
draw_text(x,y,70,line_height,s3)
contents.font.out_color = Color.new(0,0,0,128)
change_color(Color.new(255,255,255))
contents.font.size = 24
contents.font.shadow = false
return param_point_x.to_i,param_point_y.to_i
end
end
加上这一段(脚本末尾)
X、Y坐标等参数 可自己改,在11行修改 |
|