Add in example of working audio.
This commit is contained in:
parent
a1e0c9ebb1
commit
2bb6ae818e
13
Menu.qml
13
Menu.qml
|
@ -1,8 +1,8 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtMultimedia 5.8
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "blue"
|
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
source: 'images/backdrop.jpg'
|
source: 'images/backdrop.jpg'
|
||||||
|
@ -49,6 +49,17 @@ Rectangle {
|
||||||
MenuButton {
|
MenuButton {
|
||||||
buttonText: "Save Game"
|
buttonText: "Save Game"
|
||||||
// disabled: true
|
// disabled: true
|
||||||
|
function actionOnClick() {
|
||||||
|
pingSound.seek(0)
|
||||||
|
pingSound.play()
|
||||||
|
}
|
||||||
|
|
||||||
|
// From: https://freesound.org/people/edsward/sounds/341871/
|
||||||
|
Audio {
|
||||||
|
id: pingSound
|
||||||
|
source: 'assets/ping.wav'
|
||||||
|
autoLoad: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuButton {
|
MenuButton {
|
||||||
|
|
|
@ -14,7 +14,7 @@ Rectangle {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
width: parent.width - 50
|
width: parent.width - 50
|
||||||
height: 50
|
height: parent.parent.height * 0.1
|
||||||
radius: 10
|
radius: 10
|
||||||
|
|
||||||
color: backgroundAtRest
|
color: backgroundAtRest
|
||||||
|
@ -34,7 +34,7 @@ Rectangle {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: buttonText
|
text: buttonText
|
||||||
font.pointSize: 18
|
font.pointSize: parent.height * 0.2
|
||||||
font.bold: true
|
font.bold: true
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
QT += quick
|
QT += quick multimedia multimediawidgets
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
|
4
main.qml
4
main.qml
|
@ -7,8 +7,8 @@ Window {
|
||||||
property var appVersion: "0.4.0"
|
property var appVersion: "0.4.0"
|
||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
width: 800
|
width: 540
|
||||||
height: 600
|
height: 960
|
||||||
title: qsTr("justCheckers v" + appVersion)
|
title: qsTr("justCheckers v" + appVersion)
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
Loading…
Reference in New Issue