author | unC0Rr |
Fri, 07 Dec 2018 13:35:08 +0100 | |
changeset 14376 | 90bd2c331703 |
parent 14303 | 00b56ec8b7df |
child 14377 | b6824a53d4b1 |
permissions | -rw-r--r-- |
12859 | 1 |
import QtQuick 2.7 |
14148 | 2 |
import Hedgewars.Engine 1.0 |
12859 | 3 |
|
4 |
Page1Form { |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
5 |
property var hwEngine |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
6 |
|
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
7 |
Component { |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
8 |
id: hwEngineComponent |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
9 |
|
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
10 |
HWEngine { |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
11 |
previewAcceptor: PreviewAcceptor |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
12 |
onPreviewImageChanged: previewImage.source = "image://preview/image" |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
13 |
onPreviewIsRendering: previewImage.source = "qrc:/res/iconTime.png" |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
14 |
} |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
15 |
} |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
16 |
|
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
17 |
Component.onCompleted: { |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
18 |
hwEngine = hwEngineComponent.createObject() |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
19 |
} |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
20 |
|
14148 | 21 |
tickButton.onClicked: { |
14299
21be7838a127
Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents:
14159
diff
changeset
|
22 |
gameView.tick(100) |
14148 | 23 |
} |
24 |
gameButton.onClicked: { |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
25 |
var engineInstance = hwEngine.runQuickGame() |
14303 | 26 |
gameView.engineInstance = engineInstance |
14148 | 27 |
} |
12859 | 28 |
button1.onClicked: { |
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
29 |
hwEngine.getPreview() |
12859 | 30 |
} |
31 |
} |