Microsoft Small Basic

Program Listing: JPM081
' Album Jacket - LET IT BE in Small Basic World
' Copyright © 2017 Nonki Takahashi. The MIT License.
' 2017-12-13 00:58:28 Shapes generated by Shapes 2.3b.
'
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 = 353
Shapes_Add()
Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 134 ' x offset
shY = 40 ' y offset
shape = ""
shape[1] = "func=rect;x=0;y=0;width=323;height=348;bc=#000000;pw=0;"
shape[2] = "func=rect;x=162;y=50;width=118;height=124;bc=#BE5D50;pw=0;"
shape[3] = "func=tri;x=173;y=123;x1=11;y1=0;x2=0;y2=43;x3=22;y3=43;angle=230;bc=#000000;pw=0;"
shape[4] = "func=tri;x=173;y=135;x1=11;y1=0;x2=0;y2=43;x3=22;y3=43;angle=244;bc=#000000;pw=0;"
shape[5] = "func=tri;x=248;y=136;x1=11;y1=0;x2=0;y2=43;x3=22;y3=43;angle=110;bc=#000000;pw=0;"
shape[6] = "func=tri;x=252;y=126;x1=10;y1=0;x2=0;y2=38;x3=21;y3=38;angle=125;bc=#000000;pw=0;"
shape[7] = "func=tri;x=134;y=144;x1=86;y1=0;x2=0;y2=44;x3=173;y3=44;bc=#000000;pw=0;"
shape[8] = "func=ell;x=186;y=158;width=69;height=37;bc=#E4D8C3;pw=0;"
shape[9] = "func=ell;x=199;y=142;width=45;height=33;bc=#E4D8C3;pw=0;"
shape[10] = "func=ell;x=173;y=40;width=94;height=124;bc=#000000;pw=0;"
shape[11] = "func=ell;x=191;y=67;width=60;height=75;bc=#DEC5B5;pw=0;"
shape[12] = "func=rect;x=38;y=48;width=118;height=130;bc=#E1EFF4;pw=0;"
shape[13] = "func=rect;x=84;y=115;width=73;height=65;bc=#CEA992;pw=0;"
shape[14] = "func=ell;x=48;y=28;width=28;height=100;angle=16;bc=#9D8562;pw=0;"
shape[15] = "func=ell;x=64;y=104;width=87;height=47;angle=317;bc=#DEC5B5;pw=0;"
shape[16] = "func=ell;x=58;y=37;width=73;height=81;bc=#DEC5B5;pw=0;"
shape[17] = "func=ell;x=89;y=40;width=71;height=24;angle=19;bc=#9D8562;pw=0;"
shape[18] = "func=ell;x=110;y=43;width=25;height=80;bc=#9D8562;pw=0;"
shape[19] = "func=rect;x=130;y=66;width=27;height=56;bc=#9D8562;pw=0;"
shape[20] = "func=ell;x=70;y=162;width=39;height=40;bc=#000000;pw=0;"
shape[21] = "func=tri;x=63;y=94;x1=14;y1=0;x2=0;y2=44;x3=29;y3=44;angle=333;bc=#DEC5B5;pw=0;"
shape[22] = "func=ell;x=218;y=58;width=47;height=36;angle=39;bc=#000000;pw=0;"
shape[23] = "func=ell;x=175;y=75;width=45;height=20;angle=308;bc=#000000;pw=0;"
shape[24] = "func=tri;x=209;y=119;x1=12;y1=0;x2=0;y2=10;x3=24;y3=10;bc=#000000;pw=0;"
shape[25] = "func=ell;x=205;y=97;width=7;height=9;bc=#000000;pw=0;"
shape[26] = "func=ell;x=231;y=97;width=7;height=9;bc=#000000;pw=0;"
shape[27] = "func=tri;x=214;y=102;x1=4;y1=0;x2=0;y2=17;x3=8;y3=17;angle=14;bc=#B98564;pw=0;"
shape[28] = "func=line;x=200;y=96;x1=0;y1=5;x2=16;y2=0;pc=#000000;pw=2;"
shape[29] = "func=line;x=230;y=97;x1=0;y1=0;x2=14;y2=6;pc=#000000;pw=2;"
shape[30] = "func=tri;x=73;y=86;x1=4;y1=0;x2=0;y2=19;x3=8;y3=19;angle=63;bc=#B98564;pw=0;"
shape[31] = "func=ell;x=52;y=70;width=19;height=25;bc=#9D8562;pc=#FFFFFF;pw=2;"
shape[32] = "func=ell;x=79;y=56;width=20;height=26;bc=#DEC5B5;pc=#FFFFFF;pw=2;"
shape[33] = "func=ell;x=73;y=108;width=29;height=22;angle=60;bc=#000000;pc=#BE5D50;pw=2;"
shape[34] = "func=line;x=81;y=118;x1=0;y1=15;x2=16;y2=0;pc=#BE5D50;pw=2;"
shape[35] = "func=tri;x=87;y=115;x1=9;y1=0;x2=0;y2=22;x3=19;y3=22;angle=25;bc=#DEC5B5;pw=0;"
shape[36] = "func=rect;x=37;y=185;width=118;height=130;bc=#E1EFF4;pw=0;"
shape[37] = "func=tri;x=130;y=114;x1=11;y1=0;x2=0;y2=43;x3=22;y3=43;angle=191;bc=#64553F;pw=0;"
shape[38] = "func=tri;x=119;y=103;x1=5;y1=0;x2=0;y2=31;x3=11;y3=31;angle=209;bc=#64553F;pw=0;"
shape[39] = "func=ell;x=51;y=102;width=16;height=36;angle=348;bc=#9D8562;pw=0;"
shape[40] = "func=line;x=109;y=127;x1=10;y1=0;x2=0;y2=9;pw=0;"
shape[41] = "func=line;x=110;y=129;x1=10;y1=0;x2=0;y2=7;pc=#64553F;pw=2;"
shape[42] = "func=line;x=130;y=153;x1=8;y1=0;x2=0;y2=11;pc=#64553F;pw=2;"
shape[43] = "func=line;x=122;y=161;x1=8;y1=3;x2=0;y2=0;pc=#64553F;pw=2;"
shape[44] = "func=line;x=119;y=156;x1=3;y1=5;x2=0;y2=0;pc=#64553F;pw=2;"
shape[45] = "func=line;x=143;y=139;x1=6;y1=0;x2=0;y2=25;pc=#64553F;pw=2;"
shape[46] = "func=line;x=137;y=164;x1=6;y1=0;x2=0;y2=7;pc=#64553F;pw=2;"
shape[47] = "func=line;x=132;y=171;x1=5;y1=0;x2=0;y2=0;pc=#64553F;pw=2;"
shape[48] = "func=line;x=56;y=110;x1=0;y1=0;x2=6;y2=19;pc=#64553F;pw=2;"
shape[49] = "func=line;x=62;y=129;x1=0;y1=0;x2=6;y2=11;pc=#64553F;pw=2;"
shape[50] = "func=line;x=66;y=140;x1=2;y1=0;x2=0;y2=6;pc=#64553F;pw=2;"
shape[51] = "func=line;x=61;y=146;x1=5;y1=0;x2=0;y2=3;pc=#64553F;pw=2;"
shape[52] = "func=line;x=56;y=147;x1=5;y1=2;x2=0;y2=0;pc=#64553F;pw=2;"
shape[53] = "func=line;x=118;y=44;x1=0;y1=0;x2=8;y2=16;pc=#64553F;pw=2;"
shape[54] = "func=line;x=126;y=61;x1=0;y1=0;x2=3;y2=16;pc=#64553F;pw=2;"
shape[55] = "func=line;x=129;y=77;x1=0;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[56] = "func=line;x=126;y=92;x1=3;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[57] = "func=line;x=139;y=61;x1=0;y1=0;x2=5;y2=22;pc=#64553F;pw=2;"
shape[58] = "func=line;x=144;y=83;x1=0;y1=0;x2=1;y2=15;pc=#64553F;pw=2;"
shape[59] = "func=line;x=143;y=98;x1=2;y1=0;x2=0;y2=20;pc=#64553F;pw=2;"
shape[60] = "func=line;x=153;y=68;x1=0;y1=0;x2=6;y2=24;pc=#64553F;pw=2;"
shape[61] = "func=line;x=67;y=38;x1=8;y1=0;x2=0;y2=5;pc=#64553F;pw=2;"
shape[62] = "func=line;x=61;y=43;x1=6;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[63] = "func=line;x=54;y=60;x1=6;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[64] = "func=line;x=47;y=86;x1=6;y1=0;x2=0;y2=22;pc=#64553F;pw=2;"
shape[65] = "func=line;x=47;y=108;x1=0;y1=0;x2=7;y2=9;pc=#64553F;pw=2;"
shape[66] = "func=line;x=62;y=102;x1=0;y1=0;x2=0;y2=11;pc=#64553F;pw=2;"
shape[67] = "func=line;x=62;y=113;x1=0;y1=0;x2=2;y2=10;pc=#64553F;pw=2;"
shape[68] = "func=line;x=107;y=41;x1=0;y1=0;x2=9;y2=19;pc=#64553F;pw=2;"
shape[69] = "func=line;x=132;y=84;x1=3;y1=0;x2=0;y2=27;pc=#64553F;pw=2;"
shape[70] = "func=line;x=136;y=92;x1=4;y1=0;x2=0;y2=26;pc=#64553F;pw=2;"
shape[71] = "func=line;x=152;y=83;x1=0;y1=0;x2=0;y2=34;pc=#64553F;pw=2;"
shape[72] = "func=line;x=150;y=122;x1=7;y1=0;x2=0;y2=37;pc=#64553F;pw=2;"
shape[73] = "func=line;x=145;y=159;x1=6;y1=0;x2=0;y2=8;pc=#64553F;pw=2;"
shape[74] = "func=line;x=119;y=85;x1=0;y1=0;x2=4;y2=32;pc=#64553F;pw=2;"
shape[75] = "func=line;x=85;y=34;x1=3;y1=0;x2=0;y2=18;pc=#9D8562;pw=2;"
shape[76] = "func=line;x=85;y=55;x1=0;y1=0;x2=0;y2=16;pc=#9D8562;pw=2;"
shape[77] = "func=line;x=86;y=72;x1=0;y1=0;x2=16;y2=20;pc=#9D8562;pw=2;"
shape[78] = "func=line;x=102;y=94;x1=0;y1=0;x2=2;y2=12;pc=#9D8562;pw=2;"
shape[79] = "func=line;x=101;y=106;x1=3;y1=0;x2=0;y2=20;pc=#9D8562;pw=2;"
shape[80] = "func=line;x=81;y=40;x1=11;y1=0;x2=0;y2=20;pc=#9D8562;pw=2;"
shape[81] = "func=line;x=81;y=61;x1=0;y1=0;x2=3;y2=16;pc=#9D8562;pw=2;"
shape[82] = "func=line;x=84;y=77;x1=0;y1=0;x2=22;y2=24;pc=#9D8562;pw=2;"
shape[83] = "func=line;x=106;y=101;x1=0;y1=0;x2=1;y2=10;pc=#9D8562;pw=2;"
shape[84] = "func=line;x=105;y=112;x1=2;y1=0;x2=0;y2=10;pc=#9D8562;pw=2;"
shape[85] = "func=line;x=110;y=101;x1=7;y1=0;x2=0;y2=24;pc=#9D8562;pw=2;"
shape[86] = "func=line;x=102;y=126;x1=9;y1=0;x2=0;y2=12;pc=#9D8562;pw=2;"
shape[87] = "func=line;x=145;y=94;x1=9;y1=0;x2=0;y2=35;pc=#9D8562;pw=2;"
shape[88] = "func=line;x=126;y=129;x1=19;y1=0;x2=0;y2=9;pc=#9D8562;pw=2;"
shape[89] = "func=line;x=137;y=109;x1=4;y1=0;x2=0;y2=15;pc=#9D8562;pw=2;"
shape[90] = "func=line;x=122;y=124;x1=15;y1=0;x2=0;y2=7;pc=#9D8562;pw=2;"
shape[91] = "func=line;x=142;y=143;x1=15;y1=6;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[92] = "func=line;x=137;y=133;x1=5;y1=10;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[93] = "func=line;x=148;y=137;x1=9;y1=1;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[94] = "func=line;x=142;y=127;x1=6;y1=10;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[95] = "func=line;x=150;y=111;x1=4;y1=0;x2=0;y2=32;pc=#9D8562;pw=2;"
shape[96] = "func=line;x=141;y=113;x1=5;y1=0;x2=0;y2=12;pc=#9D8562;pw=2;"
shape[97] = "func=line;x=127;y=125;x1=13;y1=0;x2=0;y2=10;pc=#9D8562;pw=2;"
shape[98] = "func=line;x=131;y=142;x1=21;y1=10;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[99] = "func=line;x=129;y=140;x1=1;y1=2;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[100] = "func=line;x=103;y=50;x1=0;y1=0;x2=12;y2=27;pc=#9D8562;pw=2;"
shape[101] = "func=line;x=81;y=37;x1=0;y1=0;x2=10;y2=18;pc=#9D8562;pw=2;"
shape[102] = "func=line;x=93;y=54;x1=0;y1=0;x2=16;y2=1;pc=#9D8562;pw=2;"
shape[103] = "func=line;x=67;y=125;x1=0;y1=0;x2=5;y2=18;pc=#9D8562;pw=2;"
shape[104] = "func=line;x=67;y=143;x1=5;y1=0;x2=0;y2=10;pc=#9D8562;pw=2;"
shape[105] = "func=line;x=65;y=153;x1=2;y1=0;x2=0;y2=11;pc=#9D8562;pw=2;"
shape[106] = "func=line;x=47;y=123;x1=0;y1=0;x2=11;y2=19;pc=#9D8562;pw=2;"
shape[107] = "func=line;x=58;y=142;x1=0;y1=0;x2=9;y2=5;pc=#9D8562;pw=2;"
shape[108] = "func=line;x=124;y=99;x1=8;y1=0;x2=0;y2=31;pc=#9D8562;pw=2;"
shape[109] = "func=line;x=118;y=130;x1=6;y1=0;x2=0;y2=7;pc=#9D8562;pw=2;"
shape[110] = "func=line;x=130;y=101;x1=6;y1=0;x2=0;y2=29;pc=#9D8562;pw=2;"
shape[111] = "func=line;x=135;y=126;x1=15;y1=0;x2=0;y2=20;pc=#9D8562;pw=2;"
shape[112] = "func=line;x=91;y=163;x1=0;y1=0;x2=2;y2=17;pc=#9D8562;pw=2;"
shape[113] = "func=line;x=87;y=161;x1=1;y1=0;x2=0;y2=18;pc=#9D8562;pw=2;"
shape[114] = "func=line;x=79;y=163;x1=7;y1=0;x2=0;y2=17;pc=#9D8562;pw=2;"
shape[115] = "func=line;x=73;y=164;x1=11;y1=0;x2=0;y2=16;pc=#9D8562;pw=2;"
shape[116] = "func=line;x=65;y=164;x1=17;y1=0;x2=0;y2=15;pc=#9D8562;pw=2;"
shape[117] = "func=line;x=67;y=157;x1=10;y1=0;x2=0;y2=13;pc=#9D8562;pw=2;"
shape[118] = "func=line;x=62;y=170;x1=5;y1=0;x2=0;y2=11;pc=#9D8562;pw=2;"
shape[119] = "func=ell;x=200;y=88;width=16;height=4;bc=#000000;pw=0;"
shape[120] = "func=ell;x=204;y=126;width=24;height=25;bc=#4C4C4C;pw=0;"
shape[121] = "func=rect;x=197;y=130;width=20;height=23;angle=350;bc=#4C4C4C;pw=0;"
shape[122] = "func=ell;x=184;y=132;width=24;height=25;bc=#4C4C4C;pw=0;"
shape[123] = "func=ell;x=184;y=135;width=17;height=20;bc=#FFFFFF;pw=0;"
shape[124] = "func=ell;x=28;y=115;width=33;height=37;bc=#4C4C4C;pw=0;"
shape[125] = "func=rect;x=38;y=151;width=13;height=29;bc=#7D7D7D;pw=0;"
shape[126] = "func=ell;x=183;y=138;width=14;height=16;bc=#7D7D7D;pw=0;"
shape[127] = "func=rect;x=157;y=130;width=16;height=8;bc=#000000;pw=0;"
shape[128] = "func=rect;x=168;y=137;width=12;height=6;angle=12;bc=#000000;pw=0;"
shape[129] = "func=rect;x=169;y=142;width=26;height=11;angle=347;bc=#7D7D7D;pw=0;"
shape[130] = "func=line;x=158;y=150;x1=15;y1=0;x2=0;y2=1;pc=#000000;pw=4;"
shape[131] = "func=line;x=26;y=134;x1=0;y1=0;x2=36;y2=0;pc=#7D7D7D;pw=2;"
shape[132] = "func=tri;x=169;y=86;x1=6;y1=0;x2=0;y2=28;x3=12;y3=28;angle=233;bc=#000000;pw=0;"
shape[133] = "func=tri;x=172;y=91;x1=6;y1=0;x2=0;y2=28;x3=12;y3=28;angle=233;bc=#000000;pw=0;"
shape[134] = "func=tri;x=240;y=117;x1=5;y1=0;x2=0;y2=19;x3=10;y3=19;angle=349;bc=#000000;pw=0;"
shape[135] = "func=tri;x=192;y=117;x1=5;y1=0;x2=0;y2=19;x3=10;y3=19;angle=83;bc=#000000;pw=0;"
shape[136] = "func=tri;x=188;y=112;x1=5;y1=0;x2=0;y2=19;x3=10;y3=19;angle=83;bc=#000000;pw=0;"
shape[137] = "func=tri;x=231;y=127;x1=5;y1=0;x2=0;y2=19;x3=10;y3=19;angle=349;bc=#000000;pw=0;"
shape[138] = "func=line;x=202;y=91;x1=0;y1=6;x2=11;y2=0;pc=#B98564;pw=2;"
shape[139] = "func=line;x=233;y=94;x1=0;y1=0;x2=8;y2=3;pc=#B98564;pw=2;"
shape[140] = "func=line;x=216;y=63;x1=0;y1=0;x2=0;y2=12;pc=#000000;pw=2;"
shape[141] = "func=line;x=215;y=76;x1=0;y1=0;x2=0;y2=8;pc=#000000;pw=2;"
shape[142] = "func=line;x=207;y=84;x1=7;y1=0;x2=0;y2=11;pc=#000000;pw=2;"
shape[143] = "func=line;x=218;y=63;x1=2;y1=0;x2=0;y2=15;pc=#000000;pw=2;"
shape[144] = "func=line;x=215;y=78;x1=3;y1=0;x2=0;y2=11;pc=#000000;pw=2;"
shape[145] = "func=line;x=226;y=62;x1=0;y1=0;x2=5;y2=15;pc=#7D7D7D;pw=2;"
shape[146] = "func=line;x=234;y=64;x1=0;y1=0;x2=2;y2=12;pc=#7D7D7D;pw=2;"
shape[147] = "func=line;x=239;y=62;x1=0;y1=0;x2=3;y2=9;pc=#7D7D7D;pw=2;"
shape[148] = "func=line;x=246;y=64;x1=0;y1=0;x2=4;y2=7;pc=#7D7D7D;pw=2;"
shape[149] = "func=line;x=199;y=52;x1=0;y1=0;x2=8;y2=2;pc=#7D7D7D;pw=2;"
shape[150] = "func=line;x=205;y=60;x1=0;y1=0;x2=5;y2=1;pc=#7D7D7D;pw=2;"
shape[151] = "func=line;x=244;y=51;x1=0;y1=0;x2=12;y2=18;pc=#7D7D7D;pw=2;"
shape[152] = "func=line;x=257;y=142;x1=0;y1=0;x2=4;y2=3;pc=#7D7D7D;pw=2;"
shape[153] = "func=line;x=253;y=150;x1=0;y1=0;x2=7;y2=8;pc=#7D7D7D;pw=2;"
shape[154] = "func=line;x=249;y=154;x1=0;y1=0;x2=4;y2=6;pc=#7D7D7D;pw=2;"
shape[155] = "func=line;x=253;y=92;x1=0;y1=0;x2=6;y2=10;pc=#7D7D7D;pw=2;"
shape[156] = "func=ell;x=103;y=217;width=4;height=3;bc=#DEC5B5;pw=0;"
shape[157] = "func=ell;x=101;y=218;width=3;height=0;bc=#DEC5B5;pw=0;"
shape[158] = "func=ell;x=102;y=217;width=0;height=1;bc=#DEC5B5;pw=0;"
shape[159] = "func=rect;x=81;y=202;width=46;height=50;bc=#DEC5B5;pw=0;"
shape[160] = "func=ell;x=51;y=228;width=25;height=43;angle=349;bc=#64553F;pw=0;"
shape[161] = "func=ell;x=54;y=184;width=31;height=39;bc=#64553F;pw=0;"
shape[162] = "func=ell;x=59;y=184;width=58;height=40;bc=#DEC5B5;pw=0;"
shape[163] = "func=ell;x=56;y=210;width=31;height=54;bc=#DEC5B5;pw=0;"
shape[164] = "func=ell;x=59;y=237;width=63;height=30;bc=#DEC5B5;pw=0;"
shape[165] = "func=rect;x=103;y=228;width=17;height=27;angle=10;bc=#64553F;pw=0;"
shape[166] = "func=rect;x=73;y=259;width=52;height=30;angle=348;bc=#CEA992;pw=0;"
shape[167] = "func=rect;x=87;y=270;width=46;height=24;angle=322;bc=#BE5D50;pw=0;"
shape[168] = "func=rect;x=106;y=279;width=61;height=32;angle=16;bc=#BE5D50;pw=0;"
shape[169] = "func=ell;x=126;y=268;width=25;height=33;bc=#64553F;pw=0;"
shape[170] = "func=ell;x=120;y=231;width=17;height=46;angle=354;bc=#64553F;pw=0;"
shape[171] = "func=ell;x=33;y=298;width=122;height=33;bc=#000000;pw=0;"
shape[172] = "func=tri;x=60;y=246;x1=23;y1=0;x2=0;y2=103;x3=47;y3=103;angle=96;bc=#000000;pw=0;"
shape[173] = "func=rect;x=162;y=185;width=118;height=130;bc=#E1EFF4;pw=0;"
shape[174] = "func=ell;x=57;y=237;width=16;height=6;angle=336;bc=#64553F;pw=0;"
shape[175] = "func=ell;x=73;y=237;width=16;height=6;angle=20;bc=#64553F;pw=0;"
shape[176] = "func=ell;x=86;y=242;width=4;height=12;bc=#64553F;pw=0;"
shape[177] = "func=ell;x=58;y=242;width=5;height=11;angle=346;bc=#64553F;pw=0;"
shape[178] = "func=tri;x=60;y=209;x1=9;y1=0;x2=0;y2=21;x3=18;y3=21;angle=201;bc=#CEA992;pw=0;"
shape[179] = "func=ell;x=64;y=214;width=7;height=9;bc=#000000;pw=0;"
shape[180] = "func=ell;x=89;y=215;width=7;height=9;bc=#000000;pw=0;"
shape[181] = "func=line;x=85;y=213;x1=0;y1=0;x2=17;y2=7;pc=#000000;pw=2;"
shape[182] = "func=line;x=61;y=213;x1=0;y1=7;x2=12;y2=0;pc=#000000;pw=2;"
shape[183] = "func=line;x=86;y=204;x1=0;y1=0;x2=17;y2=6;pc=#64553F;pw=2;"
shape[184] = "func=line;x=102;y=210;x1=0;y1=0;x2=8;y2=7;pc=#64553F;pw=2;"
shape[185] = "func=line;x=65;y=207;x1=6;y1=0;x2=0;y2=0;pc=#64553F;pw=2;"
shape[186] = "func=line;x=59;y=207;x1=6;y1=0;x2=0;y2=6;pc=#64553F;pw=2;"
shape[187] = "func=line;x=72;y=244;x1=0;y1=0;x2=15;y2=5;pc=#BE5D50;pw=2;"
shape[188] = "func=tri;x=62;y=230;x1=11;y1=0;x2=0;y2=8;x3=22;y3=8;angle=176;bc=#CEA992;pw=0;"
shape[189] = "func=ell;x=111;y=272;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[190] = "func=ell;x=118;y=286;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[191] = "func=ell;x=107;y=282;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[192] = "func=ell;x=98;y=278;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[193] = "func=ell;x=121;y=275;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[194] = "func=ell;x=146;y=297;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[195] = "func=ell;x=151;y=288;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[196] = "func=ell;x=115;y=262;width=6;height=6;bc=#FFFFFF;pw=0;"
shape[197] = "func=rect;x=106;y=185;width=29;height=40;bc=#9D8562;pw=0;"
shape[198] = "func=ell;x=128;y=184;width=17;height=52;angle=352;bc=#9D8562;pw=0;"
shape[199] = "func=ell;x=104;y=221;width=43;height=19;angle=12;bc=#9D8562;pw=0;"
shape[200] = "func=ell;x=133;y=229;width=17;height=47;bc=#9D8562;pw=0;"
shape[201] = "func=line;x=103;y=186;x1=0;y1=0;x2=7;y2=7;pc=#64553F;pw=2;"
shape[202] = "func=line;x=95;y=185;x1=0;y1=0;x2=5;y2=9;pc=#64553F;pw=2;"
shape[203] = "func=line;x=100;y=194;x1=0;y1=0;x2=11;y2=6;pc=#64553F;pw=2;"
shape[204] = "func=line;x=90;y=185;x1=0;y1=0;x2=4;y2=10;pc=#64553F;pw=2;"
shape[205] = "func=line;x=94;y=195;x1=0;y1=0;x2=11;y2=6;pc=#64553F;pw=2;"
shape[206] = "func=line;x=79;y=184;x1=0;y1=0;x2=0;y2=8;pc=#64553F;pw=2;"
shape[207] = "func=line;x=57;y=186;x1=2;y1=0;x2=0;y2=12;pc=#64553F;pw=2;"
shape[208] = "func=line;x=49;y=210;x1=8;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[209] = "func=line;x=49;y=220;x1=12;y1=0;x2=0;y2=19;pc=#64553F;pw=2;"
shape[210] = "func=line;x=44;y=239;x1=5;y1=0;x2=0;y2=2;pc=#64553F;pw=2;"
shape[211] = "func=line;x=52;y=219;x1=9;y1=0;x2=0;y2=10;pc=#64553F;pw=2;"
shape[212] = "func=line;x=46;y=229;x1=6;y1=0;x2=0;y2=4;pc=#64553F;pw=2;"
shape[213] = "func=line;x=100;y=180;x1=0;y1=0;x2=10;y2=12;pc=#64553F;pw=2;"
shape[214] = "func=line;x=100;y=183;x1=0;y1=0;x2=4;y2=10;pc=#64553F;pw=2;"
shape[215] = "func=line;x=111;y=201;x1=0;y1=0;x2=1;y2=10;pc=#64553F;pw=2;"
shape[216] = "func=line;x=110;y=211;x1=2;y1=0;x2=0;y2=4;pc=#64553F;pw=2;"
shape[217] = "func=line;x=103;y=220;x1=4;y1=0;x2=0;y2=7;pc=#64553F;pw=2;"
shape[218] = "func=line;x=103;y=227;x1=0;y1=0;x2=6;y2=13;pc=#64553F;pw=2;"
shape[219] = "func=line;x=116;y=202;x1=0;y1=0;x2=1;y2=11;pc=#64553F;pw=2;"
shape[220] = "func=line;x=113;y=214;x1=4;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[221] = "func=line;x=114;y=228;x1=0;y1=0;x2=5;y2=8;pc=#64553F;pw=2;"
shape[222] = "func=line;x=119;y=236;x1=0;y1=0;x2=18;y2=5;pc=#64553F;pw=2;"
shape[223] = "func=line;x=137;y=241;x1=0;y1=0;x2=8;y2=12;pc=#64553F;pw=2;"
shape[224] = "func=line;x=135;y=247;x1=0;y1=0;x2=9;y2=18;pc=#64553F;pw=2;"
shape[225] = "func=line;x=141;y=264;x1=2;y1=0;x2=0;y2=16;pc=#64553F;pw=2;"
shape[226] = "func=line;x=134;y=244;x1=0;y1=0;x2=2;y2=7;pc=#64553F;pw=2;"
shape[227] = "func=line;x=130;y=192;x1=0;y1=0;x2=8;y2=20;pc=#64553F;pw=2;"
shape[228] = "func=line;x=138;y=212;x1=0;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[229] = "func=line;x=121;y=191;x1=0;y1=0;x2=6;y2=17;pc=#64553F;pw=2;"
shape[230] = "func=line;x=127;y=210;x1=0;y1=0;x2=2;y2=15;pc=#64553F;pw=2;"
shape[231] = "func=line;x=123;y=206;x1=0;y1=0;x2=1;y2=21;pc=#64553F;pw=2;"
shape[232] = "func=line;x=123;y=227;x1=0;y1=0;x2=13;y2=7;pc=#64553F;pw=2;"
shape[233] = "func=line;x=140;y=235;x1=0;y1=0;x2=8;y2=12;pc=#64553F;pw=2;"
shape[234] = "func=line;x=149;y=265;x1=0;y1=0;x2=4;y2=10;pc=#64553F;pw=2;"
shape[235] = "func=line;x=144;y=275;x1=9;y1=0;x2=0;y2=17;pc=#64553F;pw=2;"
shape[236] = "func=line;x=62;y=244;x1=12;y1=0;x2=0;y2=4;pc=#BE5D50;pw=2;"
shape[237] = "func=line;x=71;y=270;x1=0;y1=0;x2=4;y2=15;pc=#64553F;pw=2;"
shape[238] = "func=line;x=67;y=268;x1=0;y1=0;x2=5;y2=15;pc=#64553F;pw=2;"
shape[239] = "func=line;x=64;y=270;x1=0;y1=0;x2=5;y2=12;pc=#64553F;pw=2;"
shape[240] = "func=line;x=125;y=240;x1=0;y1=0;x2=0;y2=13;pc=#9D8562;pw=2;"
shape[241] = "func=line;x=126;y=255;x1=0;y1=0;x2=8;y2=12;pc=#9D8562;pw=2;"
shape[242] = "func=line;x=134;y=267;x1=0;y1=0;x2=0;y2=6;pc=#9D8562;pw=2;"
shape[243] = "func=line;x=146;y=267;x1=2;y1=0;x2=0;y2=13;pc=#9D8562;pw=2;"
shape[244] = "func=line;x=138;y=280;x1=8;y1=0;x2=0;y2=9;pc=#9D8562;pw=2;"
shape[245] = "func=line;x=131;y=289;x1=7;y1=0;x2=0;y2=0;pc=#9D8562;pw=2;"
shape[246] = "func=line;x=144;y=282;x1=4;y1=0;x2=0;y2=10;pc=#9D8562;pw=2;"
shape[247] = "func=line;x=134;y=290;x1=10;y1=0;x2=0;y2=5;pc=#9D8562;pw=2;"
shape[248] = "func=line;x=122;y=261;x1=0;y1=0;x2=7;y2=15;pc=#9D8562;pw=2;"
shape[249] = "func=line;x=132;y=274;x1=8;y1=0;x2=0;y2=7;pc=#9D8562;pw=2;"
shape[250] = "func=line;x=60;y=181;x1=5;y1=0;x2=0;y2=12;pc=#9D8562;pw=2;"
shape[251] = "func=line;x=66;y=183;x1=6;y1=0;x2=0;y2=8;pc=#9D8562;pw=2;"
shape[252] = "func=line;x=58;y=183;x1=1;y1=0;x2=0;y2=2;pc=#9D8562;pw=2;"
shape[253] = "func=line;x=55;y=214;x1=5;y1=0;x2=0;y2=10;pc=#9D8562;pw=2;"
shape[254] = "func=line;x=47;y=224;x1=8;y1=0;x2=0;y2=5;pc=#9D8562;pw=2;"
shape[255] = "func=line;x=130;y=244;x1=0;y1=0;x2=6;y2=17;pc=#9D8562;pw=2;"
shape[256] = "func=ell;x=178;y=237;width=99;height=62;angle=18;bc=#191510;pw=0;"
shape[257] = "func=ell;x=173;y=210;width=104;height=62;angle=7;bc=#191510;pw=0;"
shape[258] = "func=ell;x=188;y=178;width=72;height=54;bc=#64553F;pw=0;"
shape[259] = "func=tri;x=240;y=203;x1=17;y1=0;x2=0;y2=30;x3=34;y3=30;angle=12;bc=#64553F;pw=0;"
shape[260] = "func=ell;x=191;y=277;width=12;height=25;angle=17;bc=#191510;pw=0;"
shape[261] = "func=ell;x=233;y=274;width=18;height=41;angle=7;bc=#191510;pw=0;"
shape[262] = "func=ell;x=192;y=227;width=60;height=58;bc=#CEA992;pw=0;"
shape[263] = "func=tri;x=216;y=265;x1=19;y1=0;x2=0;y2=42;x3=39;y3=42;angle=38;bc=#B98564;pw=0;"
shape[264] = "func=ell;x=193;y=238;width=18;height=49;angle=348;bc=#CEA992;pw=0;"
shape[265] = "func=ell;x=204;y=279;width=26;height=14;angle=5;bc=#B98564;pw=0;"
shape[266] = "func=rect;x=194;y=223;width=46;height=20;angle=346;bc=#CEA992;pw=0;"
shape[267] = "func=ell;x=192;y=214;width=47;height=22;angle=349;bc=#CEA992;pw=0;"
shape[268] = "func=ell;x=187;y=221;width=19;height=6;angle=14;bc=#191510;pw=0;"
shape[269] = "func=ell;x=211;y=218;width=19;height=6;angle=340;bc=#191510;pw=0;"
shape[270] = "func=ell;x=221;y=214;width=18;height=6;bc=#191510;pw=0;"
shape[271] = "func=ell;x=219;y=227;width=17;height=8;angle=359;bc=#FFFFFF;pc=#191510;pw=1;"
shape[272] = "func=tri;x=192;y=231;x1=13;y1=0;x2=0;y2=13;x3=26;y3=13;angle=71;bc=#B98564;pw=0;"
shape[273] = "func=ell;x=195;y=231;width=14;height=8;angle=349;bc=#FFFFFF;pc=#191510;pw=1;"
shape[274] = "func=ell;x=195;y=231;width=7;height=9;bc=#000000;pw=0;"
shape[275] = "func=ell;x=220;y=227;width=7;height=9;bc=#000000;pw=0;"
shape[276] = "func=line;x=216;y=247;x1=0;y1=0;x2=15;y2=10;pc=#B98564;pw=2;"
shape[277] = "func=line;x=229;y=258;x1=0;y1=0;x2=2;y2=4;pc=#B98564;pw=2;"
shape[278] = "func=line;x=234;y=249;x1=0;y1=0;x2=4;y2=7;pc=#B98564;pw=2;"
shape[279] = "func=line;x=236;y=256;x1=2;y1=0;x2=0;y2=9;pc=#B98564;pw=2;"
shape[280] = "func=line;x=198;y=253;x1=3;y1=0;x2=0;y2=7;pc=#B98564;pw=2;"
shape[281] = "func=line;x=198;y=261;x1=0;y1=0;x2=3;y2=7;pc=#B98564;pw=2;"
shape[282] = "func=rect;x=206;y=259;width=14;height=13;angle=341;bc=#FFFFFF;pw=0;"
shape[283] = "func=tri;x=215;y=255;x1=7;y1=0;x2=0;y2=14;x3=15;y3=14;angle=70;bc=#FFFFFF;pw=0;"
shape[284] = "func=line;x=203;y=263;x1=0;y1=6;x2=24;y2=0;pc=#000000;pw=4;"
shape[285] = "func=line;x=201;y=263;x1=0;y1=0;x2=7;y2=10;pc=#BE5D50;pw=2;"
shape[286] = "func=line;x=208;y=272;x1=0;y1=2;x2=11;y2=0;pc=#BE5D50;pw=2;"
shape[287] = "func=line;x=219;y=261;x1=0;y1=11;x2=11;y2=0;pc=#BE5D50;pw=2;"
shape[288] = "func=line;x=219;y=259;x1=10;y1=1;x2=0;y2=0;pc=#BE5D50;pw=2;"
shape[289] = "func=line;x=203;y=258;x1=17;y1=0;x2=0;y2=3;pc=#BE5D50;pw=2;"
shape[290] = "func=line;x=209;y=255;x1=0;y1=0;x2=11;y2=0;pc=#64553F;pw=4;"
shape[291] = "func=line;x=200;y=256;x1=7;y1=0;x2=0;y2=3;pc=#64553F;pw=4;"
shape[292] = "func=line;x=200;y=259;x1=1;y1=0;x2=0;y2=4;pc=#64553F;pw=4;"
shape[293] = "func=line;x=220;y=255;x1=0;y1=0;x2=9;y2=3;pc=#64553F;pw=4;"
shape[294] = "func=ell;x=223;y=190;width=13;height=26;angle=338;bc=#CEA992;pw=0;"
shape[295] = "func=tri;x=198;y=202;x1=6;y1=0;x2=0;y2=19;x3=13;y3=19;angle=349;bc=#CEA992;pw=0;"
shape[296] = "func=tri;x=220;y=190;x1=16;y1=0;x2=0;y2=17;x3=33;y3=17;angle=61;bc=#64553F;pw=0;"
shape[297] = "func=line;x=261;y=205;x1=0;y1=0;x2=12;y2=31;pc=#64553F;pw=2;"
shape[298] = "func=line;x=180;y=202;x1=10;y1=0;x2=0;y2=17;pc=#64553F;pw=2;"
shape[299] = "func=line;x=181;y=220;x1=0;y1=0;x2=0;y2=9;pc=#64553F;pw=2;"
shape[300] = "func=line;x=255;y=246;x1=5;y1=0;x2=0;y2=17;pc=#64553F;pw=2;"
shape[301] = "func=line;x=260;y=246;x1=7;y1=0;x2=0;y2=16;pc=#64553F;pw=2;"
shape[302] = "func=line;x=263;y=252;x1=8;y1=0;x2=0;y2=14;pc=#64553F;pw=2;"
shape[303] = "func=line;x=268;y=258;x1=3;y1=0;x2=0;y2=15;pc=#64553F;pw=2;"
shape[304] = "func=line;x=180;y=245;x1=0;y1=0;x2=11;y2=20;pc=#64553F;pw=2;"
shape[305] = "func=line;x=189;y=248;x1=0;y1=0;x2=3;y2=12;pc=#64553F;pw=2;"
shape[306] = "func=line;x=229;y=186;x1=0;y1=0;x2=6;y2=8;pc=#191510;pw=2;"
shape[307] = "func=line;x=234;y=194;x1=0;y1=0;x2=7;y2=14;pc=#191510;pw=2;"
shape[308] = "func=line;x=241;y=208;x1=0;y1=0;x2=1;y2=9;pc=#191510;pw=2;"
shape[309] = "func=line;x=242;y=217;x1=0;y1=0;x2=12;y2=14;pc=#191510;pw=2;"
shape[310] = "func=line;x=240;y=224;x1=0;y1=0;x2=11;y2=10;pc=#191510;pw=2;"
shape[311] = "func=line;x=242;y=198;x1=0;y1=0;x2=7;y2=13;pc=#191510;pw=2;"
shape[312] = "func=line;x=249;y=212;x1=0;y1=0;x2=5;y2=9;pc=#191510;pw=2;"
shape[313] = "func=line;x=255;y=222;x1=0;y1=0;x2=13;y2=5;pc=#191510;pw=2;"
shape[314] = "func=line;x=257;y=227;x1=0;y1=0;x2=15;y2=9;pc=#191510;pw=2;"
shape[315] = "func=line;x=281;y=215;x1=6;y1=11;x2=0;y2=0;pc=#191510;pw=2;"
shape[316] = "func=line;x=214;y=199;x1=0;y1=0;x2=7;y2=16;pc=#191510;pw=2;"
shape[317] = "func=line;x=210;y=204;x1=0;y1=0;x2=4;y2=10;pc=#191510;pw=2;"
shape[318] = "func=line;x=204;y=205;x1=0;y1=0;x2=3;y2=12;pc=#191510;pw=2;"
shape[319] = "func=line;x=195;y=211;x1=0;y1=0;x2=2;y2=10;pc=#191510;pw=2;"
shape[320] = "func=line;x=198;y=207;x1=0;y1=0;x2=1;y2=10;pc=#191510;pw=2;"
shape[321] = "func=line;x=188;y=207;x1=2;y1=0;x2=0;y2=17;pc=#191510;pw=2;"
shape[322] = "func=line;x=182;y=210;x1=5;y1=0;x2=0;y2=12;pc=#191510;pw=2;"
shape[323] = "func=line;x=197;y=188;x1=10;y1=0;x2=0;y2=11;pc=#191510;pw=2;"
shape[324] = "func=line;x=196;y=199;x1=1;y1=0;x2=0;y2=11;pc=#191510;pw=2;"
shape[325] = "func=line;x=191;y=198;x1=3;y1=0;x2=0;y2=15;pc=#191510;pw=2;"
shape[326] = "func=line;x=193;y=191;x1=5;y1=0;x2=0;y2=10;pc=#191510;pw=2;"
shape[327] = "func=line;x=215;y=185;x1=3;y1=0;x2=0;y2=12;pc=#191510;pw=2;"
shape[328] = "func=line;x=209;y=185;x1=2;y1=0;x2=0;y2=10;pc=#191510;pw=2;"
shape[329] = "func=line;x=209;y=195;x1=0;y1=0;x2=0;y2=9;pc=#191510;pw=2;"
shape[330] = "func=line;x=202;y=197;x1=0;y1=0;x2=2;y2=8;pc=#191510;pw=2;"
shape[331] = "func=line;x=224;y=187;x1=0;y1=0;x2=7;y2=11;pc=#191510;pw=2;"
shape[332] = "func=line;x=231;y=198;x1=0;y1=0;x2=4;y2=12;pc=#191510;pw=2;"
shape[333] = "func=line;x=220;y=186;x1=3;y1=0;x2=0;y2=11;pc=#191510;pw=2;"
shape[334] = "func=line;x=184;y=211;x1=4;y1=0;x2=0;y2=13;pc=#191510;pw=2;"
shape[335] = "func=line;x=266;y=273;x1=0;y1=0;x2=4;y2=7;pc=#191510;pw=2;"
shape[336] = "func=line;x=265;y=233;x1=0;y1=0;x2=5;y2=7;pc=#191510;pw=2;"
shape[337] = "func=line;x=261;y=234;x1=0;y1=0;x2=7;y2=8;pc=#64553F;pw=2;"
shape[338] = "func=line;x=258;y=240;x1=0;y1=0;x2=7;y2=7;pc=#64553F;pw=2;"
shape[339] = "func=line;x=259;y=273;x1=0;y1=0;x2=0;y2=9;pc=#64553F;pw=2;"
shape[340] = "func=line;x=254;y=275;x1=0;y1=0;x2=0;y2=7;pc=#64553F;pw=2;"
shape[341] = "func=line;x=36;y=49;x1=0;y1=0;x2=244;y2=1;pc=#FFFFFF;pw=2;"
shape[342] = "func=line;x=36;y=45;x1=1;y1=0;x2=0;y2=269;pc=#FFFFFF;pw=2;"
shape[343] = "func=line;x=281;y=49;x1=0;y1=0;x2=0;y2=267;pc=#FFFFFF;pw=2;"
shape[344] = "func=line;x=35;y=315;x1=247;y1=0;x2=0;y2=0;pc=#FFFFFF;pw=2;"
shape[345] = "func=line;x=155;y=50;x1=1;y1=0;x2=0;y2=265;pc=#FFFFFF;pw=2;"
shape[346] = "func=line;x=164;y=49;x1=0;y1=0;x2=0;y2=265;pc=#FFFFFF;pw=2;"
shape[347] = "func=line;x=37;y=177;x1=0;y1=0;x2=244;y2=0;pc=#FFFFFF;pw=2;"
shape[348] = "func=line;x=36;y=186;x1=0;y1=0;x2=244;y2=0;pc=#FFFFFF;pw=2;"
shape[349] = "func=rect;x=157;y=36;width=6;height=296;bc=#000000;pw=0;"
shape[350] = "func=rect;x=21;y=178;width=263;height=7;bc=#000000;pw=0;"
shape[351] = "func=rect;x=21;y=26;width=274;height=23;bc=#000000;pw=0;"
shape[352] = "func=rect;x=16;y=39;width=19;height=281;bc=#000000;pw=0;"
shape[353] = "func=text;x=120;y=14;text=LET IT BE;fn=Arial;fb=True;bc=#CCCCCC;fs=18;"
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
ElseIf x = 0 Then
a = 0
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 cx, cy - rotation center
' 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
If cx <> "" Then
param["cx"] = cx
Else
cx = "" ' to avoid syntax error
param["cx"] = shWidth / 2
EndIf
If cy <> "" Then
param["cy"] = cy
Else
cy = "" ' to avoid syntax error
param["cy"] = shHeight / 2
EndIf
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