Add tileScale in TileSetConfig. (#5874)

* Add `tileScale` in `TileSetConfig`.

* Right, KDoc.
This commit is contained in:
will-ca 2022-01-04 10:18:13 -08:00 committed by GitHub
parent 483dd2e871
commit 96beed4b3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,8 @@ class TileSetConfig {
var fogOfWarColor: Color = Color.BLACK
/** Name of the tileset to use when this one is missing images. Null to disable. */
var fallbackTileSet: String? = "FantasyHex"
/** Scale factor for hex images, with hex center as origin. */
var tileScale: Float = 1f
var ruleVariants: HashMap<String, Array<String>> = HashMap()
fun updateConfig(other: TileSetConfig){

View File

@ -246,11 +246,11 @@ open class TileGroup(var tileInfo: TileInfo, val tileSetStrings:TileSetStrings,
/** Used for: Underlying tile, unit overlays, border images, perhaps for other things in the future.
Parent should already be set when calling. */
private fun setHexagonImageSize(hexagonImage: Image) {
// Using "scale" can get really confusing when positioning, how about no
hexagonImage.setSize(hexagonImageWidth, hexagonImage.height * hexagonImageWidth / hexagonImage.width)
hexagonImage.setOrigin(hexagonImageOrigin.first, hexagonImageOrigin.second)
hexagonImage.x = hexagonImagePosition.first
hexagonImage.y = hexagonImagePosition.second
hexagonImage.setScale(tileSetStrings.tileSetConfig.tileScale)
}
private fun updateTileImage(viewingCiv: CivilizationInfo?) {