qmlfrontend/Page1.qml
author Wuzzy <Wuzzy2@mail.ru>
Mon, 29 Apr 2019 23:13:52 +0200
changeset 14858 b96ba3c1ab67
parent 14377 b6824a53d4b1
child 14859 aed75d439027
permissions -rw-r--r--
Don't save "!MULTI" pseudo-key into team files

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()
  }
}