Snake/front-end/GraphicItem.qml

29 lines
641 B
QML
Raw Normal View History

2018-11-14 23:15:36 +03:00
import QtQuick 2.9
Rectangle {
id: graphicItem
property var model: null
property real angle: (model) ? model.angle : 0;
property string texture: (model) ? model.texture : "";
property rect rec: (model) ? model.rect : Qt.rect(0, 0, 0, 0);
property int guiId: (model) ? model.color : -1;
2018-11-16 20:01:47 +03:00
2018-11-14 23:15:36 +03:00
color: (model) ? model.color : "#11ff32";
2018-11-16 20:01:47 +03:00
2018-11-14 23:15:36 +03:00
width: rec.width * mainWindow.point;
height: rec.height * mainWindow.point;
2018-11-16 20:01:47 +03:00
2018-11-14 23:15:36 +03:00
x: rec.x * mainWindow.point;
y: rec.y * mainWindow.point;
transform: Rotation {
2018-11-16 02:21:27 +03:00
origin.x: rec.x / 2;
origin.y: rec.y / 2;
2018-11-14 23:15:36 +03:00
angle: graphicItem.angle;
}
2018-11-16 02:21:27 +03:00
2018-11-14 23:15:36 +03:00
}