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 : "";
|
2018-12-01 21:06:40 +03:00
|
|
|
property int guiId: (model) ? model.guiId : -1;
|
2018-11-14 23:15:36 +03:00
|
|
|
|
2018-11-28 22:17:30 +03:00
|
|
|
z:-1
|
2018-11-25 03:24:41 +03:00
|
|
|
property double devX: width / 2
|
|
|
|
property double devY: height / 2
|
2018-11-16 20:01:47 +03:00
|
|
|
|
2018-11-28 22:17:30 +03:00
|
|
|
Image {
|
|
|
|
id: name
|
|
|
|
visible: texture.length
|
|
|
|
source: texture
|
|
|
|
|
|
|
|
anchors.fill: parent;
|
|
|
|
}
|
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
|
|
|
|
2019-07-31 17:47:26 +03:00
|
|
|
width: (model) ? model.w * metrix.gamePt: 0;
|
|
|
|
height: (model) ? model.h * metrix.gamePt: 0;
|
2018-11-16 20:01:47 +03:00
|
|
|
|
2019-07-31 17:47:26 +03:00
|
|
|
x: (model) ? model.x * metrix.gamePt - devX: 0;
|
|
|
|
y: (model) ? model.y * metrix.gamePt - devY: 0;
|
2018-11-14 23:15:36 +03:00
|
|
|
|
2019-07-31 17:47:26 +03:00
|
|
|
radius: (model) ? model.radius * metrix.gamePt : 0;
|
2018-12-01 21:06:40 +03:00
|
|
|
|
2018-11-14 23:15:36 +03:00
|
|
|
transform: Rotation {
|
2018-11-25 03:24:41 +03:00
|
|
|
origin.x: devX;
|
|
|
|
origin.y: devY;
|
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
|
|
|
}
|