You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let a = new pack_array();
a[0] = 0;
a[1] = 11;
a[3] = 33;
a[4] = new pack_circle();
function - release(index) 將綁定在陣列上的物件釋放,也可在替換陣列內容前使用,以避免位置要被取代的舊動畫物件被刪除
範例程式
let a = new pack_array();
a[2] = new pack_circle();
a.release(2);
a[2] = new pack_square();
範例程式(名為"myArray"的array)
let a_s = new pack_square();
a_s.text._val = "myArray";
a_s.fill._val = "transparent"
a_s.stroke._val = "transparent"
let myArray = new pack_array(a_s.pos);
myArray[3] = 3;
更多範例程式(2d array)
let n = 5, m = 3;
let c = new pack_circle();
let a = new pack_array(c.pos, 50, 1.57);
for (let i = 0; i < n; i++) {
a[i] = new pack_array(a.coord(i));
a.boxArray[i].hide._val = true;
for (let j = 0; j < m; j++) {
a[i][j] = 0;
}
}