'If not B4XPages then MainForm.RootPane.AddNode(blackpieces(i).As(Pane), Rnd(50,900), Rnd(50,600), 40, 40)
'Label1 is just a label in myPieceLayout, I gave it some color and a border for clarity
For i = 0 To 14
blackpieces(i) = xui.CreatePanel("")
Root.AddView(blackpieces(i), Rnd(50,900),Rnd(50,600), 40, 40)
blackpieces(i).LoadLayout("myPieceLayout")
Sleep(10) 'need a little time to load layout
label1.SetLayoutAnimated(0, 0, 0, 40, 40)
b4xc.Initialize(blackpieces(i))
label1.SendToBack
b4xc.DrawCircle(20,20,15,xui.Color_Black,False,1)
b4xc.Invalidate
Next