This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adam Sosnowski
committed
Sep 29, 2014
1 parent
6206f07
commit 834d08f
Showing
204 changed files
with
10,327 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* Copyright (c) 2012, 2013 BlackBerry Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import bb.cascades 1.3 | ||
import bb.multimedia 1.0 | ||
import QtMobility.sensors 1.2 | ||
|
||
Container { | ||
//! [0] | ||
attachedObjects: [ | ||
RotationSensor { | ||
id: rotation | ||
|
||
// Create variables to hold rotation reading values | ||
property real x: 0 | ||
property real y: 0 | ||
property real z: 0 | ||
|
||
// Turn on the sensor | ||
active: true | ||
|
||
// Keep the sensor active when the app isn't visible or the screen is off (requires app permission in bar-descriptor) | ||
alwaysOn: true | ||
|
||
// If the device isn't moving (x&y&z==0), don't send updates, saves power | ||
skipDuplicates: true | ||
|
||
onReadingChanged: { // Called when a new rotation reading is available | ||
x = reading.x | ||
y = reading.y | ||
z = reading.z | ||
} | ||
} | ||
] | ||
//! [0] | ||
|
||
layout: DockLayout {} | ||
|
||
ImageView { | ||
horizontalAlignment: HorizontalAlignment.Center | ||
verticalAlignment: VerticalAlignment.Center | ||
|
||
imageSource: "images/device.png" | ||
} | ||
|
||
Container { | ||
layout: AbsoluteLayout {} | ||
|
||
//! [1] | ||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(70) | ||
positionY: ui.du(65) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.x.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
//! [1] | ||
|
||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(57) | ||
positionY: ui.du(35) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.y.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
|
||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(72) | ||
positionY: ui.du(47) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.z.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* Copyright (c) 2012, 2013 BlackBerry Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import bb.cascades 1.3 | ||
import bb.multimedia 1.0 | ||
import QtMobility.sensors 1.2 | ||
|
||
Container { | ||
//! [0] | ||
attachedObjects: [ | ||
RotationSensor { | ||
id: rotation | ||
|
||
// Create variables to hold rotation reading values | ||
property real x: 0 | ||
property real y: 0 | ||
property real z: 0 | ||
|
||
// Turn on the sensor | ||
active: true | ||
|
||
// Keep the sensor active when the app isn't visible or the screen is off (requires app permission in bar-descriptor) | ||
alwaysOn: true | ||
|
||
// If the device isn't moving (x&y&z==0), don't send updates, saves power | ||
skipDuplicates: true | ||
|
||
onReadingChanged: { // Called when a new rotation reading is available | ||
x = reading.x | ||
y = reading.y | ||
z = reading.z | ||
} | ||
} | ||
] | ||
//! [0] | ||
|
||
layout: DockLayout {} | ||
|
||
ImageView { | ||
horizontalAlignment: HorizontalAlignment.Center | ||
verticalAlignment: VerticalAlignment.Center | ||
|
||
imageSource: "images/device.png" | ||
} | ||
|
||
Container { | ||
layout: AbsoluteLayout {} | ||
|
||
//! [1] | ||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(60) | ||
positionY: ui.du(53) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.x.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
//! [1] | ||
|
||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(62) | ||
positionY: ui.du(30) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.y.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
|
||
Label { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: ui.du(45) | ||
positionY: ui.du(17) | ||
} | ||
|
||
text: qsTr("%1\u00B0").arg(rotation.z.toPrecision(4)) | ||
textStyle { | ||
base: SystemDefaults.TextStyles.BodyText | ||
color: Color.White | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2011, 2012, 2013 BlackBerry Limited. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import bb.cascades 1.3 | ||
|
||
Container { | ||
// The size is defined by the background image | ||
preferredWidth: ui.du(46) | ||
preferredHeight: ui.du(46) | ||
|
||
layout: AbsoluteLayout {} | ||
|
||
// The background image of the maze | ||
ImageView { | ||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: 0 | ||
positionY: 0 | ||
} | ||
imageSource: "asset:///images/maze_background.png" | ||
} | ||
|
||
//! [0] | ||
// The board where the player object can be moved | ||
Container { | ||
objectName: "board" | ||
|
||
layoutProperties: AbsoluteLayoutProperties { | ||
positionX: 50 | ||
positionY: 50 | ||
} | ||
|
||
layout: AbsoluteLayout {} | ||
|
||
preferredWidth: ui.du(50) | ||
preferredHeight: ui.du(50) | ||
} | ||
//! [0] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.