4
1
mirror of https://github.com/QuasarApp/Snake.git synced 2025-05-06 22:49:44 +00:00
Snake/front-end/GraphicItem.qml
2018-11-16 20:01:47 +03:00

29 lines
641 B
QML

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;
color: (model) ? model.color : "#11ff32";
width: rec.width * mainWindow.point;
height: rec.height * mainWindow.point;
x: rec.x * mainWindow.point;
y: rec.y * mainWindow.point;
transform: Rotation {
origin.x: rec.x / 2;
origin.y: rec.y / 2;
angle: graphicItem.angle;
}
}