@個別
--track0:サイズ,0,500,100,1
--track1:ライン幅,0,4000,5,1
--track2:折れ位置,0,1000,3,1
--track3:塗り位置,-1,1000,0,1
--dialog:色/col,color="0xffffff";隙間(px),sukima=5;縦書き/chk,checkH=0;効果をﾃｷｽﾄに/chk,checkT=1;効果を枠に/chk,checkW=1;

local line=obj.track1
local size=obj.track0
local x=obj.index*(size+sukima)
local y=0
local iti=obj.track2

if checkH==0 then

 if obj.index>=iti then
  x=iti*(size+sukima)
  y=(obj.index-iti)*(size+sukima)
 else
  x=obj.index*(size+sukima)
  y=0
 end

else

 if obj.index<=iti then
  x=0
  y=obj.index*(size+sukima)
 else
  x=(obj.index-iti)*(size+sukima)
  y=iti*(size+sukima)
 end

end

if obj.index==obj.track3 then
 line=4000
end

obj.copybuffer("tmp","obj")

obj.load("figure","四角形",color,size,line)
if checkW==1 then
 obj.effect()
end
obj.draw(x,y)

obj.load("tempbuffer")
if checkT==1 then
 obj.effect()
end
obj.draw(x,y)

@全体
--track0:横幅[%],0,5000,120
--track1:縦幅[%],0,5000,120
--track2:ｽﾞﾚx,-1000,1000,0
--track3:ｽﾞﾚy,-1000,1000,0
--dialog:ｽﾞﾚz,zureZ=-1;色/col,color="0xffff00";ライン幅,line=4000;図形透明度,alpha=0;ﾃｷｽﾄをループ/chk,text_loop=0;ﾃｷｽﾄ間の距離,text_dis=50;線をつける/chk,checkLINE=0;線の太さ[%],line_thick=5;線の色/col,line_col="0x000000";線の位置[%],line_dis=80;

local function draw_rect(side_v,side_h,ox,oy,oz,obj,alpha)
 obj.drawpoly(
	ox-side_v/2,oy-side_h/2,oz,
	ox+side_v/2,oy-side_h/2,oz,
	ox+side_v/2,oy+side_h/2,oz,
	ox-side_v/2,oy+side_h/2,oz,
	0,0, 
	obj.w,0, 
	obj.w,obj.h, 
	0,obj.h,
	1-alpha)
end

local function loop(val,min,max)
 local range=math.abs(max-min)
 while val>max do
  val=val-range
 end
 while val<min do
  val=val+range
 end
 return val
end

local w=obj.w
local z=obj.getvalue("zoom")/100
local w_z=w/z	
local side_v=obj.w*obj.track0/100
local side_h=obj.h*obj.track1/100
local waku_x,waku_y,waku_z=0,0,0
local text_x,text_y,text_z=obj.track2,obj.track3,zureZ

local oalpha=obj.alpha

if text_loop==1 then
 text_x=loop(text_x,-(w_z+text_dis),0)
end

if side_v<0 then
 side_v=0
end

if side_h<0 then
 side_h=0
end

if side_v>0 and side_h>0 then

--テキストは一旦キャッシュに置いとく
obj.copybuffer("cache:tmp2","obj")

--tempbuffer上で描画→obj.load("tempbuffer")
obj.setoption("drawtarget","tempbuffer",side_v,side_h)

--枠
obj.load("figure","四角形",color,100,line)
draw_rect(side_v,side_h,waku_x,waku_y,waku_z,obj,alpha/100)

--ライン
if line_thick>0 and checkLINE==1 then
 obj.load("figure","四角形",line_col,1)
 draw_rect(side_v,side_h*line_thick/100,waku_x,waku_y+side_h/2*line_dis/100,waku_z,obj,alpha/100)
 draw_rect(side_v,side_h*line_thick/100,waku_x,waku_y-side_h/2*line_dis/100,waku_z,obj,alpha/100)
end

--テキスト
obj.copybuffer("obj","cache:tmp2")

if text_loop==1 then

 local text_num=math.floor(side_v/((w_z+text_dis)))+2
 text_x=text_x-((w_z+text_dis))*(text_num)/2

 for i=1,text_num do
  text_x=text_x+(w_z+text_dis)
  obj.draw(text_x,text_y,text_z,1,oalpha)
 end

else
  obj.draw(text_x,text_y,text_z,1,oalpha)
end

obj.load("tempbuffer")

else

 obj.alpha=0

end