mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
more SANE way of drawing elements (actor zoom broken)
Former-commit-id: edca68d5d25c4e45be209da46449ad9e0b2c35cf Former-commit-id: 38858d235b553e41bea7d506b402fe0a92a1aab0
This commit is contained in:
@@ -120,22 +120,12 @@ constructor(val UI: UICanvas) {
|
||||
UIGraphicInstance.font = Terrarum.fontGame
|
||||
|
||||
UI.render(gc, UIGraphicInstance)
|
||||
if (sbg.currentStateID == Terrarum.STATE_ID_GAME) {
|
||||
ingameGraphics.drawImage(UIDrawnCanvas.getScaledCopy(scale),
|
||||
posX + MapCamera.cameraX * Terrarum.ingame.screenZoom - (UI.width / 2f * scale.minus(1)),
|
||||
posY + MapCamera.cameraY * Terrarum.ingame.screenZoom - (UI.height / 2f * scale.minus(1)),
|
||||
Color(1f, 1f, 1f, opacity)
|
||||
)// compensate for screenZoom AND camera translation
|
||||
// (see Game.render -> g.translate())
|
||||
}
|
||||
else {
|
||||
ingameGraphics.drawImage(UIDrawnCanvas.getScaledCopy(scale),
|
||||
posX.toFloat() - (UI.width / 2f * scale.minus(1)),
|
||||
posY.toFloat() - (UI.height / 2f * scale.minus(1)),
|
||||
Color(1f, 1f, 1f, opacity)
|
||||
)
|
||||
|
||||
}
|
||||
ingameGraphics.drawImage(UIDrawnCanvas.getScaledCopy(scale),
|
||||
posX.toFloat() - (UI.width / 2f * scale.minus(1)),
|
||||
posY.toFloat() - (UI.height / 2f * scale.minus(1)),
|
||||
Color(1f, 1f, 1f, opacity)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user