Skip to content
Snippets Groups Projects
Select Git revision
  • 0a3fa25bdfe15fa98d3d4e5eca22403403aec5f5
  • master default protected
2 results

GameWindow.qml

Blame
  • GameWindow.qml 1.22 KiB
    import QtQuick
    import QtQuick.Controls
    
    Item {
        width: 900
        height: 800
    
    
        Rectangle {
            id: rectangle
            color: "#8ff0a4"
            anchors.fill: parent
    
            Grid {
                id: letterGrid
                columns: jeu.getWidth()
                rows: jeu.getHeight()
                spacing: 4
                anchors.centerIn: parent
                width: 600
                height: 400
    
                Repeater {
                    model: letterModel
    
                    delegate: Rectangle {
                        width: 60
                        height: 60
                        border.color: "#888"
                        radius: 5
    
                        color: {
                            switch (model.state) {
                                case 1: return "yellow";
                                case 2: return "red";
                                default: return "#dddddd";
                            }
                        }
    
                        Text {
                            anchors.centerIn: parent
                            text: model.letter
                            font.pixelSize: 24
                        }
    
                        }
                    }
                }
    
            }
    
            Clavier {
                id: clavier
                x: 225
                y: 594
            }
        }