diff --git a/logic/board.cpp b/logic/board.cpp index 2112c68..4ed18a4 100644 --- a/logic/board.cpp +++ b/logic/board.cpp @@ -37,8 +37,7 @@ namespace Tanks { // That's where we want to split out blocks even more. // For example when just half a brick is breakable by bullet // or tank moves just half a brick at a time -#define MAP_SCALE_FACTOR 2 - +#define MAP_SCALE_FACTOR 2 Board::Board(QObject *parent) : QObject(parent) { } bool Board::loadMap(AbstractMapLoader *loader) @@ -46,12 +45,12 @@ bool Board::loadMap(AbstractMapLoader *loader) if (!loader->open()) { return false; } - //_dynBlocks.clear(); +// _dynBlocks.clear(); _size = loader->dimensions() * MAP_SCALE_FACTOR; - _size = _size.boundedTo(QSize(1024, 1024)); - QRect boardRect(QPoint(0, 0), _size); - _map.resize(_size.width() * _size.height()); - _map.fill(0); + _size = _size.boundedTo(QSize( 2160,4440)); + QRect boardRect(QPoint(10,10), _size); + _map.resize(4096*2160); + while (loader->hasNext()) { MapObject block = loader->next(); diff --git a/logic/main.cpp b/logic/main.cpp index 12c454d..7c70f3e 100644 --- a/logic/main.cpp +++ b/logic/main.cpp @@ -28,12 +28,22 @@ #include "qmlmain.h" #include - +#include int main(int argc, char *argv[]) { + QGuiApplication app(argc, argv); + QQuickView viewer; + +viewer.setSource(QUrl("qrc/:MainForm.qml")); + + viewer.showFullScreen(); + + Tanks::QMLMain q; - return app.exec(); + + + return app.exec(); } diff --git a/render/MainForm.qml b/render/MainForm.qml index 2c7a7e3..eb18312 100644 --- a/render/MainForm.qml +++ b/render/MainForm.qml @@ -30,18 +30,32 @@ import QtMultimedia import com.rsoft.tanks 1.0 Row { - anchors.fill: parent + + + anchors { + centerIn: parent + topMargin: 10 + rightMargin: -100 + bottomMargin: 100 + leftMargin: 25 + } + + Rectangle { id: battleField - //anchors.left: otherItem.left + +// anchors.left: otherItem.left property alias mouseArea: lowerLayer - width: 200 - height: 200 - color: "red" + + width: parent.width/10.0 + height: parent.height + + color: '#444444' + diff --git a/render/StartButton.ui.qml b/render/StartButton.ui.qml index d22d139..b8c46c3 100644 --- a/render/StartButton.ui.qml +++ b/render/StartButton.ui.qml @@ -1,6 +1,7 @@ import QtQuick 2.0 Item { + id: button width: 92 height: 27 @@ -13,7 +14,7 @@ Item { id: rectangle1 x: 0 y: 9 - width: 90 + width: parent.width height: 25 radius: 13 anchors.horizontalCenter: parent.horizontalCenter diff --git a/render/main.qml b/render/main.qml index 671b310..a1f9f9f 100644 --- a/render/main.qml +++ b/render/main.qml @@ -27,15 +27,23 @@ import QtQuick 2.6 import QtQuick.Window 2.2 +import QtQuick.Controls 2.15 Window { + id : root visible: true - width: 900 - height: 800 + +visibility: "FullScreen" + + width : Screen.width + height : Screen.height + title: qsTr("Battle City: The War") - MainForm { - anchors.fill: parent - } + + MainForm { + + anchors.centerIn: parent + } }