summaryrefslogtreecommitdiffstats
path: root/examples/sensors/maze/doc/src/maze.qdoc
blob: a6f132f93abd9c5cbf3614a16116b7682a37a1f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \example maze
    \title Qt Sensors - Maze QML Example
    \ingroup qtsensors-examples
    \image maze.png

    \section2 Maze in QML
    \brief The Maze example demonstrates the TiltSensor QML type.


    To write a QML application that will use the TiltSensor QML sensors type
    you need to do the following steps:

    To import the Qt Sensors QML types into your application, use the following
    import statement in your .qml file:

    \snippet maze/maze.qml 0

    Then, add the Sensor QML types into your qml file.

    In this example we use the TiltSensor:

    \snippet maze/maze.qml 1

    The mouse should move by a factor of the tilt value:

    \snippet maze/maze.qml 2

    The walk direction of the mouse takes into account some collision detection:

    \snippet maze/maze.qml 3

    The rotation of the mouse image is determined according to the angle that the mouse is moving.

    \snippet maze/Mouse.qml 0

*/