streamer mode wip

This commit is contained in:
minjaesong
2021-10-06 00:18:39 +09:00
parent 907dc9a936
commit 2c6dc8750a
19 changed files with 82 additions and 57 deletions

View File

@@ -40,15 +40,19 @@ object Toolkit : Disposable {
baloonTile.dispose()
}
val drawWidth: Int
get() = App.scr.width - if (App.getConfigBoolean("fx_streamerslayout")) App.scr.chatWidth else 0
val drawWidthf: Float
get() = drawWidth.toFloat()
fun drawCentered(batch: SpriteBatch, image: Texture, screenPosY: Int, ui: UICanvas? = null) {
val imageW = image.width
val targetW = ui?.width ?: App.scr.width
val targetW = ui?.width ?: drawWidth
batch.draw(image, targetW.minus(imageW).ushr(1).toFloat(), screenPosY.toFloat())
}
fun drawCentered(batch: SpriteBatch, image: TextureRegion, screenPosY: Int, ui: UICanvas? = null) {
val imageW = image.regionWidth
val targetW = ui?.width ?: App.scr.width
val targetW = ui?.width ?: drawWidth
batch.draw(image, targetW.minus(imageW).ushr(1).toFloat(), screenPosY.toFloat())
}