import QtQuick 2.6
Text {
id: rpmText
// 转速刻度值的坐标
property int numTextX
property int numTextY
// 转速刻度值: 0 ~ 9
property string numText
// 转速刻度值颜色
property string numTextColor
// 指针当前所在角度
property var pointerAngle
// 刻度值所在角度
property var numTextPosiAngle
// 判断指针所在角度是否大于刻度值上限角度
property bool beyondLimitMax: pointerAngle > (numTextPosiAngle + 15)
// 判断指针所在角度是否处于刻度值上限角度与下限角度之间
property bool betweenLimit: (pointerAngle > (numTextPosiAngle - 15) && pointerAngle <= (numTextPosiAngle + 15))
x: numTextX
y: numTextY
scale: betweenLimit ? (10/7 - (Math.abs(pointerAngle - numTextPosiAngle) / 43.5)) : 1.0
opacity: beyondLimitMax ? 1.0 : (betweenLimit ? (1.0 - (Math.abs(pointerAngle - numTextPosiAngle) * 0.8 / 240.0))*0.8 : 0.6)
text: numText
color: numTextColor
font.pixelSize: 23
font.family: UiController.font["handel-gothic"]
}