mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Trying to make QML UI work
This commit is contained in:
parent
b98d106a3b
commit
9a03058e88
3 changed files with 47 additions and 27 deletions
|
@ -37,6 +37,7 @@ Rectangle {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
source: "images/defaultTopLeft.png"
|
source: "images/defaultTopLeft.png"
|
||||||
|
z: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
@ -46,6 +47,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
source: "images/defaultBottomRight.png"
|
source: "images/defaultBottomRight.png"
|
||||||
|
z: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -65,28 +67,36 @@ Rectangle {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: textAndQRContainer
|
id: textAndQRContainer
|
||||||
width: 650
|
Layout.preferredWidth: 600
|
||||||
|
Layout.preferredHeight: 650
|
||||||
|
Layout.minimumWidth: 200
|
||||||
|
Layout.maximumWidth: 800
|
||||||
Layout.topMargin: 80
|
Layout.topMargin: 80
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
HifiStylesUit.RalewayBold {
|
HifiStylesUit.RalewayBold {
|
||||||
id: headerText
|
id: headerText
|
||||||
text: "We know this isn't you..."
|
text: "We know this isn't you..."
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
size: 48
|
size: 48
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiStylesUit.RalewaySemiBold {
|
HifiStylesUit.RalewaySemiBold {
|
||||||
id: descriptionText
|
id: descriptionText
|
||||||
anchors.top: headerText.bottom
|
anchors.top: headerText.bottom
|
||||||
anchors.topMargin: 20
|
anchors.topMargin: 20
|
||||||
text: "But, we've given you this <b>temporary avatar</b> to use<br></br>
|
text: "but, we've given you this <b>temporary avatar</b> to use
|
||||||
for today. If you see this avatar in-world, walk up and<br></br>
|
for today. If you see this avatar in-world, walk up and
|
||||||
say hello to other new users!<br></br><br></br>
|
say hello to other new users!<br></br><br></br>
|
||||||
<b>We want you to be you</b> so we've built an Avatar Creator<br></br>
|
<b>We want you to be you</b> so we've built an Avatar Creator
|
||||||
App that's as easy as taking a selfie and picking your<br></br>
|
App that's as easy as taking a selfie and picking your
|
||||||
outfits! Available now on iOS and Android Platforms."
|
outfits! Available now on iOS and Android Platforms."
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
size: 24
|
size: 24
|
||||||
|
width: parent.width
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -105,24 +115,26 @@ Rectangle {
|
||||||
|
|
||||||
HifiStylesUit.RalewayBold {
|
HifiStylesUit.RalewayBold {
|
||||||
id: instructionText
|
id: instructionText
|
||||||
text: "Use your mobile phone to scan this QR code."
|
|
||||||
anchors.left: avatarAppQRCodeImage.right
|
anchors.left: avatarAppQRCodeImage.right
|
||||||
anchors.verticalCenter: avatarAppQRCodeImage.verticalCenter
|
anchors.verticalCenter: avatarAppQRCodeImage.verticalCenter
|
||||||
anchors.leftMargin: 50
|
anchors.leftMargin: 50
|
||||||
|
text: "Use your mobile phone to scan this QR code."
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
size: 24
|
size: 24
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiStylesUit.RalewayBold {
|
HifiStylesUit.RalewayBold {
|
||||||
text: "Continue"
|
anchors.top: qrAndInstructionsContainer.bottom
|
||||||
anchors.top: qrAndInstructionsContainer.bottom
|
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
anchors.horizontalCenter: qrAndInstructionsContainer.horizontalCenter
|
anchors.horizontalCenter: qrAndInstructionsContainer.horizontalCenter
|
||||||
|
text: "Continue"
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
opacity: continueMouseArea.containsMouse ? 1.0 : 0.7
|
opacity: continueMouseArea.containsMouse ? 1.0 : 0.7
|
||||||
size: 36
|
size: 36
|
||||||
z: 1
|
z: 1
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: continueMouseArea
|
id: continueMouseArea
|
||||||
|
@ -131,7 +143,6 @@ Rectangle {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
Tablet.playSound(TabletEnums.ButtonClick);
|
||||||
print("CONTINUE CLICKED");
|
|
||||||
tempAvatarPageContainer.visible = false;
|
tempAvatarPageContainer.visible = false;
|
||||||
controlsContainer.visible = true;
|
controlsContainer.visible = true;
|
||||||
}
|
}
|
||||||
|
@ -142,9 +153,9 @@ Rectangle {
|
||||||
Item {
|
Item {
|
||||||
id: tempAvatarImageContainer
|
id: tempAvatarImageContainer
|
||||||
Layout.leftMargin: 50
|
Layout.leftMargin: 50
|
||||||
// these don't change when the window resizes
|
// TODO these don't change when the window resizes...still true?
|
||||||
width: tempAvatarImage.width
|
Layout.preferredWidth: tempAvatarImage.width
|
||||||
height: tempAvatarImage.height
|
Layout.preferredHeight: tempAvatarImage.height
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: tempAvatarImage
|
id: tempAvatarImage
|
||||||
|
@ -164,8 +175,8 @@ Rectangle {
|
||||||
|
|
||||||
HifiStylesUit.RalewaySemiBold {
|
HifiStylesUit.RalewaySemiBold {
|
||||||
id: controlsDescriptionText
|
id: controlsDescriptionText
|
||||||
text: "These are your avatar controls to<br></br>
|
text: "These are your avatar controls to
|
||||||
<b>Interact with and move around in your new HQ.</b>"
|
<b>interact with and move around in your new HQ.</b>"
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 100
|
anchors.topMargin: 100
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
@ -173,6 +184,7 @@ Rectangle {
|
||||||
height: 100
|
height: 100
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
size: 36
|
size: 36
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
@ -186,37 +198,46 @@ Rectangle {
|
||||||
flow: root.width > root.height ? GridLayout.LeftToRight : GridLayout.TopToBottom
|
flow: root.width > root.height ? GridLayout.LeftToRight : GridLayout.TopToBottom
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
Layout.preferredWidth: 650
|
||||||
|
Layout.preferredHeight: 400
|
||||||
id: walkingControls
|
id: walkingControls
|
||||||
source: "images/walkingControls.png"
|
source: "images/walkingControls.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
Layout.preferredWidth: 400
|
||||||
|
Layout.preferredHeight: 300
|
||||||
id: mouseControls
|
id: mouseControls
|
||||||
source: "images/mouseControls.png"
|
source: "images/mouseControls.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
Layout.preferredWidth: 400
|
||||||
|
Layout.preferredHeight: 300
|
||||||
id: runJumpControls
|
id: runJumpControls
|
||||||
source: "images/runJumpControls.png"
|
source: "images/runJumpControls.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
Layout.preferredWidth: 400
|
||||||
|
Layout.preferredHeight: 300
|
||||||
id: cameraControls
|
id: cameraControls
|
||||||
source: "images/cameraControls.png"
|
source: "images/cameraControls.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiStylesUit.RalewayBold {
|
HifiStylesUit.RalewayBold {
|
||||||
text: "Learn more about our controls."
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 50
|
anchors.leftMargin: 50
|
||||||
anchors.bottomMargin: 50
|
anchors.bottomMargin: 50
|
||||||
|
text: "Learn more about our controls."
|
||||||
width: 100
|
width: 100
|
||||||
height: 25
|
height: 25
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
opacity: learnMoreAboutControlsMouseArea.containsMouse ? 1.0 : 0.7
|
opacity: learnMoreAboutControlsMouseArea.containsMouse ? 1.0 : 0.7
|
||||||
size: 14
|
size: 14
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: learnMoreAboutControlsMouseArea
|
id: learnMoreAboutControlsMouseArea
|
||||||
|
@ -232,15 +253,16 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiStylesUit.RalewayBold {
|
HifiStylesUit.RalewayBold {
|
||||||
text: "I've got a good grip on the controls."
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.bottomMargin: 50
|
anchors.bottomMargin: 50
|
||||||
|
text: "I've got a good grip on the controls."
|
||||||
width: 350
|
width: 350
|
||||||
height: 60
|
height: 60
|
||||||
color: "#000000"
|
color: "#000000"
|
||||||
opacity: goodGripMouseArea.containsMouse ? 1.0 : 0.7
|
opacity: goodGripMouseArea.containsMouse ? 1.0 : 0.7
|
||||||
size: 36
|
size: 36
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: goodGripMouseArea
|
id: goodGripMouseArea
|
||||||
|
|
|
@ -121,7 +121,7 @@ Rectangle {
|
||||||
print("NO THANKS CLICKED");
|
print("NO THANKS CLICKED");
|
||||||
sendToScript({
|
sendToScript({
|
||||||
"source": "SecondLaunchWindow.qml",
|
"source": "SecondLaunchWindow.qml",
|
||||||
"method": "closeInitialLaunchWindow"
|
"method": "closeSecondLaunchWindow"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,21 +442,19 @@ function displaySecondLaunchWindow() {
|
||||||
|
|
||||||
function closeInitialLaunchWindow() {
|
function closeInitialLaunchWindow() {
|
||||||
initialLaunchWindow.fromQml.disconnect(onMessageFromInitialLaunchWindow);
|
initialLaunchWindow.fromQml.disconnect(onMessageFromInitialLaunchWindow);
|
||||||
// TODO Add this bookmark? Then uncomment this code
|
var homeLocation = LocationBookmarks.getAddress("hqhome");
|
||||||
//var homeLocation = LocationBookmarks.getAddress("hqhome");
|
if (homeLocation) {
|
||||||
//if (homeLocation) {
|
Window.location = homeLocation;
|
||||||
// Window.location = "hqhome";
|
}
|
||||||
//}
|
|
||||||
initialLaunchWindow.close();
|
initialLaunchWindow.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeSecondLaunchWindow() {
|
function closeSecondLaunchWindow() {
|
||||||
secondLaunchWindow.fromQml.disconnect(onMessageFromSecondLaunchWindow);
|
secondLaunchWindow.fromQml.disconnect(onMessageFromSecondLaunchWindow);
|
||||||
// TODO Add this bookmark? Then uncomment this code
|
var homeLocation = LocationBookmarks.getAddress("hqhome");
|
||||||
//var homeLocation = LocationBookmarks.getAddress("hqhome");
|
if (homeLocation) {
|
||||||
//if (homeLocation) {
|
Window.location = homeLocation;
|
||||||
// Window.location = "hqhome";
|
}
|
||||||
//}
|
|
||||||
secondLaunchWindow.close();
|
secondLaunchWindow.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue