main.qml Example File
accelgame/assets/main.qml
import bb.cascades 1.0
Page {
onCreationCompleted: {
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All
}
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
layout: StackLayout {
orientation: (OrientationSupport.orientation == UIOrientation.Portrait ? LayoutOrientation.TopToBottom : LayoutOrientation.LeftToRight)
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredWidth: 600
layoutProperties: StackLayoutProperties {
spaceQuota: 7
}
layout: DockLayout {}
Maze {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredWidth: 400
layoutProperties: StackLayoutProperties {
spaceQuota: 2
}
Button {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr ("New Game")
onClicked: _gameController.newGame()
}
}
}
}
}