qmlfrontend/Page1.qml
author alfadur <mail@none>
Tue, 05 Feb 2019 17:46:43 +0300
changeset 14704 932ff7683653
parent 14393 b6824a53d4b1
child 14875 aed75d439027
permissions -rw-r--r--
Server action refactoring part 8 of N

import QtQuick 2.7
import Hedgewars.Engine 1.0

Page1Form {
  property var hwEngine

  Component {
    id: hwEngineComponent

    HWEngine {
      engineLibrary: "./libhedgewars_engine.so"
      previewAcceptor: PreviewAcceptor
      onPreviewImageChanged: previewImage.source = "image://preview/image"
      onPreviewIsRendering: previewImage.source = "qrc:/res/iconTime.png"
    }
  }

  Component.onCompleted: {
    hwEngine = hwEngineComponent.createObject()
  }

  tickButton.onClicked: {
    gameView.tick(100)
  }
  gameButton.onClicked: {
    var engineInstance = hwEngine.runQuickGame()
    gameView.engineInstance = engineInstance
  }
  button1.onClicked: {
    hwEngine.getPreview()
  }
}