Small demo of what you can do with CSS-styled labels (example done on the gauges here, which are essentially 2 labels)
function create_hp_bar(x,y)
createGauge("hp_bar", 0, 0, 0, 0, nil, "red")
moveGauge("hp_bar", x,y)
resizeGauge("hp_bar", 100, 20)
setGaugeStyleSheet("hp_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
end
function create_end_bar(x,y)
createGauge("end_bar", 0, 0, 0, 0, nil, "green")
moveGauge("end_bar", x,y)
resizeGauge("end_bar", 100, 20)
setGaugeStyleSheet("end_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #98f041, stop: 0.1 #8cf029, stop: 0.49 #66cc00, stop: 0.5 #52a300, stop: 1 #66cc00);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #78bd33, stop: 0.1 #6ebd20, stop: 0.49 #4c9900, stop: 0.5 #387000, stop: 1 #4c9900);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
end
create_hp_bar(0,0)
create_end_bar(100,20)
and these calls to update them:
setGauge("hp_bar", myHealth, maxHealth)
setGauge("end_bar", myEndurance, maxEndurance)
Oh, and for the QLinearGradient magic, you either a) find the code to use on the internet, or b) tinker with the values yourself, or c) use the gradient maker in the Qt Designer program... I found a to be easiest so far.