Sub Activity_Create(FirstTime As Boolean)
'Create the panels.
'In this example we are just creating 6 "dummy" panels with different colors.
'It is possible to load a layout for each panel but this is slow and initializing the GUI
'will take some time. It is really better to manually create the complete by code here.
If FirstTime Then
If File.Exists(File.DirDefaultExternal, "0.txt") = False Then
File.Copy(File.DirAssets, "0.txt", File.DirDefaultExternal, "0.txt")
File.Copy(File.DirAssets, "1.txt", File.DirDefaultExternal, "1.txt")
File.Copy(File.DirAssets, "2.txt", File.DirDefaultExternal, "2.txt")
End If
End If
Dim panels(3) As Panel
For i = 0 To panels.Length - 1
panels(i).Initialize("panels")
panels(i).Color = Colors.White
story.Initialize("")
story.Text = File.ReadString(File.DirDefaultExternal, i & ".txt")
story.TextSize = 20
story.TextColor = Colors.Black
story.Gravity = 1
panels(i).AddView(story, 5, 5, 95%x, 430dip)
Activity.AddView(panels(i), 100%x, 0, 100%x, 100%y - 80dip) 'add the panel to the layout
Next