Microsoft Small Basic

Program Listing: SLK303
' Vector Turtles
' Copyright © 2015 Nonki Takahashi. The MIT License.
' Version 0.1
' Last update 2015-01-30
' 2015-01-30 23:43:40 Shapes generated by Shapes 2.02b.
'
GraphicsWindow.Title = "Vector Turtles"
GraphicsWindow.BackgroundColor = "LightGray"
SB_Workaround()
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
' initialize shapes
Shapes_Init()
' add shapes
scale = 1
angle = 0
iMin = 1
iMax = 114
Shapes_Add()
scale = 0.7
shX = 300 * scale
shY = 200 * scale
Shapes_Add()
scale = 0.5
shX = 150
shY = 100
Shapes_Add()
Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 300 ' x offset
shY = 200 ' y offset
shape = ""
shape[1] = "func=ell;x=71;y=127;width=67;height=29;pw=6;pc=#000000;bc=#999900;name=円/楕円 8;"
shape[2] = "func=ell;x=70;y=60;width=67;height=29;pw=6;pc=#000000;bc=#999900;name=円/楕円 9;"
shape[3] = "func=ell;x=0;y=57;width=67;height=29;pw=6;pc=#000000;bc=#999900;name=円/楕円 10;"
shape[4] = "func=ell;x=2;y=127;width=67;height=29;pw=6;pc=#000000;bc=#999900;name=円/楕円 11;"
shape[5] = "func=ell;x=54;y=131;width=22;height=43;pw=6;pc=#000000;bc=#999900;name=円/楕円 12;"
shape[6] = "func=ell;x=27;y=0;width=82;height=60;pw=6;pc=#000000;bc=#339900;name=円/楕円 4;"
shape[7] = "func=ell;x=12;y=47;width=110;height=111;pw=6;pc=#000000;bc=#335323;name=円/楕円 5;"
shape[8] = "func=rect;x=55.75;y=82;width=23.50;height=43;angle=90;pw=0;bc=#AFEC00;name=六角形 6;"
shape[9] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 6;x1=21;y1=-1;x2=-1;y2=7;x3=42;y3=7;x=46;y=85;"
shape[10] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 6;x1=21;y1=-1;x2=-1;y2=7;x3=42;y3=7;x=45;y=114;"
shape[11] = "func=line;pw=6;name=六角形 6;x1=67;y1=85;x2=89;y2=92;pc=#338F05;"
shape[12] = "func=line;pw=6;name=六角形 6;x1=89;y1=92;x2=88;y2=114;pc=#338F05;"
shape[13] = "func=line;pw=6;name=六角形 6;x1=88;y1=114;x2=67;y2=122;pc=#338F05;"
shape[14] = "func=line;pw=6;name=六角形 6;x1=67;y1=122;x2=45;y2=114;pc=#338F05;"
shape[15] = "func=line;pw=6;name=六角形 6;x1=45;y1=114;x2=46;y2=92;pc=#338F05;"
shape[16] = "func=line;pw=6;name=六角形 6;x1=46;y1=92;x2=67;y2=85;pc=#338F05;"
shape[17] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=64;y=82;"
shape[18] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=86;y=89;"
shape[19] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=85;y=111;"
shape[20] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=64;y=119;"
shape[21] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=42;y=111;"
shape[22] = "func=ell;pw=0;name=六角形 6;bc=#338F05;width=6;height=6;x=43;y=89;"
shape[23] = "func=rect;x=79.75;y=57;width=15.50;height=30;angle=90;pw=0;bc=#AFEC00;name=六角形 13;"
shape[24] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 13;x1=15;y1=-1;x2=-1;y2=3;x3=29;y3=3;x=72;y=61;"
shape[25] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 13;x1=15;y1=-1;x2=-1;y2=3;x3=29;y3=3;x=72;y=78;"
shape[26] = "func=line;pw=6;name=六角形 13;x1=87;y1=61;x2=102;y2=65;pc=#338F05;"
shape[27] = "func=line;pw=6;name=六角形 13;x1=102;y1=65;x2=102;y2=78;pc=#338F05;"
shape[28] = "func=line;pw=6;name=六角形 13;x1=102;y1=78;x2=87;y2=82;pc=#338F05;"
shape[29] = "func=line;pw=6;name=六角形 13;x1=87;y1=82;x2=72;y2=78;pc=#338F05;"
shape[30] = "func=line;pw=6;name=六角形 13;x1=72;y1=78;x2=72;y2=65;pc=#338F05;"
shape[31] = "func=line;pw=6;name=六角形 13;x1=72;y1=65;x2=87;y2=61;pc=#338F05;"
shape[32] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=84;y=58;"
shape[33] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=99;y=62;"
shape[34] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=99;y=75;"
shape[35] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=84;y=79;"
shape[36] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=69;y=75;"
shape[37] = "func=ell;pw=0;name=六角形 13;bc=#338F05;width=6;height=6;x=69;y=62;"
shape[38] = "func=rect;x=37.75;y=59;width=15.50;height=27;angle=90;pw=0;bc=#AFEC00;name=六角形 14;"
shape[39] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 14;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=32;y=62;"
shape[40] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 14;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=31;y=79;"
shape[41] = "func=line;pw=6;name=六角形 14;x1=45;y1=62;x2=59;y2=65;pc=#338F05;"
shape[42] = "func=line;pw=6;name=六角形 14;x1=59;y1=65;x2=59;y2=79;pc=#338F05;"
shape[43] = "func=line;pw=6;name=六角形 14;x1=59;y1=79;x2=45;y2=83;pc=#338F05;"
shape[44] = "func=line;pw=6;name=六角形 14;x1=45;y1=83;x2=31;y2=79;pc=#338F05;"
shape[45] = "func=line;pw=6;name=六角形 14;x1=31;y1=79;x2=32;y2=65;pc=#338F05;"
shape[46] = "func=line;pw=6;name=六角形 14;x1=32;y1=65;x2=45;y2=62;pc=#338F05;"
shape[47] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=42;y=59;"
shape[48] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=56;y=62;"
shape[49] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=56;y=76;"
shape[50] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=42;y=80;"
shape[51] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=28;y=76;"
shape[52] = "func=ell;pw=0;name=六角形 14;bc=#338F05;width=6;height=6;x=29;y=62;"
shape[53] = "func=rect;x=38.25;y=120;width=14.50;height=27;angle=90;pw=0;bc=#AFEC00;name=六角形 15;"
shape[54] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 15;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=32;y=124;"
shape[55] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 15;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=31;y=139;"
shape[56] = "func=line;pw=6;name=六角形 15;x1=45;y1=124;x2=59;y2=127;pc=#338F05;"
shape[57] = "func=line;pw=6;name=六角形 15;x1=59;y1=127;x2=59;y2=139;pc=#338F05;"
shape[58] = "func=line;pw=6;name=六角形 15;x1=59;y1=139;x2=45;y2=143;pc=#338F05;"
shape[59] = "func=line;pw=6;name=六角形 15;x1=45;y1=143;x2=31;y2=139;pc=#338F05;"
shape[60] = "func=line;pw=6;name=六角形 15;x1=31;y1=139;x2=32;y2=127;pc=#338F05;"
shape[61] = "func=line;pw=6;name=六角形 15;x1=32;y1=127;x2=45;y2=124;pc=#338F05;"
shape[62] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=42;y=121;"
shape[63] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=56;y=124;"
shape[64] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=56;y=136;"
shape[65] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=42;y=140;"
shape[66] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=28;y=136;"
shape[67] = "func=ell;pw=0;name=六角形 15;bc=#338F05;width=6;height=6;x=29;y=124;"
shape[68] = "func=rect;x=79.25;y=121;width=14.50;height=27;angle=90;pw=0;bc=#AFEC00;name=六角形 16;"
shape[69] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 16;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=73;y=125;"
shape[70] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 16;x1=13;y1=-1;x2=-1;y2=3;x3=26;y3=3;x=72;y=140;"
shape[71] = "func=line;pw=6;name=六角形 16;x1=86;y1=125;x2=100;y2=128;pc=#338F05;"
shape[72] = "func=line;pw=6;name=六角形 16;x1=100;y1=128;x2=99;y2=140;pc=#338F05;"
shape[73] = "func=line;pw=6;name=六角形 16;x1=99;y1=140;x2=86;y2=144;pc=#338F05;"
shape[74] = "func=line;pw=6;name=六角形 16;x1=86;y1=144;x2=73;y2=140;pc=#338F05;"
shape[75] = "func=line;pw=6;name=六角形 16;x1=73;y1=140;x2=73;y2=128;pc=#338F05;"
shape[76] = "func=line;pw=6;name=六角形 16;x1=73;y1=128;x2=86;y2=125;pc=#338F05;"
shape[77] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=83;y=122;"
shape[78] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=97;y=125;"
shape[79] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=96;y=137;"
shape[80] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=83;y=141;"
shape[81] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=70;y=137;"
shape[82] = "func=ell;pw=0;name=六角形 16;bc=#338F05;width=6;height=6;x=70;y=125;"
shape[83] = "func=rect;x=96.00;y=98;width=18.00;height=12;angle=90;pw=0;bc=#AFEC00;name=六角形 17;"
shape[84] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 17;x1=6;y1=-1;x2=-1;y2=4;x3=11;y3=5;x=99;y=91;"
shape[85] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 17;x1=6;y1=-1;x2=-1;y2=4;x3=11;y3=5;x=98;y=112;"
shape[86] = "func=line;pw=6;name=六角形 17;x1=105;y1=91;x2=111;y2=96;pc=#338F05;"
shape[87] = "func=line;pw=6;name=六角形 17;x1=111;y1=96;x2=110;y2=112;pc=#338F05;"
shape[88] = "func=line;pw=6;name=六角形 17;x1=110;y1=112;x2=104;y2=117;pc=#338F05;"
shape[89] = "func=line;pw=6;name=六角形 17;x1=104;y1=117;x2=98;y2=112;pc=#338F05;"
shape[90] = "func=line;pw=6;name=六角形 17;x1=98;y1=112;x2=99;y2=95;pc=#338F05;"
shape[91] = "func=line;pw=6;name=六角形 17;x1=99;y1=95;x2=105;y2=91;pc=#338F05;"
shape[92] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=102;y=88;"
shape[93] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=108;y=93;"
shape[94] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=107;y=109;"
shape[95] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=101;y=114;"
shape[96] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=95;y=109;"
shape[97] = "func=ell;pw=0;name=六角形 17;bc=#338F05;width=6;height=6;x=96;y=92;"
shape[98] = "func=rect;x=20.00;y=97;width=18.00;height=14;angle=90;pw=0;bc=#AFEC00;name=六角形 18;"
shape[99] = "func=tri;angle=0;pw=0;bc=#AFEC00;name=六角形 18;x1=7;y1=-1;x2=-1;y2=4;x3=13;y3=5;x=22;y=91;"
shape[100] = "func=tri;angle=180;pw=0;bc=#AFEC00;name=六角形 18;x1=7;y1=-1;x2=-1;y2=4;x3=13;y3=5;x=21;y=112;"
shape[101] = "func=line;pw=6;name=六角形 18;x1=29;y1=91;x2=36;y2=96;pc=#338F05;"
shape[102] = "func=line;pw=6;name=六角形 18;x1=36;y1=96;x2=35;y2=112;pc=#338F05;"
shape[103] = "func=line;pw=6;name=六角形 18;x1=35;y1=112;x2=28;y2=117;pc=#338F05;"
shape[104] = "func=line;pw=6;name=六角形 18;x1=28;y1=117;x2=21;y2=112;pc=#338F05;"
shape[105] = "func=line;pw=6;name=六角形 18;x1=21;y1=112;x2=22;y2=95;pc=#338F05;"
shape[106] = "func=line;pw=6;name=六角形 18;x1=22;y1=95;x2=29;y2=91;pc=#338F05;"
shape[107] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=26;y=88;"
shape[108] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=33;y=93;"
shape[109] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=32;y=109;"
shape[110] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=25;y=114;"
shape[111] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=18;y=109;"
shape[112] = "func=ell;pw=0;name=六角形 18;bc=#338F05;width=6;height=6;x=19;y=92;"
shape[113] = "func=ell;x=83;y=22;width=12;height=11;angle=90;pw=0;pc=#FFFFFF;bc=#000000;name=円/楕円 19;"
shape[114] = "func=ell;x=47;y=22;width=12;height=11;angle=90;pw=0;pc=#FFFFFF;bc=#000000;name=円/楕円 20;"
EndSub
Sub Math_CartesianToPolar
' Math | convert cartesian coodinate to polar coordinate
' param x, y - cartesian coordinate
' return r, a - polar coordinate
r = Math.SquareRoot(x * x + y * y)
If x = 0 And y > 0 Then
a = 90 ' [degree]
ElseIf x = 0 And y < 0 Then
a = -90
Else
a = Math.ArcTan(y / x) * 180 / Math.Pi
EndIf
If x < 0 Then
a = a + 180
ElseIf x > 0 And y < 0 Then
a = a + 360
EndIf
EndSub
Sub SB_RotateWorkaround
' Small Basic | Rotate workaround for Silverlight
' param shp - current shape
' param x, y - original coordinate
' param alpha - angle [radian]
' returns x, y - workaround coordinate
If shp["func"] = "tri" Then
x1 = -Math.Floor(shp["x3"] / 2)
y1 = -Math.Floor(shp["y3"] / 2)
ElseIf shp["func"] = "line" Then
x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2)
y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2)
EndIf
ox = x - x1
oy = y - y1
x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox
y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy
EndSub
Sub SB_Workaround
' Small Basic | Workaround for Silverlight
' returns silverlight - "True" if in remote
color = GraphicsWindow.GetPixel(0, 0)
If Text.GetLength(color) > 7 Then
silverlight = "True"
msWait = 300
Else
silverlight = "False"
EndIf
EndSub
Sub Shapes_Add
' Shapes | add shapes as shapes data
' param iMin, iMax - shape indices to add
' param shape - array of shapes
' param scale - 1 if same scale
' return shWidth, shHeight - total size of shapes
' return shAngle - current angle of shapes
Stack.PushValue("local", i)
Stack.PushValue("local", x)
Stack.PushValue("local", y)
Shapes_CalcWidthAndHeight()
s = scale
For i = iMin To iMax
shp = shape[i]
GraphicsWindow.PenWidth = shp["pw"] * s
If shp["pw"] > 0 Then
GraphicsWindow.PenColor = shp["pc"]
EndIf
If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then
GraphicsWindow.BrushColor = shp["bc"]
EndIf
If shp["func"] = "rect" Then
shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "ell" Then
shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "tri" Then
shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s)
ElseIf shp["func"] = "line" Then
shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s)
ElseIf shp["func"] = "text" Then
If silverlight Then
fs = Math.Floor(shp["fs"] * 0.9)
Else
fs = shp["fs"]
EndIf
GraphicsWindow.FontSize = fs * s
GraphicsWindow.FontName = shp["fn"]
shp["obj"] = Shapes.AddText(shp["text"])
EndIf
x = shp["x"]
y = shp["y"]
shp["rx"] = x
shp["ry"] = y
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
alpha = Math.GetRadians(shp["angle"])
SB_RotateWorkaround()
shp["wx"] = x
shp["wy"] = y
EndIf
Shapes.Move(shp["obj"], shX + x * s, shY + y * s)
If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then
Shapes.Rotate(shp["obj"], shp["angle"])
EndIf
shape[i] = shp
EndFor
shAngle = 0
y = Stack.PopValue("local")
x = Stack.PopValue("local")
i = Stack.PopValue("local")
EndSub
Sub Shapes_CalcRotatePos
' Shapes | Calculate position for rotated shape
' param["x"], param["y"] - position of a shape
' param["width"], param["height"] - size of a shape
' param ["cx"], param["cy"] - center of rotation
' param ["angle"] - rotate angle
' return x, y - rotated position of a shape
_cx = param["x"] + param["width"] / 2
_cy = param["y"] + param["height"] / 2
x = _cx - param["cx"]
y = _cy - param["cy"]
Math_CartesianToPolar()
a = a + param["angle"]
x = r * Math.Cos(a * Math.Pi / 180)
y = r * Math.Sin(a * Math.Pi / 180)
_cx = x + param["cx"]
_cy = y + param["cy"]
x = _cx - param["width"] / 2
y = _cy - param["height"] / 2
EndSub
Sub Shapes_CalcWidthAndHeight
' Shapes | Calculate total width and height of shapes
' param iMin, iMax - shape indices to add
' return shWidth, shHeight - total size of shapes
For i = iMin To iMax
shp = shape[i]
If shp["func"] = "tri" Or shp["func"] = "line" Then
xmin = shp["x1"]
xmax = shp["x1"]
ymin = shp["y1"]
ymax = shp["y1"]
If shp["x2"] < xmin Then
xmin = shp["x2"]
EndIf
If xmax < shp["x2"] Then
xmax = shp["x2"]
EndIf
If shp["y2"] < ymin Then
ymin = shp["y2"]
EndIf
If ymax < shp["y2"] Then
ymax = shp["y2"]
EndIf
If shp["func"] = "tri" Then
If shp["x3"] < xmin Then
xmin = shp["x3"]
EndIf
If xmax < shp["x3"] Then
xmax = shp["x3"]
EndIf
If shp["y3"] < ymin Then
ymin = shp["y3"]
EndIf
If ymax < shp["y3"] Then
ymax = shp["y3"]
EndIf
EndIf
shp["width"] = xmax - xmin
shp["height"] = ymax - ymin
EndIf
If i = 1 Then
shWidth = shp["x"] + shp["width"]
shHeight = shp["y"] + shp["height"]
Else
If shWidth < shp["x"] + shp["width"] Then
shWidth = shp["x"] + shp["width"]
EndIf
If shHeight < shp["y"] + shp["height"] Then
shHeight = shp["y"] + shp["height"]
EndIf
EndIf
shape[i] = shp
EndFor
EndSub
Sub Shapes_Move
' Shapes | Move shapes
' param iMin, iMax - shape indices to add
' param shape - array of shapes
' param scale - to zoom
' param x, y - position to move
' return shX, shY - new position of shapes
Stack.PushValue("local", i)
s = scale
shX = x
shY = y
For i = iMin To iMax
shp = shape[i]
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
_x = shp["wx"]
_y = shp["wy"]
Else
_x = shp["rx"]
_y = shp["ry"]
EndIf
Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s)
EndFor
i = Stack.PopValue("local")
EndSub
Sub Shapes_Remove
' Shapes | Remove shapes
' param iMin, iMax - shapes indices to remove
' param shape - array of shapes
Stack.PushValue("local", i)
For i = iMin To iMax
shp = shape[i]
Shapes.Remove(shp["obj"])
EndFor
i = Stack.PopValue("local")
EndSub
Sub Shapes_Rotate
' Shapes | Rotate shapes
' param iMin, iMax - shapes indices to rotate
' param shape - array of shapes
' param scale - to zoom
' param angle - to rotate
Stack.PushValue("local", i)
Stack.PushValue("local", x)
Stack.PushValue("local", y)
s = scale
param["angle"] = angle
param["cx"] = shWidth / 2
param["cy"] = shHeight / 2
For i = iMin To iMax
shp = shape[i]
param["x"] = shp["x"]
param["y"] = shp["y"]
param["width"] = shp["width"]
param["height"] = shp["height"]
Shapes_CalcRotatePos()
shp["rx"] = x
shp["ry"] = y
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
alpha = Math.GetRadians(angle + shp["angle"])
SB_RotateWorkAround()
shp["wx"] = x
shp["wy"] = y
EndIf
Shapes.Move(shp["obj"], shX + x * s, shY + y * s)
Shapes.Rotate(shp["obj"], angle + shp["angle"])
shape[i] = shp
EndFor
y = Stack.PopValue("local")
x = Stack.PopValue("local")
i = Stack.PopValue("local")
EndSub