mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
debugwin: drawing ingame weatherboxes
This commit is contained in:
@@ -26,7 +26,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormal(batch)
|
||||
|
||||
val textWidth = messagesList.map { AppLoader.fontGame.getWidth(it) }.sorted()[1]
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
@@ -49,7 +50,7 @@ class Notification : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
fontCol.a = handler.opacity * OPACITY
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
|
||||
@@ -15,7 +16,7 @@ object NullUI : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
@@ -86,7 +87,7 @@ class UIBasicInfo() : UICanvas() {
|
||||
|
||||
private val lcdLitCol: Color = lcdLitColELoff
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = drawCol
|
||||
batch.draw(atlas.get(0, 0), 0f, 0f)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.BlockCodex
|
||||
import net.torvald.terrarum.ItemCodex
|
||||
@@ -126,7 +127,7 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
||||
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
palette.forEach { it.render(batch, camera) }
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
@@ -146,7 +147,7 @@ class UIBuildingMakerPenMenu(val parent: BuildingMaker): UICanvas() {
|
||||
parent.tappedOnUI = true
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw back
|
||||
batch.color = backCol
|
||||
Toolkit.fillCircle(batch,0, 0, SIZE, SIZE)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.Second
|
||||
@@ -37,7 +38,7 @@ class UIBuildingMakerToolbox : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
tools.forEach { it.render(batch, camera) }
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class UICheatDetected : UICanvas() {
|
||||
|
||||
private val backgroundCol = Color(0x00000080)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
Terrarum.ingame?.consoleHandler?.setAsClose()
|
||||
Terrarum.ingame?.consoleHandler?.isVisible = false
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.App.gamepadLabelLEFTRIGHT
|
||||
@@ -450,7 +451,7 @@ class UICrafting(val full: UIInventoryFull) : UICanvas(), HasInventory {
|
||||
if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// NO super.render due to an infinite recursion
|
||||
this.uiItems.forEach { it.render(batch, camera) }
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
@@ -45,7 +46,7 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.graphicscontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.unicode.EMDASH
|
||||
import net.torvald.terrarum.App
|
||||
@@ -168,7 +169,7 @@ class UIIMEConfig(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val txt1 = Lang["MENU_LABEL_KEYBOARD_LAYOUT"]; val tw1 = App.fontGame.getWidth(txt1)
|
||||
@@ -266,7 +267,7 @@ private class UIItemInputKeycap(
|
||||
c in 0x1DC0..0x1DFF || c in 0x20D0..0x20FF || c in 0xFE20..0xFE2F ||
|
||||
c == 0xE31 || c in 0xE33..0xE3A || c in 0xE47..0xE4E
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
|
||||
// key background
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
@@ -119,7 +120,7 @@ class UIImportAvatar(val remoCon: UIRemoCon) : Advanceable() {
|
||||
Lang["ERROR_AVATAR_ALREADY_EXISTS"], // 2
|
||||
)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
val textboxWidth = textboxIndices.maxOf { App.fontGame.getWidth(Lang["CONTEXT_IMPORT_AVATAR_INSTRUCTION_$it"]) }
|
||||
val textX = (Toolkit.drawWidth - textboxWidth) / 2
|
||||
@@ -264,7 +265,7 @@ class UIItemCodeBox(parent: UIImportAvatar, initialX: Int, initialY: Int, val co
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw box backgrounds
|
||||
batch.color = UIInventoryFull.CELL_COL
|
||||
Toolkit.fillArea(batch, posX, posY, width, height)
|
||||
|
||||
@@ -213,7 +213,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
private val weightBarWidth = 60f
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background
|
||||
blendNormal()
|
||||
batch.color = backgroundColour
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
@@ -84,7 +85,7 @@ internal class UIInventoryCells(
|
||||
equipped.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
//itemList.posX = itemList.initialX + inventoryScrOffX.roundToInt()
|
||||
itemList.render(batch, camera)
|
||||
//equipped.posX = equipped.initialX + inventoryScrOffX.roundToInt()
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
@@ -178,31 +179,31 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
|
||||
// `screens` order
|
||||
private val screenRenders = arrayOf(
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
// text buttons
|
||||
gameMenuButtons.render(batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
keyboardSetupUI.render(batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
areYouSureMainMenuButtons.render(batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
savingUI.render(batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
keyConfigUI.render(batch, camera)
|
||||
},
|
||||
{ batch: SpriteBatch, camera: Camera ->
|
||||
{ batch: SpriteBatch, camera: OrthographicCamera ->
|
||||
// control hints
|
||||
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
|
||||
languageUI.render(batch, camera)
|
||||
@@ -281,7 +282,7 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
|
||||
yeet.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
batch.color = Color.WHITE
|
||||
screenRenders[screen](batch, camera)
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
@@ -313,7 +314,7 @@ class UIInventoryFull(
|
||||
internal var yEnd = -YPOS_CORRECTION + (App.scr.height + internalHeight).div(2).toFloat()
|
||||
private set
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
drawBackground(batch, 1f)
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class UIInventoryMinimap(val full: UIInventoryFull) : UICanvas() {
|
||||
minimapRerenderTimer += Gdx.graphics.deltaTime
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
val cellOffY = INVENTORY_CELLS_OFFSET_Y()
|
||||
val worldWidth = INGAME.world.width
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.GdxColorMap
|
||||
@@ -33,7 +34,7 @@ abstract class UIItemInventoryCellBase(
|
||||
open protected val highlightEquippedItem: Boolean = true // for some UIs that only cares about getting equipped slot number but not highlighting
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
abstract override fun update(delta: Float)
|
||||
abstract override fun render(batch: SpriteBatch, camera: Camera)
|
||||
abstract override fun render(batch: SpriteBatch, camera: OrthographicCamera)
|
||||
|
||||
/** Custom highlight rule to highlight tihs button to primary accent colour (blue by default).
|
||||
* Set to `null` to use default rule:
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.spriteanimation.AssembledSpriteAnimation
|
||||
import net.torvald.spriteanimation.SheetSpriteAnimation
|
||||
@@ -67,7 +68,7 @@ class UIItemInventoryEquippedView(
|
||||
itemGrid.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
val posXDelta = posX - oldPosX
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.UIItemInventoryCatBar.Companion.CAT_ALL
|
||||
@@ -289,7 +290,7 @@ open class UIItemInventoryItemGrid(
|
||||
// private fun getIconPosY(index: Int) =
|
||||
// posY + 8 + 26 * index
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
itemGrid.forEach { it.posX += posXDelta }
|
||||
itemList.forEach { it.posX += posXDelta }
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.BlendMode
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
@@ -110,7 +111,7 @@ class UIItemListNavBarVertical(
|
||||
var itemPage = 0
|
||||
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
|
||||
gridModeButtons.forEach { it.posX += posXDelta }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
@@ -30,7 +31,7 @@ class UIItemSaving(parentUI: UICanvas, initialX: Int, initialY: Int) : UIItem(pa
|
||||
init {
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// these things will not scroll along with the parent GUI!
|
||||
val t = Lang["MENU_IO_SAVING"]
|
||||
val tlen = App.fontGame.getWidth(t)
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.*
|
||||
@@ -200,7 +201,7 @@ class UIKeyboardControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
controlPalette.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// batch.color = borderNormal
|
||||
// Toolkit.drawBoxBorder(batch, drawX, drawY, width, height)
|
||||
// batch.color = fillCol
|
||||
@@ -336,7 +337,7 @@ private class UIItemKeycap(
|
||||
super.update(delta)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
|
||||
batch.color = if (key == null)
|
||||
@@ -446,7 +447,7 @@ class UIItemControlPaletteBaloon(val parent: UIKeyboardControlPanel, initialX: I
|
||||
)
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
|
||||
Toolkit.drawBaloon(batch, posX.toFloat(), posY.toFloat(), width.toFloat(), height.toFloat())
|
||||
|
||||
@@ -122,7 +122,7 @@ import java.util.zip.GZIPInputStream
|
||||
|
||||
private var loadFiredFrameCounter = 0
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
if (mode == MODE_INIT) {
|
||||
// "The Autosave is more recent than the manual save"
|
||||
Toolkit.drawTextCentered(batch, App.fontGame, Lang["GAME_MORE_RECENT_AUTOSAVE1"], Toolkit.drawWidth, 0, altSelDrawY)
|
||||
|
||||
@@ -304,7 +304,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
if (mode == 2) {
|
||||
loadFired += 1
|
||||
@@ -475,7 +475,7 @@ class UILoadDemoSavefiles(val remoCon: UIRemoCon) : Advanceable() {
|
||||
sliderFBO = FrameBuffer(Pixmap.Format.RGBA8888, uiWidth + 10, height, false)
|
||||
}
|
||||
|
||||
private fun setCameraPosition(batch: SpriteBatch, camera: Camera, newX: Float, newY: Float) {
|
||||
private fun setCameraPosition(batch: SpriteBatch, camera: OrthographicCamera, newX: Float, newY: Float) {
|
||||
camera.position.set((-newX + App.scr.halfw).roundToFloat(), (-newY + App.scr.halfh).roundToFloat(), 0f)
|
||||
camera.update()
|
||||
batch.projectionMatrix = camera.combined
|
||||
@@ -584,7 +584,7 @@ class UIItemPlayerCells(
|
||||
|
||||
private val avatarViewWidth = 120
|
||||
|
||||
fun render(batch: SpriteBatch, camera: Camera, offX: Int, offY: Int) {
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
// try to generate a texture
|
||||
if (!hasTexture) { acquirePlayerAvatar(); hasTexture = true }
|
||||
|
||||
@@ -652,7 +652,7 @@ class UIItemPlayerCells(
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(batch, camera, 0, 0)
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ class UIItemWorldCells(
|
||||
highlightCol = if (mouseUp) Toolkit.Theme.COL_MOUSE_UP else Toolkit.Theme.COL_LIST_DEFAULT
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// try to generate a texture
|
||||
if (skimmer.initialised && !hasTexture) {
|
||||
// load thumbnail or use stock if the file is not there
|
||||
|
||||
@@ -161,7 +161,7 @@ class UILoadList(val full: UILoadSavegame) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
val cells = playerCells
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
@@ -208,7 +209,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
|
||||
private var loadFiredFrameCounter = 0
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val buttonYdelta = (full.titleTopGradEnd) - full.playerButtonSelected!!.posY
|
||||
full.playerButtonSelected!!.render(batch, camera, 0, buttonYdelta)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.ui.Toolkit
|
||||
@@ -18,7 +19,7 @@ class UILoadNewCharacter(val full: UILoadSavegame) : UICanvas() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
transitionPanel.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
transitionPanel.render(batch, camera)
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ class UILoadSavegame(val remoCon: UIRemoCon) : Advanceable() {
|
||||
super.resize(width, height)
|
||||
}
|
||||
|
||||
internal fun setCameraPosition(batch: SpriteBatch, camera: Camera, newX: Float, newY: Float) {
|
||||
internal fun setCameraPosition(batch: SpriteBatch, camera: OrthographicCamera, newX: Float, newY: Float) {
|
||||
camera.position.set((-newX + App.scr.halfw).roundToFloat(), (-newY + App.scr.halfh).roundToFloat(), 0f)
|
||||
camera.update()
|
||||
batch.projectionMatrix = camera.combined
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.App.playersDir
|
||||
@@ -120,7 +121,7 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
// ui title
|
||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
@@ -151,7 +152,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
// ui title
|
||||
// val titlestr = Lang["CONTEXT_WORLD_NEW"]
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.ItemCodex
|
||||
@@ -71,7 +68,7 @@ class UIPaletteSelector(val parent: BuildingMaker) : UICanvas() {
|
||||
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw title bar
|
||||
batch.color = UINSMenu.DEFAULT_TITLEBACKCOL
|
||||
blendNormalStraightAlpha(batch)
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
@@ -42,7 +43,7 @@ class UIPerformanceControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.performancecontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.Second
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -17,7 +18,7 @@ class UIProxyLoadLatestSave(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.SanicLoadScreen
|
||||
@@ -21,7 +22,7 @@ class UIProxyNewBuildingMaker : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.random.HQRNG
|
||||
import net.torvald.terrarum.App
|
||||
@@ -26,7 +27,7 @@ class UIProxyNewRandomGame(val remoCon: UIRemoCon) : UICanvas() {
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
}
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
@@ -84,7 +85,7 @@ class UIQuickslotBar : UICanvas() {
|
||||
|
||||
private val itemCntTextCol = Color(0x404040ff)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
(Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.let { actor ->
|
||||
for (i in 0 until SLOT_COUNT) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
@@ -66,7 +67,7 @@ class UIQuickslotPie : UICanvas() {
|
||||
|
||||
private val drawColor = Color(1f, 1f, 1f, 1f)
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// draw radial thingies
|
||||
for (i in 0 until slotCount) {
|
||||
val qs = (Terrarum.ingame!! as TerrarumIngame).actorNowPlaying?.inventory?.getQuickslotItem(i)
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.App.*
|
||||
@@ -213,7 +214,7 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
||||
openUI = external
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
remoConTray.render(batch, camera)
|
||||
openUI?.render(batch, camera)
|
||||
}
|
||||
@@ -307,7 +308,7 @@ open class UIRemoCon(val parent: TitleScreen, val treeRoot: QNDTreeNode<String>)
|
||||
menubar.update(delta)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, camera: Camera) {
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(batch, camera)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Terrarum
|
||||
@@ -40,7 +41,7 @@ class UIScreenZoom : UICanvas(
|
||||
override fun updateUI(delta: Float) {
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
val offX = (App.scr.tvSafeGraphicsWidth * 1.25f).roundToInt().toFloat()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
@@ -31,7 +32,7 @@ class UISoundControlPanel(remoCon: UIRemoCon?) : UICanvas() {
|
||||
uiItems.forEach { it.update(delta) }
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
ControlPanelCommon.render("basegame.soundcontrolpanel", width, batch)
|
||||
uiItems.forEach { it.render(batch, camera) }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
@@ -179,7 +180,7 @@ internal class UIStorageChest : UICanvas(
|
||||
else
|
||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background fill
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameworld.WorldTime
|
||||
@@ -55,7 +56,7 @@ class UITierOneWatch() : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// light overlay or EL
|
||||
/*blendNormal(batch)
|
||||
if (ELon) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Terrarum
|
||||
@@ -104,7 +105,7 @@ class UITitleLanguage(remoCon: UIRemoCon?) : UICanvas() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
|
||||
batch.color = Color.WHITE
|
||||
textArea1.render(batch, camera)
|
||||
|
||||
@@ -135,7 +135,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
moduleCells.clear()
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.end()
|
||||
|
||||
lateinit var savePixmap: Pixmap
|
||||
@@ -260,7 +260,7 @@ class UITitleModules(val remoCon: UIRemoCon) : UICanvas() {
|
||||
sliderFBO = FrameBuffer(Pixmap.Format.RGBA8888, uiWidth + 10, height, true)
|
||||
}
|
||||
|
||||
private fun setCameraPosition(batch: SpriteBatch, camera: Camera, newX: Float, newY: Float) {
|
||||
private fun setCameraPosition(batch: SpriteBatch, camera: OrthographicCamera, newX: Float, newY: Float) {
|
||||
camera.position.set((-newX + App.scr.halfw).roundToFloat(), (-newY + App.scr.halfh).roundToFloat(), 0f)
|
||||
camera.update()
|
||||
batch.projectionMatrix = camera.combined
|
||||
|
||||
@@ -124,7 +124,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
//println("UITitleRemoConRoot bro u even updatez")
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
menubar.render(batch, camera)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CreditSingleton
|
||||
@@ -31,7 +32,7 @@ open class UITitleWallOfText(private val text: List<String>) : UICanvas() {
|
||||
textArea.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
batch.color = Color.WHITE
|
||||
textArea.render(batch, camera)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.Second
|
||||
@@ -45,7 +46,7 @@ class UITooltip : UICanvas() {
|
||||
get() = 36 * 2 + font.lineHeight.toInt()
|
||||
set(value) { throw Error("You are not supposed to set the height of the tooltip manually.") }
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val mouseXoff = 28f
|
||||
val mouseYoff = 0f
|
||||
val txtW = msgWidth + 2f * textMarginX
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.colourutil.darkerLab
|
||||
@@ -62,7 +63,7 @@ class UIVitalMetre(
|
||||
/**
|
||||
* g must be same as World Graphics!
|
||||
*/
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// TODO now that we just can't draw arcs, we need to re-think about this
|
||||
|
||||
/*if (vitalGetterVal() != null && vitalGetterMax() != null && player != null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameworld.WorldTime
|
||||
@@ -78,7 +79,7 @@ class UIWallCalendar : UICanvas(
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
val thisYear = INGAME.world.worldTime.years
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.*
|
||||
@@ -116,7 +117,7 @@ class UIWorldPortal : UICanvas(
|
||||
transitionPanel.update(delta)
|
||||
}
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
drawBackground(batch, 1f)
|
||||
|
||||
// UI items
|
||||
@@ -329,7 +330,7 @@ class UIItemWorldPortalTopBar(
|
||||
}
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
super.render(batch, camera)
|
||||
|
||||
// button
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
@@ -171,7 +172,7 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
|
||||
else
|
||||
"${App.gamepadLabelStart} ${Lang["GAME_ACTION_CLOSE"]} "
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
// background fill
|
||||
UIInventoryFull.drawBackground(batch, 1f)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
@@ -44,7 +45,7 @@ class UIWorldPortalDelete(private val full: UIWorldPortal) : UICanvas() {
|
||||
}
|
||||
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
full.selectedButton?.let {
|
||||
val buttonYdelta = (App.scr.tvSafeGraphicsHeight + 172 + 36) - it.posY
|
||||
val buttonXdelta = (Toolkit.drawWidth - it.width) / 2 - it.posX
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.*
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
@@ -339,7 +336,7 @@ class UIWorldPortalListing(val full: UIWorldPortal) : UICanvas() {
|
||||
private var selectedWorldThumb: TextureRegion? = null
|
||||
|
||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val memoryGaugeXpos = hx - memoryGaugeWidth - gridGap/2
|
||||
val memoryGaugeYpos = y + listHeight - buttonHeight
|
||||
val textXpos = memoryGaugeXpos + 3
|
||||
@@ -511,7 +508,7 @@ class UIItemWorldCellsSimple(
|
||||
super.update(delta)
|
||||
}
|
||||
|
||||
fun render(batch: SpriteBatch, camera: Camera, offX: Int, offY: Int) {
|
||||
fun render(batch: SpriteBatch, camera: OrthographicCamera, offX: Int, offY: Int) {
|
||||
super.render(batch, camera)
|
||||
|
||||
val posX = posX + offX
|
||||
@@ -543,7 +540,7 @@ class UIItemWorldCellsSimple(
|
||||
}
|
||||
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
render(batch, camera, 0, 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
@@ -63,7 +64,7 @@ class UIWorldPortalRename(private val full: UIWorldPortal) : UICanvas() {
|
||||
|
||||
private var oldPosX = full.posX
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val posXDelta = posX - oldPosX
|
||||
|
||||
// ugh why won't you just scroll along??
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.OrthographicCamera
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
@@ -153,7 +154,7 @@ class UIWorldPortalSearch(val full: UIWorldPortal) : UICanvas() {
|
||||
val icons = CommonResourcePool.getAsTextureRegionPack("terrarum-basegame-worldportalicons")
|
||||
|
||||
|
||||
override fun renderUI(batch: SpriteBatch, camera: Camera) {
|
||||
override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
|
||||
val memoryGaugeXpos = hx - memoryGaugeWidth/2
|
||||
val memoryGaugeYpos = drawY + sizeSelY + buttonHeight + 10
|
||||
val textXpos = memoryGaugeXpos + 3
|
||||
|
||||
Reference in New Issue
Block a user