Durdles - 2-Player Action Game
import QtQuick 2.0
import Felgo 4.0
import "../levels"
import ".."
Item {
id: energyBar
width: 80
height: 16
opacity: GameInfo.opacity
property alias energyBarOuterBody: energyBarOuterBody
property alias energyBarInnerBody: energyBarInnerBody
property int energy
property color barColor
property int gap: GameInfo.border
Rectangle {
border.width: gap
border.color: barColor
id: energyBarOuterBody
anchors.fill: parent
color: Qt.lighter(barColor, GameInfo.lighterColor)
radius: GameInfo.radius
Rectangle {
radius: parent.radius - 3
id: energyBarInnerBody
width: (parent.width / 100 * energy) - (gap * 3)
height: parent.height - (gap * 3)
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: gap * 1.5
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.lighter(barColor, 1.2) }
GradientStop { position: 1.0; color: barColor }
}