Changeset View
Changeset View
Standalone View
Standalone View
src/activities/maze-3D/Maze3D.qml
- This file was added.
1 | /* GCompris - maze-3D.qml | ||||
---|---|---|---|---|---|
2 | * | ||||
3 | * Copyright (C) 2017 YOUR NAME <xx@yy.org> | ||||
4 | * | ||||
5 | * Authors: | ||||
6 | * <THE GTK VERSION AUTHOR> (GTK+ version) | ||||
7 | * YOUR NAME <YOUR EMAIL> (Qt Quick port) | ||||
8 | * | ||||
9 | * This program is free software; you can redistribute it and/or modify | ||||
10 | * it under the terms of the GNU General Public License as published by | ||||
11 | * the Free Software Foundation; either version 3 of the License, or | ||||
12 | * (at your option) any later version. | ||||
13 | * | ||||
14 | * This program is distributed in the hope that it will be useful, | ||||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
17 | * GNU General Public License for more details. | ||||
18 | * | ||||
19 | * You should have received a copy of the GNU General Public License | ||||
20 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||||
21 | */ | ||||
22 | import QtQuick 2.6 | ||||
23 | | ||||
24 | import "../../core" | ||||
25 | import "maze-3D.js" as Activity | ||||
26 | | ||||
27 | ActivityBase { | ||||
28 | id: activity | ||||
29 | | ||||
30 | onStart: focus = true | ||||
31 | onStop: {} | ||||
32 | | ||||
33 | pageComponent: Rectangle { | ||||
34 | id: background | ||||
35 | anchors.fill: parent | ||||
36 | color: "#ABCDEF" | ||||
37 | signal start | ||||
38 | signal stop | ||||
39 | | ||||
40 | Component.onCompleted: { | ||||
41 | activity.start.connect(start) | ||||
42 | activity.stop.connect(stop) | ||||
43 | } | ||||
44 | | ||||
45 | // Add here the QML items you need to access in javascript | ||||
46 | QtObject { | ||||
47 | id: items | ||||
48 | property Item main: activity.main | ||||
49 | property alias background: background | ||||
50 | property alias bar: bar | ||||
51 | property alias bonus: bonus | ||||
52 | } | ||||
53 | | ||||
54 | onStart: { Activity.start(items) } | ||||
55 | onStop: { Activity.stop() } | ||||
56 | | ||||
57 | GCText { | ||||
58 | anchors.centerIn: parent | ||||
59 | text: "maze-3D activity" | ||||
60 | fontSize: largeSize | ||||
61 | } | ||||
62 | | ||||
63 | DialogHelp { | ||||
64 | id: dialogHelp | ||||
65 | onClose: home() | ||||
66 | } | ||||
67 | | ||||
68 | Bar { | ||||
69 | id: bar | ||||
70 | content: BarEnumContent { value: help | home | level } | ||||
71 | onHelpClicked: { | ||||
72 | displayDialog(dialogHelp) | ||||
73 | } | ||||
74 | onPreviousLevelClicked: Activity.previousLevel() | ||||
75 | onNextLevelClicked: Activity.nextLevel() | ||||
76 | onHomeClicked: activity.home() | ||||
77 | } | ||||
78 | | ||||
79 | Bonus { | ||||
80 | id: bonus | ||||
81 | Component.onCompleted: win.connect(Activity.nextLevel) | ||||
82 | } | ||||
83 | } | ||||
84 | | ||||
85 | } |