Add in example of working audio.

This commit is contained in:
Dorian 2018-02-22 08:03:26 -05:00
parent a1e0c9ebb1
commit 2bb6ae818e
6 changed files with 18 additions and 6 deletions

View File

@ -1,8 +1,8 @@
import QtQuick 2.0
import QtMultimedia 5.8
Rectangle {
anchors.fill: parent
color: "blue"
Image {
source: 'images/backdrop.jpg'
@ -49,6 +49,17 @@ Rectangle {
MenuButton {
buttonText: "Save Game"
// 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 {

View File

@ -14,7 +14,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 50
height: 50
height: parent.parent.height * 0.1
radius: 10
color: backgroundAtRest
@ -34,7 +34,7 @@ Rectangle {
Text {
text: buttonText
font.pointSize: 18
font.pointSize: parent.height * 0.2
font.bold: true
height: 30

BIN
assets/ping.wav Normal file

Binary file not shown.

View File

@ -1,4 +1,4 @@
QT += quick
QT += quick multimedia multimediawidgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use

View File

@ -7,8 +7,8 @@ Window {
property var appVersion: "0.4.0"
visible: true
width: 800
height: 600
width: 540
height: 960
title: qsTr("justCheckers v" + appVersion)
Loader {

View File

@ -15,5 +15,6 @@
<file>images/play.png</file>
<file>images/splash.jpg</file>
<file>MenuButton.qml</file>
<file>assets/ping.wav</file>
</qresource>
</RCC>