Paging » Creating many pages
Creating many pages
To quickly create a bunch of pages you can use a for…in
loop.
# using a loop to add 8 pages
for number in [1..8]
# creating a page
aPage = new Layer
width: page.width, height: page.height
backgroundColor: cycler()
# adding a label (+ resizing it)
Utils.labelLayer aPage, "Page " + number
# adding the page to the PageComponent
page.addPage aPage
I used ? Label Layer to add a label to every page.