Consolodated config, added portals, etc.
This commit is contained in:
@@ -114,21 +114,24 @@ func (b Bar) Draw(screen *ebiten.Image, x, y int) (int, int) {
|
||||
fillWidth = maxWidth
|
||||
}
|
||||
|
||||
if b.ShowBorder {
|
||||
borderColor := b.BorderColor
|
||||
if borderColor == nil {
|
||||
borderColor = color.RGBA{R: 80, G: 80, B: 80, A: 255}
|
||||
}
|
||||
drawRect(screen, x, y, maxWidth, 1, borderColor)
|
||||
drawRect(screen, x, y+height-1, maxWidth, 1, borderColor)
|
||||
drawRect(screen, x, y, 1, height, borderColor)
|
||||
drawRect(screen, x+maxWidth-1, y, 1, height, borderColor)
|
||||
}
|
||||
// Draw dark background
|
||||
drawRect(screen, x, y, maxWidth, height, color.RGBA{R: 30, G: 30, B: 30, A: 255})
|
||||
|
||||
// Draw filled portion
|
||||
if fillWidth > 0 {
|
||||
drawRect(screen, x, y, fillWidth, height, b.Meter.Color)
|
||||
}
|
||||
|
||||
// Draw border
|
||||
borderColor := b.BorderColor
|
||||
if borderColor == nil {
|
||||
borderColor = color.RGBA{R: 180, G: 180, B: 180, A: 255}
|
||||
}
|
||||
drawRect(screen, x, y, maxWidth, 1, borderColor)
|
||||
drawRect(screen, x, y+height-1, maxWidth, 1, borderColor)
|
||||
drawRect(screen, x, y, 1, height, borderColor)
|
||||
drawRect(screen, x+maxWidth-1, y, 1, height, borderColor)
|
||||
|
||||
return maxWidth, height
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user