Density Independence Examples
import Felgo 4.0
import QtQuick 2.0
GameWindow {
id: gameWindow
screenWidth: 960
screenHeight: 640
activeScene: scene
Scene {
id: scene
Loader {
id: sideBarLoader
active: gameWindow.landscape
sourceComponent: sideBarComponent
width: gameWindow.landscape ? scene.dp(120) : 0
anchors.top: scene.gameWindowAnchorItem.top
height: scene.gameWindowAnchorItem.height
anchors.left: scene.gameWindowAnchorItem.left
}
Component {
id: sideBarComponent
Rectangle {
color: "blue"
}
}
ListView {
anchors.left: sideBarLoader.right
anchors.right: scene.gameWindowAnchorItem.right
height: scene.gameWindowAnchorItem.height
delegate: listViewDelegate
spacing: scene.dp(2)
model: [ "", "", "", ]
}
Component {
id: listViewDelegate
Rectangle {
height: gameWindow.tablet ? scene.dp(80) : scene.dp(48)
width: parent.width
color: "grey"
}
}