Skip to content

Instantly share code, notes, and snippets.

@40
Created August 11, 2012 20:46
Show Gist options
  • Save 40/3327173 to your computer and use it in GitHub Desktop.
Save 40/3327173 to your computer and use it in GitHub Desktop.
Applying tiled background to container or page in #BB10 Cascades
Container {
id: rootContainer
background: back.imagePaint
attachedObjects: [
ImagePaintDefinition {
id: back
repeatPattern: RepeatPattern.XY
imageSource: "asset:///container/tiled/core16x16"
}
]
}
Page {
id: tab1
background: t1bg.imagePaint
attachedObjects: [
ImagePaintDefinition {
id: t1bg
repeatPattern: RepeatPattern.XY
imageSource: "asset:///container/tiled/core16x16"
}
]
}
Page {
id: tab2
background: t2bg.imagePaint
attachedObjects: [
ImagePaintDefinition {
id: t2bg
repeatPattern: RepeatPattern.XY
imageSource: "asset:///container/tiled/core16x16"
}
]
}
Page {
id: tab3
background: t3bg.imagePaint
attachedObjects: [
ImagePaintDefinition {
id: t3bg
repeatPattern: RepeatPattern.XY
imageSource: "asset:///container/tiled/core16x16"
}
]
}
@philippelatulippe
Copy link

For people arriving here from a search engine, make sure you read the documentation for RepeatPattern before trying this. In particular, the image must be a power of two (with any ratio) and must have a metadata (.amd) file that sets "repeatable: true".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment