Skip to content
Snippets Groups Projects
Commit 821766b2 authored by Le Tiec Aymeric's avatar Le Tiec Aymeric
Browse files

Avancement du design de la partie et du main

parent 56ca9b3d
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ qt_add_qml_module(appJeu_2048 ...@@ -22,6 +22,7 @@ qt_add_qml_module(appJeu_2048
QML_FILES Partie.qml QML_FILES Partie.qml
QML_FILES Menu_de_Controle.qml QML_FILES Menu_de_Controle.qml
SOURCES game2048.h game2048.cpp SOURCES game2048.h game2048.cpp
QML_FILES Case.qml
) )
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
......
import QtQuick
Item {
property alias _textText: _text.text
property alias _textColor: _text.color
property alias _textFontpixelSize: _text.font.pixelSize
property alias rectangleColor: rectangle.color
property alias rectangleX: rectangle.x
property alias rectangleY: rectangle.y
Rectangle {
id: rectangle
x: 0
y: 0
width: 100
height: 100
visible: true
color: "#c9c6ac"
radius: 16
Text {
id: _text
text: qsTr("")
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 20
anchors.horizontalCenter: parent.horizontalCenter
font.family: "Tahoma"
}
}
}
import QtQuick import QtQuick
Window { Window {
id: window
visible: true visible: true
width: 400 color: "#ffffff"
height: 400 width: 600
height: 900
title: qsTr("2048") title: qsTr("2048")
Rectangle {
id: rectangle
y: 100
width: 400
height: 200
color: "#edcc5f"
radius: 30
anchors.horizontalCenter: parent.horizontalCenter
Text { Text {
text: qsTr("Hello 2048") id: _text
anchors.centerIn: parent x: 69
font.pointSize: 24 color: "#ffffff"
text: qsTr("2048")
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 80
font.weight: Font.Bold
font.family: "Tahoma"
anchors.horizontalCenter: parent.horizontalCenter
}
}
Rectangle {
id: rectangle1
x: 100
y: 350
width: 400
height: 500
color: "#3c3a33"
radius: 15
Rectangle {
id: rectangle2
y: 20
width: 360
height: 100
color: "#c9c6ac"
radius: 15
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: rectangle3
y: 140
width: 360
height: 100
color: "#c9c6ac"
radius: 15
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: rectangle4
y: 260
width: 360
height: 100
color: "#c9c6ac"
radius: 15
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: rectangle5
x: 20
y: 380
width: 360
height: 100
color: "#c9c6ac"
radius: 15
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
}
} }
} }
...@@ -4,6 +4,7 @@ Item { ...@@ -4,6 +4,7 @@ Item {
id: _item id: _item
width: 600 width: 600
height: 900 height: 900
property alias _text3Text: current_score.text
Rectangle { Rectangle {
id: background id: background
...@@ -11,175 +12,126 @@ Item { ...@@ -11,175 +12,126 @@ Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
id: grille id: grid
y: 300 y: 300
width: 500 width: 500
height: 500 height: 500
color: "#a49381" color: "#a49381"
radius: 15
anchors.horizontalCenterOffset: 0 anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Rectangle { Case {
id: rectangle1 id: case1
x: 20 x: 20
y: 20 y: 20
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle2 id: case2
x: 140 x: 140
y: 20 y: 20
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
} }
Rectangle { Case {
id: rectangle3 id: case3
x: 260 x: 260
y: 20 y: 20
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle4 id: case4
x: 380 x: 380
y: 20 y: 20
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle5 id: case5
x: 20 x: 20
y: 140 y: 140
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle6 id: case6
x: 140 x: 140
y: 140 y: 140
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
} }
Rectangle { Case {
id: rectangle7 id: case7
x: 260 x: 260
y: 140 y: 140
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle8 id: case8
x: 380 x: 380
y: 140 y: 140
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle9 id: case9
x: 20 x: 20
y: 260 y: 260
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle10 id: case10
x: 140 x: 140
y: 260 y: 260
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
} }
Rectangle { Case {
id: rectangle11 id: case11
x: 260 x: 260
y: 260 y: 260
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle12 id: case12
x: 380 x: 380
y: 260 y: 260
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle13 id: case13
x: 20 x: 20
y: 380 y: 380
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle14 id: case14
x: 140 x: 140
y: 380 y: 380
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
} }
Rectangle { Case {
id: rectangle15 id: case15
x: 260 x: 260
y: 380 y: 380
width: 100
height: 100
color: "#c9c6ac"
} }
Rectangle { Case {
id: rectangle16 id: case16
x: 380 x: 380
y: 380 y: 375
width: 100
height: 100
color: "#c9c6ac"
} }
} }
Rectangle { Rectangle {
id: rectangle id: icon_rectangle
x: 50 x: 50
y: 50 y: 50
width: 200 width: 200
height: 150 height: 150
color: "#edcc5f" color: "#edcc5f"
radius: 15
Text { Text {
id: _text id: icon_text
width: 200 width: 200
height: 150 height: 150
color: "#ffffff"
text: qsTr("2048") text: qsTr("2048")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 50 font.pixelSize: 50
...@@ -192,34 +144,126 @@ Item { ...@@ -192,34 +144,126 @@ Item {
} }
Rectangle { Rectangle {
id: rectangle17 id: score_rectangle
x: 270 x: 270
y: 50 y: 50
width: 130 width: 130
height: 65 height: 65
color: "#3c3a33" color: "#3c3a33"
radius: 15
Text {
id: score_text
y: 2
color: "#c1c1c1"
text: qsTr("Score")
font.pixelSize: 20
font.weight: Font.Bold
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
id: current_score
y: 28
color: "#ffffff"
text: qsTr("0")
font.pixelSize: 25
font.weight: Font.ExtraBold
font.family: "Tahoma"
anchors.horizontalCenter: parent.horizontalCenter
}
} }
Rectangle { Rectangle {
id: rectangle18 id: best_rectangle
x: 420 x: 420
y: 50 y: 50
width: 130 width: 130
height: 65 height: 65
color: "#3c3a33" color: "#3c3a33"
radius: 15
Text {
id: best_text
y: 2
color: "#c1c1c1"
text: qsTr("Best")
font.pixelSize: 20
font.weight: Font.Bold
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
id: best_score
y: 28
color: "#ffffff"
text: qsTr("0")
font.pixelSize: 25
font.weight: Font.ExtraBold
font.family: "Tahoma"
anchors.horizontalCenter: parent.horizontalCenter
}
} }
Rectangle { Rectangle {
id: rectangle19 id: new_rectangle
x: 270 x: 270
y: 135 y: 135
width: 130 width: 130
height: 65 height: 65
color: "#f65e3d" color: "#f65e3d"
radius: 15
Text {
id: new_text
color: "#ffffff"
text: qsTr("NEW")
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 30
font.family: "Tahoma"
font.weight: Font.ExtraBold
anchors.horizontalCenter: parent.horizontalCenter
}
MouseArea {
id: new_mouse_area
x: 0
y: 0
width: 130
height: 65
}
}
Rectangle {
id: undo_rectangle
x: 420
y: 135
width: 130
height: 65
color: "#f65e3d"
radius: 15
Text {
id: undo_text
color: "#ffffff"
text: qsTr("UNDO")
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 30
font.weight: Font.ExtraBold
font.family: "Tahoma"
anchors.horizontalCenter: parent.horizontalCenter
}
MouseArea {
id: undo_mouse_area
x: 0
y: 0
width: 130
height: 65
}
} }
Text { Text {
id: _text1 id: join_the_numbers_text
x: 50 x: 50
y: 225 y: 225
width: 500 width: 500
...@@ -230,15 +274,8 @@ Item { ...@@ -230,15 +274,8 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.bold: true font.bold: true
} }
}
Rectangle {
id: rectangle20
x: 420
y: 135
width: 130
height: 65
color: "#f65e3d"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment