Set bg map to 32 x 32
This commit is contained in:
parent
6a42bf273a
commit
4d1be1578f
|
@ -5,8 +5,8 @@ Window {
|
|||
title: "Background maps"
|
||||
// A background map is 32 x 32 tiles.
|
||||
// Each tile is 8 x 8 pixels.
|
||||
width: 256
|
||||
height: 256
|
||||
width: 32 * (16 + 1) + 1
|
||||
height: 32 * (16 + 1) + 1
|
||||
maximumWidth: width
|
||||
minimumWidth: width
|
||||
maximumHeight: height
|
||||
|
|
|
@ -1,57 +1,24 @@
|
|||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
width: 400
|
||||
height: 400
|
||||
|
||||
GridView {
|
||||
id: bgmap_01
|
||||
visible: true
|
||||
smooth: false
|
||||
enabled: false
|
||||
keyNavigationWraps: false
|
||||
interactive: false
|
||||
anchors.fill: parent
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
delegate: Item {
|
||||
x: 5
|
||||
height: 50
|
||||
Column {
|
||||
width: 8
|
||||
height: 8
|
||||
spacing: 0
|
||||
|
||||
Rectangle {
|
||||
x: 0
|
||||
width: 8
|
||||
height: 8
|
||||
color: colorCode
|
||||
border.width: 1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
cellWidth: 8
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
name: "Grey"
|
||||
colorCode: "grey"
|
||||
}
|
||||
width: 32 * (16 + 1) + 1; height: 32 * (16 + 1) + 1; color: "black"
|
||||
|
||||
ListElement {
|
||||
name: "Red"
|
||||
colorCode: "red"
|
||||
}
|
||||
Grid {
|
||||
x: 1; y: 1
|
||||
rows: 32; columns: 32; spacing: 1
|
||||
|
||||
ListElement {
|
||||
name: "Blue"
|
||||
colorCode: "blue"
|
||||
}
|
||||
Repeater {
|
||||
model: parent.rows * parent.columns
|
||||
Rectangle {
|
||||
width: 16; height: 16
|
||||
color: "lightgreen"
|
||||
|
||||
ListElement {
|
||||
name: "Green"
|
||||
colorCode: "green"
|
||||
Text {
|
||||
text: index
|
||||
font.pointSize: 12
|
||||
anchors.centerIn: parent } }
|
||||
}
|
||||
}
|
||||
cellHeight: 8
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue